Tutorial Lesson 2: Question 1 SQL Interview Question
Tutorial Lesson 2: Question 1
SQL Interview Question
Write a query to output the sales information for denim () shirts ().
Schema:
| Column Name | Type |
|---|
| sales_id | integer |
| order_id | integer |
| product_id | integer |
| unit_price | decimal (5,2) |
| quantity | integer |
| total_price | decimal (5,2) |
Example Input:
| sales_id | delivery_order_id | product_id | unit_price | quantity | total_price |
|---|
| 1 | 1 | 218 | 127.00 | 2 | 254.00 |
| 2 | 1 | 481 | 140.00 | 1 | 140.00 |
| 3 | 1 | 2 | 141.60 | 3 | 424.80 |
Schema:
| Column Name | Type |
|---|
| product_id | integer |
| product_type | string |
| product_name | string |
| size | string |
| colour | string |
| unit_cost | decimal (5,2) |
| quantity | integer |
Example Input:
| product_id | product_type | product_name | size | colour | unit_cost | quantity |
|---|
| 1 | Shirt | Oxford Cloth | S | red | 114.00 | 53 |
| 2 | Shirt | Oxford Cloth | M | red | 114.00 | 54 |
| 3 | Shirt | Oxford Cloth | L | red | 114.00 | 69 |