Question
NEED HELP IN INSERT STATEMENTS FOR THE TABLES CAN YOU PLEASE ADD SOME INSERT STATEMENTS FOR A COMPANY SCHEMA SCRIPT. PLEASE ADN THANK YOU DROP
NEED HELP IN INSERT STATEMENTS FOR THE TABLES
CAN YOU PLEASE ADD SOME INSERT STATEMENTS FOR A COMPANY SCHEMA SCRIPT. PLEASE ADN THANK YOU
DROP TABLE dependent; DROP TABLE works_on; DROP TABLE project; DROP TABLE dept_locations; DROP TABLE department; DROP TABLE employee;
CREATE TABLE employee ( fname varchar(15) not null, minit varchar(1), lname varchar(15) not null, ssn char(9), bdate date, address varchar(50), sex char, salary numeric(10,2), superssn char(9), dno numeric, primary key (ssn), foreign key (superssn) references employee(ssn) );
CREATE TABLE department ( dname varchar(25) not null, dnumber numeric, mgrssn char(9) not null, mgrstartdate date, primary key (dnumber), unique (dname), foreign key (mgrssn) references employee(ssn) );
ALTER TABLE employee ADD foreign key (dno) references department(dnumber);
CREATE TABLE dept_locations ( dnumber numeric, dlocation varchar(15), primary key (dnumber,dlocation), foreign key (dnumber) references department(dnumber) );
CREATE TABLE project ( pname varchar(25) not null, pnumber numeric, plocation varchar(15), dnum numeric not null, primary key (pnumber), unique (pname), foreign key (dnum) references department(dnumber) );
CREATE TABLE works_on ( essn char(9), pno numeric, hours numeric(4,1), primary key (essn,pno), foreign key (essn) references employee(ssn), foreign key (pno) references project(pnumber) );
CREATE TABLE dependent ( essn char(9), dependent_name varchar(15), sex char, bdate date, relationship varchar(8), primary key (essn,dependent_name), foreign key (essn) references employee(ssn) );
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started