Skip to content

1543. Fix Product Name Format

1
2
3
4
5
6
7
SELECT
  LOWER(TRIM(product_name)) AS product_name,
  DATE_FORMAT(sale_date, '%Y-%m') AS sale_date,
  COUNT(*) AS total
FROM Sales
GROUP BY 1, 2
ORDER BY 1, 2;