Return int null,
Order date datetime not null
) table Order
add constraint PK_ORDER primary key nonclustered ( Order ID )
/* Table: Posts */table Posts (
Post ID int not null,
Post name varchar (100) not null,
Salary varchar (200) not null
) table Posts
add constraint PK_POSTS primary key nonclustered ( Post ID )
/* Table: Return */table Return (
Return ID int not null,
Warehouse int null,
Order ID int not null,
Return reason varchar (100) not null
) table Return
add constraint PK_RETURN primary key nonclustered ( Return ID )
/* Table: Suppliers */table Suppliers (
Supplier ID int not null,
Warehouse int null,
Name varchar (100) not null,
Addres varchar (100) not null,
Phone int not null
) table Suppliers
add constraint PK_SUPPLIERS primary key nonclustered ( Supplier ID )
/* Table: Warehouse */table Warehouse (
Shelving number int not null,
Goods ID int not null,
Quantity int not null
) table Warehouse
add constraint PK_WAREHOUSE primary key nonclustered ( Shelving number )
/* Table: містить */table містить (
Goods int not null,
Order int not null,
Quantity int not null,
Price varchar (200) not null
) table містить
add constraint PK_СОДЕРЖІТ primary key nonclustered (Goods, Order ) table Employees
add constraint FK_EMPLOYEE_ЗАКРЕПЛЯЕ_POSTS foreign key ( Post ID )
references Posts ( Post ID )
on update cascadetable Employees
add constraint FK_EMPLOYEE_ЗАКРЕПЛЯЮ_DIVISION foreign key ( Division ID )
references Divisions ( Division ID )
on update cascadetable Goods
add constraint FK_GOODS_ПРІНАДЛЕЖ_GOODS TY foreign key ( Article number )
references Goods type ( Article number )
on update cascadetable Order
add constraint FK_ORDER_ДЕЛАЕТ_CLIENT foreign key (Client)
references Client (Number)
on update cascadetable Order
add constraint FK_ORDER_ОПРЕДЕЛЕН_RETURN foreign key ( Return )
references Return ( Return ID )
on update cascadetable Order
add constraint FK_ORDER_ОФОРМЛЕТ_EMPLOYEE foreign key ( Employee ID )
references Employees ( Employee ID )
on update cascadetable Return
add constraint FK_RETURN_ВОЗВРАТ Н_WAREHOUS foreign key (Warehouse)
references Warehouse ( Shelving number )
on update cascadetable Suppliers
add constraint FK_SUPPLIER_ПОСТАВЛЯЮ_WAREHOUS foreign key (Warehouse)
references Warehouse ( Shelving number )
on update cascadetable Warehouse
add constraint FK_WAREHOUS_СОДЕРЖІТС_GOODS foreign key ( Goods ID )
references Goods ( Goods ID )
on update cascadetable містить
add constraint FK_СОДЕРЖІТ_СОДЕРЖІТ_GOODS foreign key (Goods)
references Goods ( Goods ID )
on update cascadetable містить
add constraint FK_СОДЕРЖІТ_СОДЕРЖІТ_ORDER foreign key ( Order )
references Order ( Order ID )
on update cascade