1 Replies - 846 Views - Last Post: 17 February 2009 - 11:31 PM Rate Topic: -----

#1 ken7280  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 01-December 08

Create Table Error

Posted 17 February 2009 - 11:09 PM

I get an error when excuting my job_title table creation. It doesn't like my Exempt_NON_Exempt_Status column name, which is the same as in my Employye table which runs ok.

CREATE DATABASE Kudler_Fine_Foods

USE Kudler_Fine_Foods
-- CREATING JOB TITLE TABLE

CREATE TABLE Job_title
(
EEO1_Classification varchar (50) NOT NULL,
Job_title varchar (50) NOT NULL PRIMARY KEY,
Job_description varchar (500) NOT NULL,
Exempt_NON_Exempt_Status varchar(25) NOT NULL,
)

-- CREATING EMPLOYEE TABLE
 
CREATE TABLE Employee
(
EmployeeID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
Last_name varchar(50) NOT NULL,
First_name varchar(50) NOT NULL,
Address varchar(50) NOT NULL,
City varchar(25) NOT NULL,
State char(2) NOT NULL,
Telephone_area_code INT NOT NULL,
Telephone_number varchar (9) NOT NULL,
EEO1_Classification varchar(50) NOT NULL,
Hire_date varchar (10) NOT NULL,
Salary money NOT NULL,
Gender varchar (7) NOT NULL,
Age INT NOT NULL,
Job_title varchar (50) NOT NULL,
Exempt_Non_Exempt_Status varchar(25) NOT NULL,
--FOREIGN KEY REFERENCES Job_title(Job_title)
)

GO:

