Академический Документы
Профессиональный Документы
Культура Документы
use empleadodanielaquino;
create table DEPT
(deptno numeric(2) not null,
dname varchar(14),
loc varchar(13),
primary key(deptno));
create table SALGRADE
(grade numeric(3),
losal varchar(6),
hisal varchar(6),
primary key(grade));
create table PRODUCT
(prodid numeric(6) not null,
descrip varchar(30),
primary key(prodid));
create table PRICE
(PRODID numeric(6),
STDPRICE numeric (8,2),
MINPRICE numeric (8,2),
STARTDATE date,
ENDDATE date,
foreign key (PRODID) references PRODUCT(PRODID));
create table EMP
(empno numeric(4) not null,
ename varchar(10),
job varchar(9),
mgr numeric(4),
hiredate date,
sal numeric(7,2),
comm numeric(7,2),
deptno numeric(2),
primary key(empno),
foreign key (mgr) references EMP(empno),
foreign key (deptno) references DEPT(deptno));
create table CUSTOMER
(custid numeric(6) not null,
name varchar(45),
address varchar(40),
city varchar(30),
state varchar(2),
zip varchar(9),
area numeric(3),
phone varchar(9),
repid numeric(4) not null,
creditlimit numeric(9,2),
comments text(60),
primary key(custid),
foreign key (repid) references EMP(empno));
create table ORD
(ordid numeric(4) not null,
orderdate date,
commplan varchar(1),
(605,1,100861,45,100,4500),
(605,2,100870,2.8,500,1400),
(605,3,100890,58,5,290),
(605,4,101860,24,50,1200),
(605,5,101863,9,100,900),
(605,6,102130,3.4,10,34),
(612,4,100871,5.5,100,550),
(619,4,100871,5.6,50,280);