Postgre SQL Solution
\n# Approach\n1. We are given with only one table so no need to use JOINs here.\n2. We need to find the number of diff products sold for each date , this indica
\n# Approach\n1. We are given with only one table so no need to use JOINs here.\n2. We need to find the number of diff products sold for each date , this indicates we need to group the products by "date"\n3. The output should contain three columns: sell_date, num_sold (distinct count of products) and products\n4. ORDER BY products & ORDER BY sell_date\n5. In order to group the products seperated by comma \n STRING_AGG() Function can be used in postgre sql\n\n# Code\n```\n--For each date -- find no of diff prod sold\n--order prod name lexico, order by sell_date\n--Output -- sell_date, num_sold , products\n\nSELECT sell_date, COUNT(DISTINCT product) AS num_sold, \nSTRING_AGG(DISTINCT product, \',\' ORDER BY product) AS products\nFROM Activities\nGROUP BY sell_date\nORDER BY sell_date\n\n```
['PostgreSQL']