-- INSERTING DATA INTO JOB TITLE TABLE 
USE Kudler_Fine_Foods
INSERT INTO Job_title (EEO1_Classification,Job_title,Job_description,Exempt_NON_Exempt_Status)
VALUES ('Office/Clerical','Accounting clerk','Computes, classifies, records, and verifies numerical data for use in maintaining
accounting records.','NON-Exempt')
INSERT INTO Job_title (EEO1_Classification,Job_title,Job_description,Exempt_NON_Exempt_Status)  
VALUES ('Officials & Managers','Asst. Manager','Supervises and coordinates activities of workers in department of food store.
Assists store manager in daily operations of store.','Exempt')
INSERT INTO Job_title (EEO1_Classification,Job_title,Job_description,Exempt_NON_Exempt_Status)
VALUES ('Sales Workers','Bagger','Places customer orders in bags. Performs carryout duties for customers.','NON-Exempt')
INSERT INTO Job_title (EEO1_Classification,Job_title,Job_description,Exempt_NON_Exempt_Status)
VALUES ('Sales Workers','Cashier','Operates cash register to itemize and total customer’s purchases in grocery
store.','Exempt')
INSERT INTO Job_title (EEO1_Classification,Job_title,Job_description,Exempt_NON_Exempt_Status)
VALUES ('Technician','Computer Support Specialist','Installs, modifies, and makes minor repairs to personal computer hardware and
software systems, and provides technical assistance and training to system
users.','NON_Exempt')
INSERT INTO Job_title (EEO1_Classification,Job_title,Job_description,Exempt_NON_Exempt_Status)
VALUES ('Officials & Managers','Director of Finance & Accounting','Plans and directs the finance and accounting activities for Kudler Fine Foods.','NON_Exempt')
INSERT INTO Job_title (EEO1_Classification,Job_title,Job_description,Exempt_NON_Exempt_Status)
VALUES ('Craft Workers (Skilled)','Retail Asst. Bakery & Pastry','Obtains or prepares food items requested by customers in retail food store.','NON_Exempt')
INSERT INTO Job_title (EEO1_Classification,Job_title,Job_description,Exempt_NON_Exempt_Status)
VALUES ('Operatives (Semi skilled)','Retail Asst. Butchers and Seafood Specialists','Obtains or prepares food items requested by customers in retail food store.','NON_Exempt')
INSERT INTO Job_title (EEO1_Classification,Job_title,Job_description,Exempt_NON_Exempt_Status)
VALUES ('Office/Clerical','Stocker','Stores, prices and restocks merchandise displays in store.','NON_Exempt')



--INSERT DATA INTO EMPLOYEE TABLE
INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('Edelman','Glen','175 Bishops Lane','La Jolla','CA','619','555-0199','Sales Workers','10/7/2003','$10.75','Male','64','Cashier','NON_Exempt')
INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('McMullen','Eric','673 Church St.','Lemon Grove','CA','619','555-0133','Sales Workers','11/1/2002','$6.75','Male','20','Bagger',' NON_Exempt')
INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('Slentz','Raj','123 Torrey Dr.','North Clairmont','CA','619','555-0123','Officials & Managers','6/1/2000','$48,000','Male','34','Asst. Manager','Exempt')
INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('Broun','Erin','2045 Parkway','Encinitas','CA','760','555-0100','Officials & Managers','3/12/2001','$10,530','Female','24','Bagger','NON_Exempt')
INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('Carpenter','Donald','927 Second St.','Encinitas','CA','619','555-0154','Office/Clerical','11/1/2003','$7.50','Male','18','Stocker','NON_Exempt')
INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('Esquivez','David','10983 N.Coast Hwy, Apt 902','Encinitas','CA','760','555-0108','Operatives (Semi skilled)','7/25/2003','$9.25','Male','25','Retail Asst. Butchers and Seafood Specialists','NON_Exempt')
INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('Sharp','Nancy','10793 Montecino Road','Ramona','CA','858','555-0135','Sales Workers','7/12/2003','$10.50','Female','24','Cashier','NON_Exempt')

INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('McNamara','Juanita','923 Parkway','Lowry','CA','619','555-0200','Office/Clerical','10/29/1999','$12.75','Female','32','Accounting Clerk','NON_Exempt') 

INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('Nguyen','Meredith','10583 Arenas Dr.','La Jolla','CA','619','555-0102','Technician','9/27/1998','$20.75','Male','35','Computer Support Specialist','NON_Exempt')

INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('Stephens','Harvey','7863 High Bluff Drive','La Jolla','CA','619','555-0123','Officials & Managers','3/1/1998','$75,000','Male','51','Director of Finance & Accounting','Exempt')
 
INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('Avery','Ledonna','198 Governor Dr.','Del mar','CA','619','555-0135','Craft Workers (Skilled)','3/28/2003','$10.50','Female','23','Retail Asst. Bakery & Pastry','NON_Exempt')

INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('Drohos','Craig','243 Rose Dr.','Solano Beach','CA','619','555-0202','Officials & Managers','6/15/2000','$51,000','Male','32','Asst. Manager','Exempt')  

INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('Meier','Elaine','9703 Druaid Lane','Del Mar','CA','858','555-0112','Sales Workers','9/10/2000','$10.25','Female','51','Cashier','NON_Exempt')

INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('Quillian','Stanley','98542 Wandering Rd. Apt 2B','Del Mar','CA','760','555-0198','Operatives (Semi skilled)','12/16/1999','$11.50','Male','29','Retail Asst. Butchers and Seafood Specialists','NON_Exempt')

INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('Tyink','Thomas','87592 Pacific Heights Blvd.','Del Mar','CA','858','555-0159','Craft Workers (Skilled)','5/1/2001','$9.50','Male','32','Retail Asst. Bakery & Pastry','NON_Exempt')

INSERT INTO Employee (Last_name,First_name,Address,City,State,Telephone_area_code,Telephone_number,EEO1_Classification,Hire_date,salary,Gender,Age,Job_title,Exempt_NON_Exempt_Status)
VALUES ('Vance','Brent','927 Cynthia Ln.','Sporray','CA','858','555-0147','Sales Workers','3/29/2001','$6.25','Male','22','Bagger','NON_Exempt')
  



Is This A Good Question/Topic? 0
  • +

Replies To: Create Table Error

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4424
  • View blog
  • Posts: 12,293
  • Joined: 18-April 07

Re: Create Table Error

Posted 17 February 2009 - 11:31 PM

Well at the end of that line you have a comma before you end the table definition... you will need to get rid of it.

Exempt_NON_Exempt_Status varchar(25) NOT NULL, <-- Get rid of that comma



That should fix the problem for you.

:)
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1