Skip to content

Latest commit

 

History

History
54 lines (24 loc) · 1.69 KB

File metadata and controls

54 lines (24 loc) · 1.69 KB

Putting it all together

Using the Dellstore2 database, complete the following queries based on requests from the CEO at your company. Items in italics are to be included in an aggregate email of all of your responses to the instructor.

1 => "Get me a list of all of our products with above average sales". Send me the number of items in this list.

2 => Based on the first list, tell me the top 3 selling titles.

3 => Get me a list of how many orders have been placed by Sam Williams. (There are multiple people named Sam Williams; just pretend it's all the same person). How many total orders Have been placed?

When was Sam Williams most active ?

(When did he place his orders) ?

4 => What are the two cheapest PINOCCHIO movies? (PINOCCHIO is the second part of the title of many of our movies).

send me the names and prices of the two cheapest PINOCCHIO movies

send me the PINOCCHIO query so I can re-use it later

5 => Add an auto-incrementing 'id' column to the "reorder" table, then populate that table with two or three lines of data. Remember that when you add rows to an auto-incrementing table, you don't have to include 'id' as one of the columns to populate. It should do it for you. In postgres, SERIAL is the equivalent to auto-increment. (Hint: syntax for this is back on Unit01.md)

Question: if you delete the final record of an auto-incrementing table, and that final record's auto-incremented value (id) was 9, what will be the the value of the next record inserted into the table? In other words, delete 9, and what will the next record be?

send me the answer to this question

Email all of your answers IN ONE EMAIL to complete this assignment.