EASIEST SOLUTION WITH 1046ms RUNTIME and BEATS  74.61%
Intuition\n Describe your first thoughts on how to solve this problem. \nTo find the first year each product was sold and retreive the quantity and price for th
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nTo find the first year each product was sold and retreive the quantity and price for the year \n# Approach\n<!-- Describe your approach to solving the problem. -->\nIdentify the first year each product was sold and then retrieve them using join\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(N)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(P) p-number of unique products\n# Code\n```mysql []\nSELECT s.product_id, s.year AS first_year, s.quantity, s.price\nFROM Sales s\nJOIN (\n    SELECT product_id, MIN(year) AS first_year\n    FROM Sales\n    GROUP BY product_id\n) AS first_sales\nON s.product_id = first_sales.product_id AND s.year = first_sales.first_year;\n\n```
['MySQL']