# One-to-Many JOINs - Practice Assignment
Write a query to list all orders and the clients who placed them, sorted by the order date.
Write a query to list all suppliers and their products, where the supplier’s phone number starts with ‘+14’, sorted by the supplier name.
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 theDate
was more recent than December 1st, 2021.BETWEEN
also works with dates)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
- SQL - W3 Table JOINs - Introduction
- SQL - W3 Table JOINs - DROP Tables
- SQL - W3 Magic Store Database Overview
- SQL - W3 Table JOINs - One-to-Many Relationships
- SQL - W3 Table JOINs - JOIN Tables with One-to-Many Relationships
- SQL - W3 Table JOINs - Filter and Sort with JOINs
- SQL - W3 One-to-Many JOINs - Practice Assignment