Professional Documents
Culture Documents
You will come up with each of your data sets yourself. You should have at least five
records for each table. Include screenshots that show the populated tables annotated
with the SQL statements that you used
1.’
2.
SELECT * FROM `books`;
3.
SELECT * FROM `bookstore`;
4.
SELECT `ordernum`, `customername`, `customeremail`, `phonnumber`, `customerID` FROM`customer`
;
5.
SELECT `zipcode`, `order_date`, `employeeName`, `address`, `phonnumber`, `hire_date`, `employ
eeID` FROM `employee`;
6.
SELECT `orderamt`, `order_date`, `orderdetails`, `pymmethod`, `order_no` FROM `order_`;
7.
SELECT `productprice`, `productdesc`, `productID`, `productname` FROM `product`;
C. Queries: After you have populated the tables, write queries to extract the data to
answer the owner's questions. Include screenshots that show each query and the
corresponding query results.
--How many books are sole each month by the publisher?
SELECT PublisherName, COUNT (*)
FROM OrderHistory OH JOIN Books B
ON OH.BookID = B.BookID
GROUP BY PublisherName;
--What are the most popular products besides books that are sold in each store?
SELECT ProductID
FROM OrderHistory
WHERE ProductID NOT IN (SELECT BookID FROM Books);