Skip to content

Commit beef011

Browse files
authored
Create fix-product-name-format.sql
1 parent 02a4651 commit beef011

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

MySQL/fix-product-name-format.sql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Time: O(nlogn)
2+
# Space: O(n)
3+
4+
SELECT LOWER(TRIM(product_name)) product_name,
5+
substring(sale_date, 1, 7) sale_date,
6+
count(sale_id) total
7+
FROM sales
8+
GROUP BY 1, 2
9+
ORDER BY 1, 2;

0 commit comments

Comments
 (0)