How Product1 and Product2 performed for the first 100 days from their launch date. The result should be like Day1 Product1 Product2
Asked in the technical screen stage. This was the final and hardest of 5 SQL questions on Orders, Products, and Sellers tables.
day_number, product1, and product2, showing units sold for each product on that relative launch day.day_number ascending.1 as each product's launch date, with each subsequent day advancing one calendar day.order_date equals the calculated calendar date for that product and relative day.quantity, ignoring null quantities and returning 0 when no non-null quantity exists.product1 and product2 totals as whole-number bigint values.| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique product identifier |
| product_name | VARCHAR(100) | Product display name |
| launch_date | DATE | Date the product launched |
| category | VARCHAR(100) | Product category |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| product_id | INT | Ordered product identifier |
| order_date | DATE | Date the order was placed |
| quantity | INT | Number of units in the order |
| seller_name | VARCHAR(100) | Seller associated with the order |