First and foremost this is a homework assignment but I believe I have completed everything that I need I just want to double check that I am doing it correctly. The assignment calls for two tables to be created and Employee Table and a Job Title table. The employee table has all the fields a regular employee table would have, name, address, etc. and the last field requirement states "Foreign key from Job Title table. The Job Title table has 4 fields Classification, Job Title, Job Description, and Status. Here is what I have done. This is the code for the Job Title TableUSE KudlerFineFoodsCREATE TABLE JobTitle( EE01Classification varchar(50) NOT NULL, JobTitle varchar(30) PRIMARY KEY NOT NULL, JobDescription varchar(500) NOT NULL, Status varchar(20) NOT NULL)
This is the code for the Employee TableUSE KudlerFineFoodsCREATE TABLE Employees( EmployeeID int IDENTITY PRIMARY KEY NOT NULL, LastName varchar(30) NOT NULL, FirstName varchar(30) NOT NULL, Address varchar(50) NOT NULL, City varchar(30) NOT NULL, State char(2) NOT NULL, AreaCode char(3) NOT NULL, Phone char(8) NOT NULL, EE01Classification varchar(50) NOT NULL, HireDate smalldatetime NOT NULL, Salary money NOT NULL, Gender char(1) NOT NULL, Age char(2) NOT NULL, JobTitle varchar(30) REFERENCES JobTitle(JobTitle) NOT NULL)
My question is 1) Have I done this correctly and 2) If I have, when I write the code to populate the rows in the employee table do I include a Job Title.