Sachin Kumar
Sachin Kumar

@Sachintukumar

5 تغريدة 2 قراءة Aug 20, 2023
Day 37 of #SQL Series🤖🎯
💹 Today I Solved a Amazing Question of
SQL #Interview Question 📊📉
🧵
In this problem, your task is to group the products sold on each date and calculate the total number of products sold on that date
You are given a table named Activities. Each row in table represents a sales activity, and the #columns contain essential details as shown below
Below is how the above #SQL script works:
The SELECT statement retrieves data from the Activities table.
We select the sell_date column to represent the date of sales.
The COUNT(*) #function calculates the total number of products sold on each sell date.
The GROUP_CONCAT(DISTINCT product ORDER BY product ASC) function concatenates the distinct product names for each sell date, ordered alphabetically.
The GROUP BY clause groups the results by sell_date, ensuring that the #aggregation is performed for each unique date.
The ORDER BY clause sorts the results in ascending order of sell_date.
🙏Follow @Sachintukumar for more

جاري تحميل الاقتراحات...