Create a database for a store that sells outdoor camping and sporting goods. The
ID: 3547508 • Letter: C
Question
Create a database for a store that sells outdoor camping and sporting goods. The tables should be as shown below.
You may change the -- ID primary key data if you need to do it. The excel spreadsheets have one table on each spreadsheet.
The tables and data have to be built with SQL queries.
CustomerSales
LineNo receipt# CusID ItemNo
201310001 130001 10001 IT1001
201310002 130001 10001 IT1002
201310003 130002 10002 IT1007
201310004 130002 10002 IT1007
201310005 130002 10002 IT1008
201310006 130003 10003 IT1004
Explanation / Answer
CREATE TABLE CustomerSales
(
Line_No int,
receipt# int,
CusID int,
ItemNo varchar(8)
);
INSERT INTO CustomerSales
VALUES (201310001, 130001, 10001, 'IT1001'),
(201310002, 130001, 10001, 'IT1002'),
(201310003, 130002, 10002, 'IT1007'),
(201310004, 130002, 10002, 'IT1007'),
(201310005, 130002, 10002, 'IT1008'),
(201310006, 130003, 10003, 'IT1004');
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.