Question: /* ################### START CREATE AND POPULATE DATABASE ########################## */ DROP DATABASE IF EXISTS mycustomer; CREATE DATABASE mycustomer; USE mycustomer; CREATE TABLE customer( cid varchar(4), cname

/* ################### START CREATE AND POPULATE DATABASE ########################## */ DROP DATABASE IF EXISTS mycustomer; CREATE DATABASE mycustomer; USE mycustomer; CREATE TABLE customer( cid varchar(4), cname varchar(20), street varchar(20), city varchar(20), country varchar(20), phone varchar(12), PRIMARY KEY(cid) ); CREATE TABLE custorder( oid varchar(4), cid varchar(4), orderdate date, shippingdate date, PRIMARY KEY(oid), FOREIGN KEY(cid) REFERENCES customer(cid) ); CREATE TABLE itemorder( oid varchar(4), iid varchar(4), quantity int, totalprice decimal(9,2), PRIMARY KEY(oid, iid), FOREIGN KEY(oid) REFERENCES custorder(oid) ); INSERT INTO customer VALUES ('C223','COMPAQ', '3 Barbados Ave', 'Bridgetown','Barbados','809-956-2345'); INSERT INTO customer VALUES ('C224','IBM', '14 Ruthven Rd', 'Kingston','Jamaica','876-927-2654'); INSERT INTO customer VALUES ('C225','IBM', '24 Hart St', 'Port-au-Prince','Trinidad','309-913-2345'); INSERT INTO customer VALUES ('C226','GATEWAY', '30 Austin Ave', 'Kingston','Jamaica','876-956-2458'); INSERT INTO customer VALUES ('C227','IBM', '5 Seville Rd', 'Bridgetown','Barbados','809-756-1345'); INSERT INTO customer VALUES ('C228','GATEWAY', '3 Kings Way', 'Port-au-Prince','Trinidad','309-756-2375'); INSERT INTO custorder VALUES ('O010','C223','2020-09-24','2020-09-26'); INSERT INTO custorder VALUES ('O011','C227','2020-09-15','2020-09-20'); INSERT INTO custorder (oid, cid, orderdate) VALUES ('O012','C224','2021-01-16'); INSERT INTO custorder VALUES ('O013','C225','2020-07-15','2020-07-20'); INSERT INTO custorder (oid, cid, orderdate) VALUES ('O014','C224','2021-02-16'); INSERT INTO itemorder VALUES('O010','i110',10, 600000.00); INSERT INTO itemorder VALUES('O010','i111',5, 300000.00); INSERT INTO itemorder VALUES('O011','i110',8, 540000.00); INSERT INTO itemorder VALUES('O012','i113',20, 1000000.00); INSERT INTO itemorder VALUES('O012','i111',6, 360000.00); INSERT INTO itemorder VALUES('O012','i114',6, 600000.00); INSERT INTO itemorder VALUES('O013','i114',9, 800000.00); /* ################### END CREATE AND POPULATE DATABASE ########################## */

Question 1 Find the customer(s) details who have not made an order. Question 2 Find the customer(s) details who is/are from either Trinidad or Barbados. Question 3 Create a view called Tot_Per_Ord as follows: Tot_Per_Ord(Order ID#, TOT_COST) containing the total cost of each order. Question 4 Find the name, street, city and country of all companies who have made orders in September 2020. List them in alphabetical order on the company name. Question 5 Find the name of the companies that order item# i110. Question 6 Find the unit cost per item (assume the cost of each unit does not vary for each order). Question 7 Find the order that has the greatest total cost. Question 8 Find the order where the cost is greater that the average cost, Question 9 Double the quantity of item# i111 on order #O012 (assume that the unit cost does not vary). Question 10 Assume that the shipping date of those orders being sent to customers in Barbados were delayed by 5 days. Depict this in the database.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!