Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Find out all sales records for product 1X1 and 2X2 CREATE TABLE soldvia ( productid CHAR(3) NOT NULL, tid VARCHAR(8) NOT NULL, noofitems INT NOT
Find out all sales records for product 1X1 and 2X2
CREATE TABLE soldvia ( | |
productid CHAR(3) NOT NULL, | |
tid VARCHAR(8) NOT NULL, | |
noofitems INT NOT NULL, | |
PRIMARY KEY (productid, tid), | |
FOREIGN KEY (productid) REFERENCES product(productid), | |
FOREIGN KEY (tid) REFERENCES salestransaction(tid) | |
); |
INSERT INTO soldvia VALUES ('1X1','T111',1); | |
INSERT INTO soldvia VALUES ('2X2','T222',1); | |
INSERT INTO soldvia VALUES ('3X3','T333',5); | |
INSERT INTO soldvia VALUES ('1X1','T333',1); | |
INSERT INTO soldvia VALUES ('4X4','T444',1); | |
INSERT INTO soldvia VALUES ('2X2','T444',2); | |
INSERT INTO soldvia VALUES ('4X4','T555',4); | |
INSERT INTO soldvia VALUES ('5X5','T555',2); | |
INSERT INTO soldvia VALUES ('6X6','T555',1); | |
INSERT INTO soldvia VALUES ('7X7','T666',1); | |
INSERT INTO soldvia VALUES ('9X9','T666',1); | |
INSERT INTO soldvia VALUES ('1X3','T666',2); | |
INSERT INTO soldvia VALUES ('8X8','T777',1); | |
INSERT INTO soldvia VALUES ('1X4','T888',4); | |
INSERT INTO soldvia VALUES ('2X3','T888',3); | |
INSERT INTO soldvia VALUES ('9X9','T999',1); |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started