我必須建立一個數據庫,創建表並插入信息:插入到SQL Server
我有數據庫和表,但是當我插入我有問題...
任何幫助將是讚賞。這是我第一次嘗試SQL。
/* This script creates the SQL database and tables
** for Kudler Fine Foods
** Human Resources
*/
CREATE DATABASE Mor ;
Go
USE Mor
CREATE TABLE Employee (
Emp_id int NOT NULL IDENTITY(1,1),
Last_name varchar(25),
First_name varchar(25),
Address varchar(40),
City varchar (15),
State char(2),
Telephone_area_code varchar(3),
Telephone_number varchar(8),
Job_title varchar(50),
Hire_date smalldatetime,
Wage money,
Gender char(1),
Race varchar(25),
Age int);
CREATE TABLE Job_title (
Job_title varchar (50) PRIMARY KEY,
EEO_1_Classification varchar(30),
Job_description varchar(250),
Exempt_Non_Exempt_Status bit);
/* This script inserts values into Job_title table
** (Note: 1 means exempt (salaried)
** 0 means non-exempt (hourly)
*/
INSERT INTO Job_title
VALUES
('Accounting Clerk', 'Office/Clerical',
'Computes, classifies, records, and verifies numerical data for use in maintaining
accounting records.',
'0');
VALUES
('Assistant Manager', 'Officials & Managers',
'Supervises and coordinates activities of workers in department of food store.
Assists store manager in daily operations of store.' ,
'1');
VALUES
('Bagger','Sales Workers',
'Places customer orders in bags. Performs carryout duties for customers.',
'0');
VALUES
('Cashier','Sales Workers',
'Operates cash register to itemize and total customer’s purchases in grocery
store.',
'0');
VALUES
('Computer Support Specialist','Technician',
'Installs, modifies, and makes minor repairs to personal computer hardware and
software systems, and provides technical assistance and training to system
users.',
'0');
VALUES
('Dir. of Fin. & Acct.','Officials & Managers',
'Plans and directs the finance and accounting activities for Kudler Fine Foods.',
'1');
VALUES
('Asst. - Bakery & Pastry','Craft Workers (Skilled)',
'Obtains or prepares food items requested by customers in retail food store.',
'0');
VALUES
('Asst. - Butchers & Seafood Specialists','Operatives (Semi skilled)',
'Obtains or prepares food items requested by customers in retail food store.',
'0');
VALUES
('Stocker','Office/Clerical',
'Stores, prices and restocks merchandise displays in store.',
'0')
有一天我的編輯權利會到來。 – amelvin 2010-06-29 00:43:55