Question: create table Promotion ( PromoID char ( 3 ) not null , PromoName varchar ( 5 0 ) not null, PromoDiscount decimal ( 4 ,
create table Promotion
PromoID char not null
PromoName varchar not null,
PromoDiscount decimal not null,
primary keyPromoID
;
create table Category
CategoryID char not null,
CategoryName varchar not null,
CategoryDesc varchar not null,
primary keyCategoryID
;
create table Chocolate
ChocolateID char not null,
ChocolateName varchar not null,
ChocolateDesc varchar not null,
ChocolatePrice decimal not null,
ChocolateWeight INT not null,
primary keyChocolateID
foreign key CategoryID references CategoryCategoryID
;
create table Discount
PromotionID char not null,
ChocolateID char not null,
StartDate DATETIME not null,
EndDate DATETIME not null,
primary key PromotionID ChocolateID
foreign key ChocolateID references ChocolateChocolateID
foreign key PromotionID references PromotionPromotionID
;
Create table Customer
CustomerID char not null,
CustomerName varchar not null,
CustomerEmail varchar not null,
CustomerPhNum varchar not null,
primary keyCustomerID
;
Create table Review
ReviewID char not null,
ReviewRating decimal not null,
ReviewComment varchar not null,
ReviewDate DATETIME not null,
primary key ReviewID
foreign key ChocolateID references ChocolateChocolateID
foreign key CustomerID references CustomerCustomerID
;
Once successfully implemented, these insert statements should work.
INSERT INTO Promotion VALUES
P "Opening Sale", ;
INSERT INTO Category VALUES
CAT "Ecuador Single Origin", "Cocoa beans from a single Ecuadorian source";
INSERT INTO Chocolate VALUES
CHOC "Dark Chocolate Tablet", "Small, bite sized dark chocolate tablets", 'CAT;
INSERT INTO Discount VALUES
P 'CHOC::::;
INSERT INTO Customer VALUES
CUS "Jon Snow", jsnow@notreal.com", ;
INSERT INTO Review VALUES
REV "A delicious milk chocolate", :: 'CUS'CHOC;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
