Imagine you're a business analyst working for an e-commerce company. You have access to a comprehensive Sales table that records every product sale across multiple years. Your task is to identify the breakthrough moment for each product - finding all sales that occurred during the very first year each product entered the market.
The Sales Table Structure:
| Column Name | Type | Description |
|---|---|---|
| sale_id | int | Unique identifier for each sale |
| product_id | int | Product identifier |
| year | int | Year when the sale occurred |
| quantity | int | Number of units sold |
| price | int | Price per unit |
Your Mission: For each product, determine its launch year (earliest year it appears in sales) and return all sales records from that inaugural year. This helps identify which products had strong initial performance and understand launch patterns.
Output Format: Return a table with columns product_id, first_year, quantity, and price for all first-year sales.
Input & Output
Constraints
- 1 โค sale_id โค 106
- 1 โค product_id โค 104
- 2000 โค year โค 2030
- 1 โค quantity โค 1000
- 1 โค price โค 104
- (sale_id, year) combination is unique
- Each product appears in at least one sales record