Easy Solution
SQL\n\nselect sell_date, count(distinct product) as num_sold,group_concat(distinct product) as products from Activities group by sell_date\n\n# Python\n\nimport
# SQL\n```\nselect sell_date, count(distinct product) as num_sold,group_concat(distinct product) as products from Activities group by sell_date\n```\n# Python\n```\nimport pandas as pd\n\ndef categorize_products(activities: pd.DataFrame) -> pd.DataFrame:\n  return activities.groupby(\'sell_date\')[\'product\'].agg([(\'num_sold\',\'nunique\'),(\'products\',lambda x: \',\'.join(sorted(x.unique())))]).reset_index()\n\n```
['Pandas']