Loading problem...
An analytics warehouse stores catalog data and transactional order events.
Table: products
Table: orders
Task: Build a report of products whose total ordered units in February 2020 reached at least 100.
Business rules:
Output requirements:
Supported submission environments:
products:
| product_id | product_name | product_category |
|------------|-----------------------|------------------|
| 1 | Data Structures Guide | Books |
| 2 | String Theory Notes | Books |
| 3 | Falcon Laptop | Electronics |
| 4 | Nimbus Tee | Apparel |
orders:
| product_id | order_date | unit |
|------------|-------------|------|
| 1 | 2020-02-05 | 60 |
| 1 | 2020-02-17 | 70 |
| 2 | 2020-02-10 | 80 |
| 3 | 2020-02-24 | 5 |
| 4 | 2020-02-25 | 50 |
| 4 | 2020-02-27 | 50 |
| 4 | 2020-03-01 | 50 |[
{"product_name":"Data Structures Guide","unit":130},
{"product_name":"Nimbus Tee","unit":100}
]Product 1 has 130 February units and product 4 has 100 February units. Product 2 has only 80 and product 3 has only 5.
products:
| product_id | product_name | product_category |
|------------|-------------------|------------------|
| 10 | Solar Charger | Accessories |
| 11 | Noise Earbuds | Electronics |
orders:
| product_id | order_date | unit |
|------------|-------------|------|
| 10 | 2020-01-31 | 90 |
| 10 | 2020-02-01 | 10 |
| 11 | 2020-02-29 | 100 |[
{"product_name":"Noise Earbuds","unit":100}
]January rows are excluded. Product 10 has only 10 in February, while product 11 reaches the threshold exactly with 100.
products:
| product_id | product_name | product_category |
|------------|------------------|------------------|
| 21 | Mesh Router | Networking |
| 22 | Smart Thermostat | Home |
orders:
| product_id | order_date | unit |
|------------|-------------|------|
| 21 | 2020-03-02 | 100 |
| 22 | 2020-02-10 | 40 |
| 22 | 2020-02-20 | 50 |[]No product reaches 100 units in February 2020.
Constraints