Write the SQL commands required to answer the following queries:

  1. Find the number and name of each customer located in the city of Grove
  2. Find the number, name, balance, and credit limit for all customers with balances that exceed their credit limits
  3. List the descriptions of all parts that are located in warehouse 3 and for which there are more than 25 units on hand.
  4. List the number, name, and balance of all customers with balances greater than or equal to $2,000 and less than or equal to $5,000.
  5. Find the number, name, and available credit (the credit limit minus the balance) for each customer.
  6. Find the number, name, and available credit for each customer with at least $5,000 of available credit.
  7. List the number, name, and complete address of each customer located on a street that contains the letters “Central.”
  8. List the number, name, and credit limit for each customer with a credit limit of $5,000, $10,000, or $15,000.
  9. Find the number of each customer that currently has an open order. List each customer only once.
  10. Count the number of customers that currently have open orders.
  11. List each credit limit and the number of customers of sales rep 20 that have this limit
  12. List each credit limit and the number of customers having each credit limit
  13. Repeat Q 12, but list only those credit limits held by more than one customer
  14. List the number and name of each customer with a null (unknown) street value

Homework :

  1. Retrieve the city that has more than two customers live in it. Order the result in descending order.
  1. Show the maximum and minimum price of each part class,but restrict the output to those parts for which the warehouse is not1.
  1. Show all details of the parts that have a number starts with letter k.
  1. List the sum of the balances of all customers for each sales rep. Order the results by sales rep number.
  1. List the sum of the balances of all customers for each sales rep, but restrict the output to those sales reps for which the sum is more than $10,000.
  1. What is the price of the least expensive part in the database?
  1. Find the total of the balances for all customers represented by sales rep 65 with balances that are less than their credit limits
  1. List the part number and part description of each part that is not in item class AP.