LOWER()
to convert product_name
to lowercase.TRIM()
to remove leading and trailing whitespace from product_name
.DATE_FORMAT()
to convert sale_date
to the 'YYYY-MM' format.product_name
and formatted sale_date
.COUNT()
to calculate the total number of sales for each group.product_name
and sale_date
in ascending order.erDiagram Sales { int sale_id PK varchar product_name date sale_date }