easy and crispy
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```mssql []
with cte as(select s.product_id, year, quantity, price,
rank() over(partition by s.product_id order by year asc) as rnk
from sales s join product p
on s.product_id = p.product_id)
select product_id, year as first_year, quantity, price
from cte
where rnk = 1;
```
['MS SQL Server']