-- Here is the DROP TABLE statement for the workson tableDROP TABLE IF EXISTS workson; -- Put the DROP TABLE statement for the project table here -- Put the DROP TABLE statement for the deptlocation...

-- Here is the DROP TABLE statement for the workson tableDROP TABLE IF EXISTS workson;
-- Put the DROP TABLE statement for the project table here
-- Put the DROP TABLE statement for the deptlocation table here
-- Put the DROP TABLE statement for the department table here
-- Put the DROP TABLE statement for the dependent table here
-- Here is the DROP TABLE statement for the employee table


/* The following CREATE TABLE statement creates the EMPLOYEE table */CREATE TABLE employee ( fname VARCHAR(20) NOT NULL, mint VARCHAR(1) NOT NULL, lname VARCHAR(40) NOT NULL, ssn CHAR(9), bdate DATE, address VARCHAR(50), sex CHAR(3), salary DECIMAL(8,2), superssn CHAR(9), dno VARCHAR(8), CONSTRAINT empPK PRIMARY KEY (ssn), CONSTRAINT empsuperFK FOREIGN KEY (superssn) REFERENCES employee (ssn));
-- Put the CREATE TABLE statement for the dependent table here
-- Put the CREATE TABLE statement for the department table here
-- Put the CREATE TABLE statement for the deptlocation table here
-- Put the CREATE TABLE statement for the project table here
-- Put the CREATE TABLE statement for the workson table here
/* The following statement adds a foreign key to the employee table. The foreign key could not be added when the employee table was created as the department table did not exist at that time.
Until the department table is created, you will receive an error when this statement runs. After the department table is created, the error should go away.*/ALTER TABLE employeeADD CONSTRAINT empdepFK FOREIGN KEY (dno) REFERENCES department (dnumber);
-- This command turns off referential integrity checks for the INSERT statementsSET FOREIGN_KEY_CHECKS=0;
-- This is one of the INSERT statements for the employee tableINSERT INTO employee VALUES ('John','B','Smith','123456789','1965-01-09','731 Fondren, Houston, TX','M',30000,'333445555','5')-- Put the rest of the rows for the employee table here;
-- Put the INSERT statement for the dependent table here
-- Put the INSERT statement for the department table here
-- Put the INSERT statement for the deptlocation table here
-- Put the INSERT statement for the project table here
-- Put the INSERT statement for the workson table here
-- This command turns the referential integrity checks back onSET FOREIGN_KEY_CHECKS=1;
Jul 24, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here