MIS 309 Database Systems SQL Practice – Assignment 4

Given the following table Store_Information

Store_Name Sales Date Los Angeles $1500 Jan-05-2006 San Diego $250 Jan-07-2006 Los Angeles $300 Jan-08-2006 Boston $700 Jan-08-2006

1. Find all data in this table.

2. Find all store names in this table.

3. Find stores with sales above $1,000.

4. Find all stores with sales greater than $1,000 or all stores with sales less than $500 but greater than $275.

5. Find all records for the Los Angeles and the San Diego stores (use IN).

6. Find all stores whose name contains 'AN'. MIS 309 Database Systems SQL Practice – Assignment 4

Given the following table Store_Information

Store_Name Sales Date Los Angeles $1500 Jan-05-2006 San Diego $250 Jan-07-2006 Los Angeles $300 Jan-08-2006 Boston $700 Jan-08-2006

7. Find all of the unique store names in this table.

8. Calculate the sum of all sales from this table.

9. Calculate the total sales for each store.

10. Find only the stores with sales over $1,500. (Use HAVING)

11. Also given the table Internet_Sales

Date Sales Jan-07-2006 $250 Jan-10-2006 $535 Jan-11-2006 $320 Jan-12-2006 $750

Find all dates where there is a sales transaction.