Skip to content

Commit 8bb9dda

Browse files
authored
Create product-sales-analysis-iii.sql
1 parent 5d51c23 commit 8bb9dda

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

MySQL/product-sales-analysis-iii.sql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Time: O(n)
2+
# Space: O(n)
3+
4+
SELECT product_id,
5+
Min(year) AS first_year,
6+
quantity,
7+
price
8+
FROM sales
9+
GROUP BY product_id
10+
ORDER BY NULL

0 commit comments

Comments
 (0)