RANK, DENSE_RANK, ROW_NUMBER SQL Analytical Functions Simplified

  Рет қаралды 109,552

Ankit Bansal

Ankit Bansal

Күн бұрын

Пікірлер: 225
@jasleenkaur-cw2fw
@jasleenkaur-cw2fw Жыл бұрын
Clear explanation 💯 For those asking for dataset: create table employee( emp_id int, emp_name varchar(20), dept_id int, salary int ); insert into employee values(1,'Ankit',100,10000); insert into employee values(2,'Mohit',100,15000); insert into employee values(3,'Vikas',100,10000); insert into employee values(4,'Rohit',100,5000); insert into employee values(5,'Mudit',200,12000); insert into employee values(6,'Agam',200,12000); insert into employee values(7,'Sanjay',200,9000); insert into employee values(8,'Ashish',200,5000);
@shoaibraza5532
@shoaibraza5532 9 ай бұрын
Thanks
@mohammadsaad7412
@mohammadsaad7412 4 ай бұрын
u can insert using single insert query create table employee( emp_id int, emp_name varchar(20), dept_id int, salary int ); INSERT INTO employee (emp_id, emp_name, dept_id, salary) VALUES (1, 'Ankit', 100, 10000), (2, 'Mohit', 100, 15000), (3, 'Vikas', 100, 10000), (4, 'Rohit', 100, 5000), (5, 'Mudit', 200, 12000), (6, 'Agam', 200, 12000), (7, 'Sanjay', 200, 9000), (8, 'Ashish', 200, 5000);
@sandeepreddykaduduri799
@sandeepreddykaduduri799 Жыл бұрын
This Explanation Blew my mind..!! From Scaring.. To Caring..on SQL. its just because of u Guruji🙏🙏
@nagasp882
@nagasp882 2 жыл бұрын
Very good explanation, short and concise. It's the only video i would want to watch before my interview for quick revision.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Glad you liked it 😊
@niki2098
@niki2098 Жыл бұрын
Very good explanation and easier to understand. Earlier I'm unable to understand difference between these 3 functions now I'm clear. Thank you so much for this video.
@gauravpanchariya
@gauravpanchariya Ай бұрын
Very aptly explained. I was asked this window sql question in Gainwell interview. I couldn't answer as I were not aware of it. I searched for these functions and saw your video. It is very easily explained and very precise to the core.
@sanchitavichale6737
@sanchitavichale6737 Жыл бұрын
I didn't understand analytical function until I see this video. Thank you for explain in simple word to understand. 👍
@ankitbansal6
@ankitbansal6 Жыл бұрын
You are most welcome
@srikantjena4532
@srikantjena4532 2 жыл бұрын
Absolutely good to watch with simpler explanations :-)
@tirthshah8293
@tirthshah8293 5 ай бұрын
Explained to the point. Cleared the doubt related to the difference between these all the functions.
@Maharanasunil01
@Maharanasunil01 2 жыл бұрын
I was looking for videos on Advance SQL but was still struggling with understanding the concepts. I really liked the explanation. It's time to practice a few questions ;) Thank you, can't wait for the next video :)
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Glad it was helpful!
@nirmalbisht9710
@nirmalbisht9710 2 жыл бұрын
Enjoy very topic you taught sir .. You have amazing teaching skill even these hard topic you cover very easily thank U
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you 😊
@BabyMeraLearn
@BabyMeraLearn Жыл бұрын
Very nicely explained and in easy to understand. Great job!
@ankitbansal6
@ankitbansal6 Жыл бұрын
Glad you enjoyed it!
@pondarajagadeesh4987
@pondarajagadeesh4987 Жыл бұрын
Very good explanation, short and concise
@ankitbansal6
@ankitbansal6 Жыл бұрын
Glad it was helpful!
@bhaveshrathod9898
@bhaveshrathod9898 Жыл бұрын
Really very good explanation sir! Thank you very much:)
@ankitbansal6
@ankitbansal6 Жыл бұрын
Most welcome!
@shubhipayal4073
@shubhipayal4073 Жыл бұрын
Thankyou .After lots of watching videos finally my concept is cleared here.
@ankitbansal6
@ankitbansal6 Жыл бұрын
Glad to hear that😊
@nainarahangdale1261
@nainarahangdale1261 Жыл бұрын
That's the simplest and most understandable explanation :) Thank You !!
@ankitbansal6
@ankitbansal6 Жыл бұрын
Glad you liked it!
@aakrititimilsina7662
@aakrititimilsina7662 11 ай бұрын
Very nicely explained!
@ankitbansal6
@ankitbansal6 11 ай бұрын
Glad you liked it
@sapnanimbalkar1210
@sapnanimbalkar1210 Жыл бұрын
Enhancing clarity leads to an interest in learning. Thank you Ankit.. !
@haripriyaramakrishnan6316
@haripriyaramakrishnan6316 Жыл бұрын
All are amazing videos.Very clear experience. It is very useful to refresh the SQL before interview.I am working as AVP in citicorp.Thank you very much Recently I used ur amazing videos to clear interview. Thank you very much.
@anishdeshpande395
@anishdeshpande395 Жыл бұрын
Understood teh concept in a very simple way. Thank you :)
@dataworksstudio
@dataworksstudio 2 жыл бұрын
An absolute no-nonsense guide to window functions! Thanks bhaiyya ❤️
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thanks Amar for watching 🙂
@arunabhaghoshal2381
@arunabhaghoshal2381 2 жыл бұрын
Thanks very much for the clarity and in detailed explanation of the concepts !
@mohitupadhayay1439
@mohitupadhayay1439 2 жыл бұрын
This is by far the best approach to teaching the windows function. SUBBED right away!
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you 😊
@Palak_ki_jhalak1
@Palak_ki_jhalak1 2 жыл бұрын
Thank you so much for all your videos and explaining in simpler language.All videos are very helpful 😊
@skillup638
@skillup638 2 жыл бұрын
💎 videos glad I founded it on KZbin
@akshaychoudhary5770
@akshaychoudhary5770 2 жыл бұрын
neet work. nicely explianed. expecting more such videos. LIKED COMMMENTED & SUBSCRIBED.
@MrAsgar123
@MrAsgar123 Жыл бұрын
Thank you so much for your hard work. It's really very useful to understand the Analytical Functions.
@ankitbansal6
@ankitbansal6 Жыл бұрын
Most welcome!
@RiffswithMohit
@RiffswithMohit 2 жыл бұрын
bhai thanks bht sahi and ez way me samjhaya apne
@ssaaurabh456
@ssaaurabh456 Жыл бұрын
hatoff to big brother love from noida ................you cleared concept like piece of cake
@ankitbansal6
@ankitbansal6 Жыл бұрын
Awesome
@hammadahmed1659
@hammadahmed1659 2 жыл бұрын
Thanks Sir, very nicely explained..
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Most welcome
@karangoyal3747
@karangoyal3747 2 жыл бұрын
Thanks. please continue the good work.
@sajidulahmed3354
@sajidulahmed3354 11 ай бұрын
It's simple and easily understandable. I haven't even understood earlier from the top KZbinrs. Thanks for your efforts. Keep it up!
@ankitbansal6
@ankitbansal6 11 ай бұрын
Thanks a ton
@sakshitangri7600
@sakshitangri7600 2 жыл бұрын
Simply amazing. Thank you so much
@ujjwalkumari5690
@ujjwalkumari5690 2 жыл бұрын
Great explained! looking forward for more videos
@SHUBHADIP1
@SHUBHADIP1 Жыл бұрын
Thank you Ankit ! it was a very simple and clear explanation.
@ankitbansal6
@ankitbansal6 Жыл бұрын
Glad you liked it
@meghagupta8664
@meghagupta8664 Жыл бұрын
It's very helpful Sir thank you please make more this types of vedio 😊
@ankitbansal6
@ankitbansal6 Жыл бұрын
Keep watching
@abhisheknigam3768
@abhisheknigam3768 2 ай бұрын
Amazing explanation.
@AttitudeAdjestment
@AttitudeAdjestment 3 ай бұрын
Nice video!
@naveenkumarp9874
@naveenkumarp9874 2 жыл бұрын
🥰my doubt is cleared Excellent Explaination about ranks thanks a lot👍
@ankitbansal6
@ankitbansal6 2 жыл бұрын
👏
@tapangshu
@tapangshu 2 жыл бұрын
Such a simple explanation to these 3 functions. Thanks Ankit :)
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Most welcome!
@rasikamahadeshwar8097
@rasikamahadeshwar8097 4 ай бұрын
Very good explanation.
@manojahlawat2881
@manojahlawat2881 8 ай бұрын
short and good explanation in this video
@kneelakanta8137
@kneelakanta8137 Жыл бұрын
Same question asked in my yesterday interview 👍👍
@nabiltahwildar7931
@nabiltahwildar7931 Жыл бұрын
Thank You Sir, Clear understood✌👌
@ankitbansal6
@ankitbansal6 Жыл бұрын
Glad to hear that
@minute_syntax
@minute_syntax 2 жыл бұрын
great video
@sureshdarla5540
@sureshdarla5540 7 ай бұрын
thanks for lecture, according to the last example , RANK( ) can't solve for the second highest salary provided by the department . am I right?
@niyatishah9020
@niyatishah9020 9 ай бұрын
I found the entire video to be well explained. There is just one thing I need to understand How did you know you had to use aliasing at 8:55?
@harshavardhanraj3028
@harshavardhanraj3028 Жыл бұрын
great explanation and the best thing here is using small dataset to simplify concepts in a short span please help me why alias was added at the last to get output i want to visualize how it works.
@ankitbansal6
@ankitbansal6 Жыл бұрын
In SQL server it is mandatory to give alias to a sub query
@arunsinghkachhwaha8286
@arunsinghkachhwaha8286 Жыл бұрын
Great Learning with you Ankit😊
@ankitbansal6
@ankitbansal6 Жыл бұрын
It's my pleasure😊
@noopurkumari6418
@noopurkumari6418 Жыл бұрын
Very nice videos. It cleared my concept around these functions. Thank you. Please let me know online where i can practise SQL queries.
@ankitbansal6
@ankitbansal6 Жыл бұрын
Thank you. You can practice on the DataLemur website.
@RoopmathiGunnaubcmba
@RoopmathiGunnaubcmba Жыл бұрын
Thank you Ankit this was very easy to understand. Can you post some more interview questions using RANK(), DENSE RANK() and ROW_number
@ankitbansal6
@ankitbansal6 Жыл бұрын
There are many in my complex SQL problems playlist
@mohit231
@mohit231 2 жыл бұрын
Great video
@sushantdalela7350
@sushantdalela7350 6 ай бұрын
Good work bro well explained
@annasagaramgurumahendrarao6285
@annasagaramgurumahendrarao6285 2 жыл бұрын
U explained very well
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you 😊
@jyothieswari2561
@jyothieswari2561 10 ай бұрын
Great explanation sir....tq
@ankitbansal6
@ankitbansal6 10 ай бұрын
Keep watching
@gopavarambavithra3025
@gopavarambavithra3025 4 ай бұрын
Nicely explanation
@ektakumari4496
@ektakumari4496 2 жыл бұрын
Hats off to your content👌👌
@aish7711
@aish7711 2 жыл бұрын
Clear explanation. waiting for next video
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you 😊
@rahulyeole6411
@rahulyeole6411 2 жыл бұрын
Nice video sir please upload more videos with interview questions
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Sure
@veereshsaliyan6007
@veereshsaliyan6007 Жыл бұрын
Thanks alot sir✨
@ankitbansal6
@ankitbansal6 Жыл бұрын
Most welcome
@adityasahu8626
@adityasahu8626 2 жыл бұрын
very good explanation 😊
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Glad you liked it
@psh57
@psh57 24 күн бұрын
THANK YOU MENAS A LOT
@arunjadad
@arunjadad 7 ай бұрын
Well explained sir
@IndianHacker-hisBest
@IndianHacker-hisBest Жыл бұрын
Very nice explanation
@ankitbansal6
@ankitbansal6 Жыл бұрын
Keep watching
@vishnujatav6329
@vishnujatav6329 Жыл бұрын
Really helpful
@ankitbansal6
@ankitbansal6 Жыл бұрын
Glad it helped👍
@ashishkumarg5
@ashishkumarg5 2 жыл бұрын
Nice explanation
@gayatrikumbhare8530
@gayatrikumbhare8530 7 ай бұрын
well explained 💯💯
@proandy4448
@proandy4448 4 ай бұрын
Please can you maintain the English language only. Your content is very helpful & i think it will not benefit the larger audience if you speak any other language. You are a great teacher!!
@ankitbansal6
@ankitbansal6 4 ай бұрын
This is the only video in Hindi on my KZbin channel
@amchourasia
@amchourasia Жыл бұрын
Thanks for the video!
@ankitbansal6
@ankitbansal6 Жыл бұрын
You're welcome!
@divyadubey6679
@divyadubey6679 Ай бұрын
Thank u so much for this video. Please share me link for query using pivot in mysql
@PraveenSingh-no09ol
@PraveenSingh-no09ol 2 жыл бұрын
Hi Ankit Bhai, if possible kindly create a video playlist on SQL how much it is required for Analytics domain.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Okay
@parteekranga3238
@parteekranga3238 2 жыл бұрын
All I want to say is, I LOVE YOU MAN
@ankitbansal6
@ankitbansal6 2 жыл бұрын
🙏
@priyatiwari234
@priyatiwari234 3 ай бұрын
clear explanation
@rohitrai4811
@rohitrai4811 Жыл бұрын
Appreciated bro 👍
@ankitbansal6
@ankitbansal6 Жыл бұрын
🤝
@suman3316
@suman3316 2 жыл бұрын
apka...pehla subcriber hoo main.....bhaiya ...please bring lots of practical videos used in real time
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Sure bro 🙂
@skrandomthings4474
@skrandomthings4474 3 ай бұрын
Informative
@yuktiagrawal8606
@yuktiagrawal8606 2 жыл бұрын
This is superb... I recently came across to your channel and it is really helpful😊 Teacher's should teach like you..
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you 😊
@sreevidyagireesh
@sreevidyagireesh Жыл бұрын
Nice explanation.. I have a doubt performance wise rank or dense rank is better
@ankitbansal6
@ankitbansal6 Жыл бұрын
Same performance
@varunl6948
@varunl6948 11 ай бұрын
Thanks for this!
@Ashis_Kumar90
@Ashis_Kumar90 Жыл бұрын
Clear and Crisp
@veerjisingh6401
@veerjisingh6401 2 жыл бұрын
Thanks for explaining in such simple language . I have one doubt regarding the interview question can that be solved by simply using GROUP BY department with max(salary)
@ankitbansal6
@ankitbansal6 2 жыл бұрын
In that case you will get just max salary for each department but not other columns in the output
@ritikasood433
@ritikasood433 Жыл бұрын
@@ankitbansal6 : Can we use this query to get the highest salary from each department and display all columns, sub-query might not be best option/optimized way, please take a look and advice. select emp_id, emp_name, department_id , salary from employee where salary in (select max(salary) from employee group by department_id )
@romideep4463
@romideep4463 2 жыл бұрын
To get highest salary..i gues you should use dense_rank. Because we need 3rd highest salary we can't fetch from this example which you have given...Am I right???
@kraminkaverma7837.
@kraminkaverma7837. 2 жыл бұрын
Yes, for getting highest salary we should use dense_rank.
@zohebakber5056
@zohebakber5056 2 жыл бұрын
nicely explained, bro
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thanks bro 😊
@AT-dn6gd
@AT-dn6gd Жыл бұрын
JUST WOW
@samthomas7686
@samthomas7686 2 жыл бұрын
Great explanation Ankit. Keep on creating similar stuff, all the best!
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you 😊
@anguraj1401
@anguraj1401 Жыл бұрын
Thanks Ankit
@devendergusain8974
@devendergusain8974 Жыл бұрын
thanks sir its good to understand easily in hindi as compare to english
@ankitbansal6
@ankitbansal6 Жыл бұрын
Keep watching
@tarunaggarwal4995
@tarunaggarwal4995 9 ай бұрын
Nice explanation sir but i have small doubts if we have 2 conditions like salary and joining date and i want look at the salary but if some employees salary equal then he will look joining date and salary both so how we can find the data can you explain 😛
@ArtistJatinRana
@ArtistJatinRana 10 ай бұрын
Thankyou sir
@roopasp1860
@roopasp1860 2 жыл бұрын
Thanks Ankit, can you please let me know how we will decide when to use rank(), dense_rank() and row_number()
@ankitbansal6
@ankitbansal6 2 жыл бұрын
It depends on business use case. There is no thumb rule as such.
@roopasp1860
@roopasp1860 2 жыл бұрын
@@ankitbansal6 thankyou
@kingsleyelijah8461
@kingsleyelijah8461 2 жыл бұрын
create table emp( emp_id int, emp_name varchar(20), department_id int, salary int ); insert into employee values(1,'Ankit',100,10000); insert into employee values(2,'Mohit',100,15000); insert into employee values(3,'Vikas',100,10000); insert into employee values(4,'Rohit',100,5000); insert into employee values(5,'Mudit',200,12000); insert into employee values(6,'Agam',200,12000); insert into employee values(7,'Sanjay',200,9000); insert into employee values(8,'Ashish',200,5000);
@dishantahuja975
@dishantahuja975 Жыл бұрын
Thanks for create statement.
@sriphani4720
@sriphani4720 Жыл бұрын
Please pin this comment so that someone who views this video can practice the same while learning. Thank you.
@shashikiran6859
@shashikiran6859 2 жыл бұрын
Great Explanation
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you 😊
@surojeetghosh8389
@surojeetghosh8389 Жыл бұрын
hello sir,i almost watch all of your videos and your videos have always given me useful insights.i'm an aspiring data analyst.i know the basic concepts of sql.i just want to know how to go on that next level where i can crack interviews with big companies.thank you
@ankitbansal6
@ankitbansal6 Жыл бұрын
Just solve my complex SQL playlist yourself
@blackjack4667
@blackjack4667 2 жыл бұрын
Thanks Bhaiya
@DataRevolution10
@DataRevolution10 2 жыл бұрын
Nice video.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you 😊
@shwethaa937
@shwethaa937 2 жыл бұрын
wanted to know if the records need to be sorted? or the partition function itself will take care of it ?
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Order by will take care of sorting
@ankush_in_sync5998
@ankush_in_sync5998 4 ай бұрын
Thank You.
@LogicQuest
@LogicQuest 2 жыл бұрын
Thanks for these..keep uploading and simplifying these concepts.. I hope to see some python,tableau content soon too.. Hope your channel reaches 100k fast..best wishes ..
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you so much 😊 I will start Tableau soon. I am thinking should I start with basic tutorials or direct scenario based questions just like SQL. Any suggestions?
@idhwanibhatt
@idhwanibhatt 2 жыл бұрын
@@ankitbansal6 No no start with direct scenario based questions / case study. We are fed with Tutorials.
@rishinagar199
@rishinagar199 Жыл бұрын
Bro ye where clause vala kesey kiya ....mujmey to error show kr raha hai ki 'rnk unknown column in where clause
@simranjeetsingh4101
@simranjeetsingh4101 Жыл бұрын
Thanku ♥️
@sandeepmohanty6088
@sandeepmohanty6088 2 жыл бұрын
Can we use row_number() in this case as row number will be unique and we can select where rownumber=1.
Lead/Lag Window Analytical functions in SQL | Advance SQL concepts
10:34
Difference between rank, dense rank and row number
19:32
Ankit Bansal
Рет қаралды 7 М.
Disrespect or Respect 💔❤️
00:27
Thiago Productions
Рет қаралды 40 МЛН
SQL Server interview question :- Explain RowNumber,Partition,Rank and DenseRank ?
10:50
.NET Interview Preparation videos
Рет қаралды 528 М.
Sql window function Hindi | Window Function in Sql Hindi
22:25
Lotusamaze
Рет қаралды 67 М.