Answer To: AW Bikes is a bike retailer. They sell bikes and related products direct to consumers. Prior to...
Neha answered on Jul 27 2021
88519 - db/basic questions.sql
Create table Address(
AddressId int,
Address varchar(50) not null,
City varchar(30) not null,
State char(2) not null,
ZipCode varchar(10) not null,
constraint pk_Address Primary Key (AddressId));
Create table Customer(
CustomerID int,
Title varchar(8),
FirstName varchar(50) not null,
MiddleName varchar(50),
LastName varchar(50) not null,
Suffix varchar(10),
AddressId int,
ShippingAddressId int,
constraint fk_Address foreign key (AddressId) REFERENCES Address(AddressId),
constraint fk_ShippingAddress foreign key (ShippingAddressId) REFERENCES Address(AddressId),
constraint pk_Customer Primary Key (CustomerID));
Create table Vendor(
VendorID int,
Name varchar(50) not null,
constraint pk_Vendor primary key (VendorID));
Create table Category(
CategoryId int,
Name varchar(50) not null,
constraint pk_Vendor primary key (CategoryId));
Create table Product(
ProductID int,
Model varchar(50) not null,
Name varchar(50) not null,
ProductNumber varchar(25),
Color varchar(15),
ListPrice numeric(9,2),
Cost numeric(9,2),
Category varchar(50) not null,
VendorID int,
CategoryId int,
constraint pk_Product Primary key (ProductID),
constraint fk_Category foreign key (CategoryId) REFERENCES Category(CategoryId)
constraint fk_Vendor foreign key (VendorID)...