Write the SQL commands required to answer the following queries:
- Find the number and name of each customer located in the city of Grove
- Find the number, name, balance, and credit limit for all customers with balances that exceed their credit limits
- List the descriptions of all parts that are located in warehouse 3 and for which there are more than 25 units on hand.
- 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.
- Find the number, name, and available credit (the credit limit minus the balance) for each customer.
- Find the number, name, and available credit for each customer with at least $5,000 of available credit.
- List the number, name, and complete address of each customer located on a street that contains the letters “Central.”
- List the number, name, and credit limit for each customer with a credit limit of $5,000, $10,000, or $15,000.
- Find the number of each customer that currently has an open order. List each customer only once.
- Count the number of customers that currently have open orders.
- List each credit limit and the number of customers of sales rep 20 that have this limit
- List each credit limit and the number of customers having each credit limit
- Repeat Q 12, but list only those credit limits held by more than one customer
- List the number and name of each customer with a null (unknown) street value
Homework :
- Retrieve the city that has more than two customers live in it. Order the result in descending order.
- Show the maximum and minimum price of each part class,but restrict the output to those parts for which the warehouse is not1.
- Show all details of the parts that have a number starts with letter k.
- List the sum of the balances of all customers for each sales rep. Order the results by sales rep number.
- 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.
- What is the price of the least expensive part in the database?
- Find the total of the balances for all customers represented by sales rep 65 with balances that are less than their credit limits
- List the part number and part description of each part that is not in item class AP.