Home > Articles

  • Print
  • + Share This
This chapter is from the book


  1. Write a SQL statement to retrieve all customer IDs (cust_id) from the Customers table.

  2. The OrderItems table contains every item ordered (and some were ordered multiple times). Write a SQL statement to retrieve a list of the products (prod_id) ordered (not every order, just a unique list of products). Here’s a hint: you should end up with seven unique rows displayed.

  3. Write a SQL statement that retrieves all columns from the Customers table and an alternate SELECT that retrieves just the customer ID. Use comments to comment out one SELECT so as to be able to run the other. (And, of course, test both statements.)

  • + Share This
  • 🔖 Save To Your Account