Тёмный

Data Analysis SQL Interview Questions | Running SUM | Who Hit the Sales Target First 

Absent Data
Подписаться 46 тыс.
Просмотров 51 тыс.
50% 1

We will use a window function in SQL to get the running sum of sales by each salesperson so that we can find out who hit the sales target first. This is a very common data analysis SQL interview question. So, master the fundamentals here and you will be an ACE in your next meeting.
#dataanalysis
#sqlinterview
#sql
Learn and Practide SQL coding online at DataCamp, check out my affiliate link:
datacamp.pxf.i...

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 36   
@mauthoigian8027
@mauthoigian8027 10 месяцев назад
I think you should divide the problem into 2 parts: 1.employee reaching 100k earliest and 2.employee reaching 100k fastest. Your solution helps with the 1st prob and the 2nd problem should use other logic (compare the days it takes for each emp to get 100k sales ) 🎉
@absentdata
@absentdata 10 месяцев назад
Nice approach
@johnvak7390
@johnvak7390 6 месяцев назад
I started learning sql 2 month ago, and man I woulda been lost if i saw this. Now that 2 month have past, I can understand this. Woo
@absentdata
@absentdata 6 месяцев назад
So glad that you were able to found my content too
@SapeHallward
@SapeHallward 2 дня назад
What resources do you use most to learn sql?
@johnvak7390
@johnvak7390 День назад
@@SapeHallward SQL beginner courses on RU-vid
@brandoncyoung
@brandoncyoung Год назад
Really great SQL tip!
@absentdata
@absentdata Год назад
Glad it was helpful!
@southafricangamer7174
@southafricangamer7174 21 день назад
I had to take it in piece by piece and understood :)
@absentdata
@absentdata 21 день назад
Thats the best way to learn. Great!
@HarshKumar-jw7eu
@HarshKumar-jw7eu Месяц назад
Fall in love with this query
@SergiusBfg
@SergiusBfg 5 месяцев назад
You window func in ussless. You can group BEFORE selection. And try CTE. It will be more performaanced
@deaconwill2430
@deaconwill2430 Месяц назад
really good explanation
@sanjeevkumawat9694
@sanjeevkumawat9694 11 месяцев назад
I this question could be solved by this way also: Select salesperson_name, min(sale_date) as target from sales_data Group by salesperson_name Having sum(amount)= 100000 Order by target
@absentdata
@absentdata 11 месяцев назад
This query will only return the first date where the sales person had a single day of sales at the 10000. It does not account for the previous sales. So a running total is needed.
@Thekingslayer-ig5se
@Thekingslayer-ig5se Год назад
Great one bro
@absentdata
@absentdata Год назад
I appreciate it!
@Gauravkumar-wk1rf
@Gauravkumar-wk1rf 16 дней назад
Nice video
@zg3671
@zg3671 27 дней назад
Excel can solve this with the ifs function
@ubaid1231
@ubaid1231 26 дней назад
Sir, please share table also, so, we practice in sql server by hand..
@Gauravkumar-wk1rf
@Gauravkumar-wk1rf 16 дней назад
Can you provide tables database in your shorts or channel
@suryateja1320
@suryateja1320 5 месяцев назад
What is the sql application we should use to learn for data analytics for begginers
@absentdata
@absentdata 4 месяца назад
MySQL is a good one
@akkshhey09
@akkshhey09 Год назад
Why did you do MIN(sale_date)?
@absentdata
@absentdata Год назад
We want to get the first date at which the sum was 100,000 or more. So we use the MIN() to get that date
@urdaty
@urdaty Год назад
What does order by 2 mean?
@koushikkanumuri253
@koushikkanumuri253 Год назад
it means order by 2nd column , in this case it's sale date
@absentdata
@absentdata Год назад
Second column
@tuturam2510
@tuturam2510 Год назад
what software guys?
@absentdata
@absentdata Год назад
Microsoft SQL Server Studio but Windows Functions work in most DBMS with the exception of SQL lite and a few others.
@Smile-et3fe
@Smile-et3fe Год назад
what does partition by do?
@absentdata
@absentdata Год назад
It sets a window or group in which you want to do something with. In this case, we want the running sum of each sales person. So the partition is each sales person
@alexkuznetsov5958
@alexkuznetsov5958 Месяц назад
Very poor video
@absentdata
@absentdata Месяц назад
Thanks
@ubaid1231
@ubaid1231 26 дней назад
Why poor ?
@mitty3674
@mitty3674 День назад
@@absentdataplease continue making these videos they’re really helpful
Далее
UUID vs INT: What’s Better For Your Primary Key?
9:40
How I'd Learn Data Analytics in 2024 | 3 Month Plan
11:42
The Sad Reality of Being a Data Scientist
8:55
Просмотров 69 тыс.