程序代写代做 ## Create Employee table

## Create Employee table
create table employee (ssn char(11) not null primary key,
employee_name varchar(20) not null,
salary numeric(8,2) not null,
date_of_hire date);

insert into employee values(‘134568877′,’Jim Jones’,’28000′,’1/26/2015′);
insert into employee values(‘138568050′,’Rita Bita’,’32000′,’2/15/2017′);
insert into employee values(‘334558877′,’Holly Dew’,’29000′,’1/15/2016′);
insert into employee values(‘666566666′,’Pablo Escobar’,’48000′,’1/26/2014′);
insert into employee values(‘888918870′,’Al Capone’,’40000′,’1/26/2015′);
insert into employee values(‘111223333′,’Bonnie Clyde’,’42000′,’4/7/2015′);

select * from employee;

### create Department Table
create table Depart(DeptID int primary key, DeptName varchar(20) not null, managerssn varchar(11),
startingDate date,foreign key(managerssn) references employee(ssn))

insert into Depart values(‘1′,’hot foods’,’666566666′,’1/1/2016′),
(‘2′,’sandwich’,’888918870′,’1/1/2016′),
(‘3′,’snacks’,’138568050′,’5/5/2015′),
(‘4′,’beverages’,’334558877′,’3/18/2018′)
select * from Depart;

###Create employeeDepartment table##

create table employeeDepartment(ssn varchar(11), supervisorssn varchar(11),DepartID integer,foreign key(ssn) references employee(ssn),
foreign key(supervisorssn) references employee(ssn),
foreign key(DeptID) references Dept(DeptID))
insert into employeeDepartment values (‘134568877′,’138568050′,’1’);
insert into employeeDepartment values (‘138568050′,’334558877′,’4’);
insert into employeeDepartment values (‘334558877′,’666566666′,’2’);
insert into employeeDepartment values (‘666566666′,’138568050′,’3’);
insert into employeeDepartment values(‘888918870′,’666566666′,’1’);
insert into employeeDepartment values(‘111223333’, ‘888918870’,’2′);

select * from employeeDepartment;