Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
go
create table Offices (ono CHARACTER (1) not null primary key,
ytdsales numeric(9,2) not null default(0),
zmin character (5) not null default(0),
zmax character (5) not null default(0),
address character (35) not null default (0),
city character (15)default (' '),
state character (2) default (' '),
zip character (5)default (' '),
phone character (12) default (' '))
CREATE TABLE Salesman
(salesman character (3) not null primary key,
ono character (1) not null,
notes character (100) not null,
name character (30) not null default (' '),
ytdsales numeric (9,2)not null default (0),
phone character (12) default (' '),
address character (30)default (' '),
city character (15) default (' '),
state character (2) default (' '),
zip character (5) default (' '),
foreign key (ono)references Offices(ono))
create table Customer
(cno character (5) not null primary key,
company character (35)not null,
contact character (20) not null,
address character (30)not null,
city character (15) not null,
state character (2)default (' '),
zip character (5)default (' '),
phone character (12)default (' '),
ono character (1),
ytdpurch numeric (8,2)default (0),
lat numeric (7,4)default (0),
long numeric (8,4) default (0),
foreign key (ono) references Offices(ono))
create table Parts
(pno character (5)not null default ('T9999') primary key,
descript character (24) not null default (' '),
onhand numeric (6) not null default(0),
onorder numeric (6) not null default(0),
price numeric (8,2) not null default (0),
cost numeric (8,2)not null default (0),
ytdunits numeric (6) default (0),
ytdsales numeric (8,2) default (0))
create table Invoices
(ino numeric (4) not null default (9999) primary key,
cno character (5) not null,
idate smalldatetime not null default (0),
itotal numeric (8,2) not null default (0),
salesman character (3) not null,
foreign key (cno) references Customer (cno),
x 708',300,22,50,20,30,900);