Question: Use the sample database (four tables invoice, Product, LineItem, and Customer) to answer the following questions. 1. Give a SQL query that lists all customers
Use the sample database (four tables invoice, Product, LineItem, and Customer) to answer the following questions.
1. Give a SQL query that lists all customers in California and Nevada.
2. Give a SQL query that lists all products that have been purchased by a customer in California.
3. Give a SQL query that lists all line items that are part of invoice number 11731.
4. Give a SQL update statement that raises all prices by ten percent.
Invoice Table:
| Invoice_Number | Customer_Number | Payment |
| INTEGER | INTEGER | DECIMAL(10,2) |
| 11731 | 3175 | 0 |
| 11732 | 3176 | 249.50 |
| 11733 | 3175 | 0 |
LineItem Table:
| Invoice_Number | Product_Cod | Quantity |
| INTEGER | CHAR(7) | INTEGER |
| 11731 | 116-064 | 3 |
| 11731 | 257-535 | 1 |
| 11731 | 643-119 | 2 |
| 11732 | 116-064 | 10 |
| 11733 | 116-064 | 2 |
| 11733 | 643-119 | 1 |
Product Table:
| Product_Code | Description | Price |
| CHAR(7) | VARCHAR(40) | DECIMAL(10,2) |
| 116-064 | Toaster | 24.95 |
| 257-535 | Hair Dryer | 29.95 |
| 643-119 | Car Vacuum | 19.99 |
Customer Table
| Customer_Number | Name | Address | City | State | ZIP |
| INTEGER | VARCHAR(40) | VARCHAR(40) | VARCHAR(30) | CHAR(2) | CHAR(5) |
| 3175 | Sams Small Appliances | 100 Main Street | Anytown | CA | 98765 |
| 3176 | Electronics Unlimited | 1175 Liberty Ave | Pleasantville | MI | 45066 |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
