SQL Exercises


Follow these directions to export the Northwinds database to MariaDB (or MySQL).          

Northwinds database.

Use the database to answer these queries:

  1. Get supplier names and order ID for all orders.
  2. Get supplier name, order ID and product name for all orders supplied by "Tokyo Traders."
  3. Get supplier name, order ID, product name, and dollar value of the amount of that product ordered for each order supplied by "Tokyo Traders."
  4. Get the shipper name and supplier name for all orders shipped by "Speedy Express."
  5. List the shipper name and the number of orders shipped by each shipper.
  6. Display the quantity ordered of each product.
  7. Write a query that shows how many orders are associated with each customer ID. Note that the customerID field is replaced with the Customer’s name. Why is that?
  8. Total inventory (dollar value) on hand by category.
  9. Show the company names of all customers that have ordered the product "Aniseed Syrup."
  10. Show the company names of all suppliers who have discontinued products.
  11. Show the total dollar value of all the orders we have for each customer (one dollar amount for each customer). Order the list in descending order.
  12. Show all products that have UnitsInStock that are below the ReorderLevel.
  13. What are the last names of all employees born before Jan 1, 1960?
  14. List the supplier name and city for all suppliers based in the United States.
  15. List the supplier name and URL for all suppliers that have a home page.
  16. Using one of the special operators, list the supplier name and country for all suppliers based in an English-speaking county.
  17. Using one of the special operators, list the product name and price for all products that sell for as little as $10 and as much as $20.
  18. List the company name for all customers whose company name falls between 'L' and 'O', inclusive.
  19. List the last name and title for all employees who work in sales.

key