TyroCity

WK2 Activity - Working with queries

Practice table::

Order ID Customer Name Order Date Total Cost Status
1 Jane Doe 1/1/2022 $100.00 Shipped
2 Jane Doe 1/2/2022 $75.00 Pending
3 Mark Smith 1/3/2022 $50.00 Shipped
4 Emily Gray 1/4/2022 $200.00 Shipped
5 Tom Hill 1/5/2022 $150.00 Pending
6 Sarah Jones 1/6/2022 $25.00 Shipped
7 Mike Brown 1/7/2022 $300.00 Pending
8 Anna Green 1/8/2022 $100.00 Shipped
9 David White 1/9/2022 $50.00 Pending
10 Karen Black 2/10/2022 $175.00 Shipped

Questions to answer:

  1. Retrieve all orders that have been shipped.
  2. Retrieve all orders that are still pending.
  3. Retrieve all orders that have a total cost of $100 or more.
  4. Retrieve all orders that were placed in January 2022.
  5. Retrieve all orders that were placed by customers whose name starts with "J".
  6. Retrieve all orders that were placed by customers whose name contains the letter "a".
  7. Retrieve the total cost of all orders that have been shipped.
  8. Retrieve the average cost of all orders that are still pending.
  9. Retrieve the earliest order date for each customer.
  10. Retrieve the customer who has placed the most orders.

Top comments (0)