Table Store_Information
Table Internet_Sales
and we want to find out all the dates where there are both store sales and internet sales. To do so, we use the following SQL statement:
SELECT Date FROM Store_Information
INTERSECT
SELECT Date FROM Internet_Sales
Result:
| store_name | Sales | Date |
| Los Angeles | $1500 | Jan-05-1999 |
| San Diego | $250 | Jan-07-1999 |
| Los Angeles | $300 | Jan-08-1999 |
| Boston | $700 | Jan-08-1999 |
Table Internet_Sales
| Date | Sales |
| Jan-07-1999 | $250 |
| Jan-10-1999 | $535 |
| Jan-11-1999 | $320 |
| Jan-12-1999 | $750 |
SELECT Date FROM Store_Information
INTERSECT
SELECT Date FROM Internet_Sales
Result:
| Date |
| Jan-07-1999 |
No comments:
Post a Comment