Use the Magic Store Database (SQL - W3 Magic Store Database Overview) to complete the practice questions for week.
In addition to the practice problems from the lesson pages, write queries to do the following:
Show Products Ordered by a Client: Write a query to list all products ordered by the client with the ID of 2. Show product names for orders made by this client.
List All Products with Their Suppliers, Sorted by Supplier Name and Product Price: Display a list of all products along with their supplier names. Sort the list first by the supplier’s name in ascending order, and then by the product’s price in descending order.
Show Orders Placed After a Specific Date: Write a query to display orders placed after ‘2022-01-01’, including order ID, product names, and order date. Sort the results by product name.
List All Orders for ‘Elixir of Immortality’: Display all orders that include the ‘Elixir of Immortality’, showing the order ID and the date the order was placed. Show the most recent orders first.
# Submission Instructions
Please put all SQL queries for the practice questions into a single SQL file. Use comments to label each query with its respective question number. Submit this .sql file for your assignment on Canvas.
# Lessons
- SQL - W7 Many-to-Many Relationships
- SQL - W7 JOIN Tables with Many-to-Many Relationships
- SQL - W7 Table Aliasing
- SQL - W7 Practice Assignment