If you want to see more videos like this, Subscribe for more data tutorials like this :) bit.ly/3GiCVUE ⏱ TIMESTAMPS ⏱ --------------------------------- 00:00 Intro 00:00:28 What are Window Ranking Functions? 00:05:48 ROW_NUMBER 00:10:13 RANK 00:14:18 DENSE_RANK 00:18:42 ROW_NUMBER vs RANK vs DENSE_RANK 00:19:45 ROW_NUMBER: TOP-N Analysis 00:23:24 ROW_NUMBER: Bottom-N Analysis 00:27:00 ROW_NUMBER: Assign Unique IDs 00:29:47 ROW_NUMBER: Identify Duplicates 00:35:21 NTILE 00:41:41 NTILE: Data Segmentation 00:45:35 NTILE: Equalizing Loads 00:49:02 Intro Percentage Based Ranking 00:50:10 CUME_DIST 00:53:52 PERCENT_RANK 01:01:40 Summary Enjoy ☕
Hi Baraa, I've been struggling to master SQL despite spending hours trying to grasp even the simplest concepts. But then I found your videos, and you've been an incredible teacher. In just two days of watching your content, I’ve started to genuinely enjoy learning SQL. Thanks to you, I now understand complex window functions so much better. Thank you for everything you’re doing to help people like me. Wishing you all the best!
The best channel for studying SQL & Tableau ,such a high quality videos and it's easy to understand your teaching .You made learning SQL more interesting thank you!!!
Your video is the best learning material for SQL and Tableau. I am also Bought your courses in Udemy. The Highest quality, the lowest price!!! Thank you!!!
Amazing content Baraa sir. Covered Rank Window function fully. I'm fully confident in Rank function now. Initially it looks overwhelming to me, but now it looks very easy to me after following your video and practicing along with you. Thank you very much sir. Kindly keep enlightening us with your immense knowledge. 😍😍😍
I'm new to this channel and started checking the SQL. After going through many content on RUclips this was the best for me to make all the difficulties in understanding disappear. Thank you. Please continue doing the Great Work. Please create some content on PowerBI as well as this visualization tool is most common for many companies.
Great content, Baraa! I totally wasn't expecting such a detailed explanation with all these amazing visuals throughout. Thank you for the content you provide and the effort you put in. You're an amazing teacher! P.S. I love the way you say 'analysis'.
Hi Barar, continuously watching your videos and learning ,good explanation, the way your explaining and showing slides, style of explanation is very good
Hi Baraa, Thank you for the content you provide and the effort you put in. You doing great work with amazing visuals, I loved your explaination way that you start with the concept behind the function then give an example in order to illustrate it, and lastly apply it in a use case. "100% analytical mindset" 👏 Please,Keep It Up with tutorials 🙏
This is definitely the clearest explanation of any tutorial I've ever seen, and I fell in love with this way of thinking analytically, thank you so much for the tutorial. By the way, what software do you use to do these visual explanations, and I also want to learn this way to understand complex problems in depth.
BARA UR THE BESSSSTTTTTTTTTTT GONNA SHARE UR CHANNEL, MY HUMBLE REQUEST IS PLEASE BRING PROJECTS FOR DATA SCIENCE RELATED TO SQL AND PYTHON PLEASE UR AMAZING NO ONE IS BETTER THAN U
Hi Baraa, You have made learning so easy and fun. Thank you so much for all the guidance. Can you please make videos on query optimization, tuning, indexation as well please.
I really feel blessed that you made this all video. It's really interesting and easy to understand. when the 1st time i watched your video, i am immediately subscribe!! Great Job Baraa!! Thank you
Hello Braa, thank you for your tutorials-they’re clear and amazing! Keep up the great work. I wanted to ask about the software you use to create the explanatory drawings.
Hi Baraa, I wanted to ask something, if I use three RANK function in a query but partition those by three different expressions, the result is a bit confusing? What is the order of execution and how does it work? Example: SELECT OrderID, OrderDate, ProductID, Sales, RANK() OVER(PARTITION BY ProductID ORDER BY SALES DESC) AS RankSales, RANK() OVER(PARTITION BY OrderID ORDER BY SALES DESC) AS RankSales, DENSE_RANK() OVER(PARTITION BY ProductID ORDER BY SALES DESC) AS DenseRankSales FROM Sales.Orders And Thanks for being the best teacher ever
Thanks for kind words and great question !! Here's an explanation: The key here is to understand that each RANK function operates independently! Based on your query the data will be partitioned three times and sorted three times. For example: RANK() OVER(PARTITION BY ProductID ORDER BY SALES DESC) ranks sales within each product. RANK() OVER(PARTITION BY OrderID ORDER BY SALES DESC) ranks sales within each order. DENSE_RANK() OVER(PARTITION BY ProductID ORDER BY SALES DESC) gives a dense rank within each product. So each one of them will be executed independently. I hope this helps.
Thank you so much Baraa! Your videos are so helpful. I appreciate the effort you put into them. Can you please do a video on handling different Date types in SQL?
Thank you sir for your sharing knowledge ❤. Sir can you share the dataset for every table and table creation script. It is helpful for practice everything. Thank you sir
Hi Baraa , ThankYOu for the amazing content. Baraa I am not able to download the resources you have provided to us(Sql Files and Presentations), whenever i click to download it opens microsoft learn page.Can you guide me with this, Thank you
hi baraa currently I am following advanced sql videos from past few days I really liked it and i also bought your tableau course nearly 25 htrs in udemy. But cant dowload this presentations because when i click that presentaion link it is directing into microsoft sql page
I am using postgreesql on mac. I understand I can not use Microsoft SQL Server Management Studio. can you share the data base so i can subscribe to take the advanced sql
please give me the data set that you have used in this tutorial. please give me.I am from Bangladesh.I like your tutorial so much.I want to practice with you that's why I need that.
ITALY and SQL both are beautiful only by Baraa sir. From sales.orders) t where rank byproduct=1 Above query after bracket the letter t comes. What it mean Thank you sir
Italy is very lovely and amazing culture. The letter t that comes after the closing bracket in your query is an alias for the subquery. In SQL, you can assign an alias to a table or a subquery to simplify references to it in the rest of your query. In SQL Server it is required to give an Alias after each subquery.
please give me the data set that you have used in this tutorial. please give me.I am from Bangladesh.I like your tutorial so much.I want to practice with you that's why I need that.
please give me the data set that you have used in this tutorial. please give me.I am from Bangladesh.I like your tutorial so much.I want to practice with you that's why I need that.
If you want to see more videos like this, Subscribe for more data tutorials like this :) bit.ly/3GiCVUE
⏱ TIMESTAMPS ⏱
---------------------------------
00:00 Intro
00:00:28 What are Window Ranking Functions?
00:05:48 ROW_NUMBER
00:10:13 RANK
00:14:18 DENSE_RANK
00:18:42 ROW_NUMBER vs RANK vs DENSE_RANK
00:19:45 ROW_NUMBER: TOP-N Analysis
00:23:24 ROW_NUMBER: Bottom-N Analysis
00:27:00 ROW_NUMBER: Assign Unique IDs
00:29:47 ROW_NUMBER: Identify Duplicates
00:35:21 NTILE
00:41:41 NTILE: Data Segmentation
00:45:35 NTILE: Equalizing Loads
00:49:02 Intro Percentage Based Ranking
00:50:10 CUME_DIST
00:53:52 PERCENT_RANK
01:01:40 Summary
Enjoy ☕
Hi Baraa, I've been struggling to master SQL despite spending hours trying to grasp even the simplest concepts. But then I found your videos, and you've been an incredible teacher. In just two days of watching your content, I’ve started to genuinely enjoy learning SQL. Thanks to you, I now understand complex window functions so much better.
Thank you for everything you’re doing to help people like me. Wishing you all the best!
I wonder why something like this doesn't have at least hundreds of thousands of views. Thanks for you efforts
With your people like you supporting, maybe my content will reach the others ❤️
Hi Baraa, Hope you are doing well! Baraa you might don't know how much you are helping people like me.Thanks a million
I think I am addicted to your videos. Cant stop learning them. Thank you million.
Greatest tutorial on ranking functions across entire internet ever.
The best channel for studying SQL & Tableau ,such a high quality videos and it's easy to understand your teaching .You made learning SQL more interesting thank you!!!
bro literally added a smoke effect on the surface of his coffee..
thanks for the best tutorials on youtube man
Most underrated SQL advance topic playlist
Hi Baraa, you don't realize how amazing your work is! Please, keep it up with the tutorials!! Thanks :)
And you don't realize how awesome you are, when you take time a writing me this nice comment 🙂
Your video is the best learning material for SQL and Tableau. I am also Bought your courses in Udemy. The Highest quality, the lowest price!!! Thank you!!!
Thank you so much... You are the best...
After so much complexity of Learning SQL, You made it easy to learn..
May Allah bless you..
Fee amanillah
Amazing content Baraa sir.
Covered Rank Window function fully.
I'm fully confident in Rank function now.
Initially it looks overwhelming to me, but now it looks very easy to me after following your video and practicing along with you.
Thank you very much sir.
Kindly keep enlightening us with your immense knowledge.
😍😍😍
I'm new to this channel and started checking the SQL. After going through many content on RUclips this was the best for me to make all the difficulties in understanding disappear. Thank you. Please continue doing the Great Work. Please create some content on PowerBI as well as this visualization tool is most common for many companies.
This channel is criminally underated
@baraa.. excellent teaching.. i love it.. even paid person can't teach this way... i have learned a lot...appreciate your support brother..
Hi Baraa, I don’t usually subscribe, but you’ve convinced me-guess I’m officially part of the fan club now!
Great content, Baraa! I totally wasn't expecting such a detailed explanation with all these amazing visuals throughout. Thank you for the content you provide and the effort you put in. You're an amazing teacher! P.S. I love the way you say 'analysis'.
Thank you Baraa! very Informative and I was able to crack my SQL interview because of your SQL videos..
Excellent! Great job 👏
Thank you dear Baraa for the great explanation and useful content!
I like the comparison and explanation to make it easier to understand. Thanks!
Thank you so much sir g
I'm starting to get the hang of SQL from you're tutorial lecture Simply Brilliant ❤❤❤
Great to hear!
I didn’t seen any videos on sql with immense detailed explanations.
Hey Baraa, I Wish I'd discovered your channel sooner. Awesome way of explaining concepts. Thanks!!
Bara, thank you for your dedication to providing free knowledge. I am fortunate to be able to know you virtually
As always I have no word to thank you. God bless u wherever u r.
Hi Barar,
continuously watching your videos and learning ,good explanation,
the way your explaining and showing slides, style of explanation is very good
your teaching style is mind blowing
Thanks dear ✌️
Hi Baraa,
Thank you for the content you provide and the effort you put in.
You doing great work with amazing visuals, I loved your explaination way that you start with the concept behind the function then give an example in order to illustrate it, and lastly apply it in a use case. "100% analytical mindset" 👏
Please,Keep It Up with tutorials 🙏
Master Class
Best teacher ever...🎉
wow amazing baraa keep doing you r really amazing
hey sir i have seen so many video but the way you explain is very good and your way of presenting the each topic is very good thanks
@@mrmew4547 thanks I really appreciate it
This is definitely the clearest explanation of any tutorial I've ever seen, and I fell in love with this way of thinking analytically, thank you so much for the tutorial.
By the way, what software do you use to do these visual explanations, and I also want to learn this way to understand complex problems in depth.
Hi thanks for the kind words, glad you liked it. I am using drawio and procreate
BARA UR THE BESSSSTTTTTTTTTTT GONNA SHARE UR CHANNEL,
MY HUMBLE REQUEST IS PLEASE BRING PROJECTS FOR DATA SCIENCE RELATED TO SQL AND PYTHON PLEASE UR AMAZING NO ONE IS BETTER THAN U
Thanks and I'll do :)
Thank you Baraa I have completed this tutorial today.
Great job!
I am excited even before going through the video ….i am sure I m going to enjoy this … Thanqqqqqq
Outstanding! 👏🏻👏🏻👏🏻
Thank you so much!
Thanks for providing such amazing information❤
Thank you so much, was waiting for this video eagerly!!!
You are welcome, i hope you will enjoy it !
Thanks for introducing advance concept Cume_dist(). It is gonna help me in my office work.
Nice, it’s useful function!
That constant smoke from coffee mug
Awesome,, pls keep making more extraordinary videos
Best lecture from the best teacher I can't thank you enough for all the good you are doing. God bless you brother
Hi Baraa,
You have made learning so easy and fun. Thank you so much for all the guidance.
Can you please make videos on query optimization, tuning, indexation as well please.
Noted. Glad you like my videos!
Keep doing it bro your explanation makes more sense I bet you.
Thanks
I really feel blessed that you made this all video. It's really interesting and easy to understand. when the 1st time i watched your video, i am immediately subscribe!! Great Job Baraa!! Thank you
I am aswell blessed to be able to reach kind people like you, thanks for the support and glad you liked it
Hello Braa, thank you for your tutorials-they’re clear and amazing! Keep up the great work. I wanted to ask about the software you use to create the explanatory drawings.
Was waiting for this eagerly!❤
Thanks Baraa as always!
Thanks very much Baraa
Thanx brother for cmprehensive video
Always welcome
thanks alot😁
Thank you
You're welcome
amazing
Hi Baraa, I wanted to ask something, if I use three RANK function in a query but partition those by three different expressions, the result is a bit confusing? What is the order of execution and how does it work? Example:
SELECT
OrderID,
OrderDate,
ProductID,
Sales,
RANK() OVER(PARTITION BY ProductID ORDER BY SALES DESC) AS RankSales,
RANK() OVER(PARTITION BY OrderID ORDER BY SALES DESC) AS RankSales,
DENSE_RANK() OVER(PARTITION BY ProductID ORDER BY SALES DESC) AS DenseRankSales
FROM Sales.Orders
And Thanks for being the best teacher ever
Thanks for kind words and great question !!
Here's an explanation:
The key here is to understand that each RANK function operates independently! Based on your query the data will be partitioned three times and sorted three times.
For example:
RANK() OVER(PARTITION BY ProductID ORDER BY SALES DESC) ranks sales within each product.
RANK() OVER(PARTITION BY OrderID ORDER BY SALES DESC) ranks sales within each order.
DENSE_RANK() OVER(PARTITION BY ProductID ORDER BY SALES DESC) gives a dense rank within each product.
So each one of them will be executed independently. I hope this helps.
@@DataWithBaraa Thanks a lot ! Now it's clear.
Amazing explanations with the visualization 🐐.
Btw is that Nescafe your super hot coffee ☕ or air purifier🍀
😂😂 my Coffee is CGI
Thank you so much Baraa! Your videos are so helpful. I appreciate the effort you put into them. Can you please do a video on handling different Date types in SQL?
Thank for the kind words, yes I’ll cover it in my course!
Thanks
Thank you sir for your sharing knowledge ❤.
Sir can you share the dataset for every table and table creation script. It is helpful for practice everything. Thank you sir
Hi Thanks ! All data are to be downloaded from link in description.
Hi Baraa , ThankYOu for the amazing content. Baraa I am not able to download the resources you have provided to us(Sql Files and Presentations), whenever i click to download it opens microsoft learn page.Can you guide me with this, Thank you
hi baraa currently I am following advanced sql videos from past few days I really liked it and i also bought your tableau course nearly 25 htrs in udemy. But cant dowload this presentations because when i click that presentaion link it is directing into microsoft sql page
I am using postgreesql on mac. I understand I can not use Microsoft SQL Server Management Studio. can you share the data base so i can subscribe to take the advanced sql
Thanks alot
Hi Baraa, hope all is well. Question: do you know MySQL and if you do, can you please do a tutorial on it?
After identifying duplicates how can we delete those duplicate records from our table?
time to sit and learn
@@OPTIMUSPRIME-q8x good luck hope you enjoy it and don’t forget your coffee:)
brother where to find SalesDB.bak ..could you please share link .. i am trying install SQLServer.
please give me the data set that you have used in this tutorial. please give me.I am from Bangladesh.I like your tutorial so much.I want to practice with you that's why I need that.
Whether all of this work same in MySQL server
Dear baraa, i think you made a mistake, the row_number should have a shared rank, and dense_rank sould have a Unique number,
what is the letter t after the query
I think it's like an Alias
and I want your next tutorial will be is python
ITALY and SQL both are beautiful only by Baraa sir.
From sales.orders) t where rank byproduct=1
Above query after bracket the letter t comes. What it mean
Thank you sir
Italy is very lovely and amazing culture.
The letter t that comes after the closing bracket in your query is an alias for the subquery. In SQL, you can assign an alias to a table or a subquery to simplify references to it in the rest of your query. In SQL Server it is required to give an Alias after each subquery.
@@DataWithBaraa thank you sir
please give me the data set that you have used in this tutorial. please give me.I am from Bangladesh.I like your tutorial so much.I want to practice with you that's why I need that.
please give me the data set that you have used in this tutorial. please give me.I am from Bangladesh.I like your tutorial so much.I want to practice with you that's why I need that.