ActivityDate*/,
LastUpdateDate datetime not null
/*LastUpdateDate*/,
ApplicationName nvarchar(50) not null
/*ApplicationName*/,
constraint PK_PROFILES primary key (ProfileID)
)
go
/*==============================================================*/
/* Table: Supplier */
/*==============================================================*/
create table Supplier (
SupplierID int identity
/*SupplierID*/,
SupplierName nvarchar(50) not null
/*SupplierName*/,
Address nvarchar(100) not null
/*Address*/,
Phone nvarchar(20) not null
/*Phone*/,
constraint PK_SUPPLIER primary key (SupplierID)
)
go
alter table Account
add constraint FK_ACCOUNT_REFERENCE_PROFILES foreign key (ProfileID)
references Profiles (ProfileID)
go
alter table Cart
add constraint FK_CART_REFERENCE_ITEM foreign key (ItemID)
references Item (ItemID)
go
alter table Cart
add constraint FK_CART_REFERENCE_PROFILES foreign key (ProfileID)
references Profiles (ProfileID)
go
alter table Item
add constraint FK_ITEM_REFERENCE_PRODUCT foreign key (ProductID)
references Product (ProductID)
go
alter table Item
add constraint FK_ITEM_REFERENCE_SUPPLIER foreign key (SupplierID)
references Supplier (SupplierID)
go
alter table OrderItem
add constraint FK_ORDERITE_REFERENCE_ORDERS foreign key (OrderID)
references Orders (OrderID)
go
alter table Product
add constraint FK_PRODUCT_REFERENCE_CATEGORY foreign key (CategoryID)
references Category (CategoryID)
go
alter table ProductCount
add constraint FK_PRODUCTC_REFERENCE_ITEM foreign key (ItemID)
references Item (ItemID)
go