You are on page 1of 2

use osb_username

go
create table BakeryCustomer(
CustomerID bigint identity not null,
CustomerName varchar(50) not null,
CustomerPhone varchar(50) null,
Constraint PK_bakerycustomer_customerid
primary key clustered(customerID)
)
create table BakeryProduct(
ProductID bigint identity not null,
ProductDescription varchar(50) not null,
ProductPrice varchar(50) not null,
Constraint PK_bakeryProduct_ProductID
)
create table BakeryOrder(
OrderID bigint identity not null,
ProductID bigint identity not null,
CustomerID bigint identity not null,
OrderDate Datetime null,
OrderDeliveryDate datetime not null,
OrderQuantity int not null,
constarint PK_BakeryOrder_OrderID_ProductID_CustomerID
primary key clustered(OrderID, ProductID, CUstomerID),
constraint FK_BakeryCustomer_CustomerID
foreign key (CustomerID) references
BakeryCustomer (CustomerID),
contraint FK_BakeryProduct_ProductID
Foreign key (productID) references BakeryProduct (ProcductID)
go
---------------------------------------------------------------------------------------------------create table VideoCategory(
CategoryID bigint identity not null,
CategoryDescription varchar(50) not null,
Constraint PK_VideoCategory_CategoryID
primary key clustered(CategoryID)
)
create table VideoCustomer(
CustomerID bigint identity not null,
CustomerLastName varchar(50) not null,
CustomerFirstName varchar(50) not null,
CustomerAddress varchar(50) not null,
CustomerCity varchar(50) null,
CustomerState varchar(2) null,
CustomerZipCode varchar(15) null,
constraint PK_VideoCustomer_CustomerID Primary Key
clustered(customerID)
)
create table VideoFormat(
FormatID bigint identity not null,
FormatDescription varchar(30) not null,
constraint PK_VideoFormat_FormatID Primary Key
clustered(FormatID)
)
create table VideoRental(
VideoID bigint identity not null,
VideoDateOut smalldatetime not null,
VideoDateDue smalldatetime not null,

VideoDateIn smalldatetime not null,


VideoDeliveryStatus varchar(10) not null,
VideoLateFee smallmoney null,
CustomerID bigint not null
TitleID bigint not null,
constraint PK_VideoRental_RentalID Primary Key
clustered(customerID)
references
)

You might also like