Course Resources

Search

Search IconIcon to open search

Last updated Nov 17, 2024

# One-to-Many JOINs - Practice Assignment

  1. Write a query to list all orders and the clients who placed them, sorted by the order date.

  2. Write a query to list all suppliers and their products, where the supplier’s phone number starts with ‘+14’, sorted by the supplier name.

  3. Write a query to list all orders placed by the client with the first name ‘Amity’ in 2021 (i.e. between ‘2021-01-01’ and ‘2021-12-31’). Include the client first and last name, the order date and the order ID. (You can compare dates strings just like numbers! For example WHERE Date > '2021-12-01' would return only rows where the Date was more recent than December 1st, 2021. BETWEEN also works with dates)

  4. Write a query to list all orders placed between ‘2022-01-01’ and ‘2022-12-31’ by clients whose accounts were created on or after ‘2022-01-01’, including the order ID, the client’s first and last name, the date the order was placed and the date the client’s account was created.

# Lessons