No video

Lead/Lag Window Analytical functions in SQL | Advance SQL concepts

  Рет қаралды 44,639

Ankit Bansal

Ankit Bansal

Күн бұрын

In this video we will learn lead/lag analytical functions. these functions are used when you need to compare current row with another previous or next row. Very important for interview preparation as well.

Пікірлер: 64
@rks.siddhartha
@rks.siddhartha 2 жыл бұрын
I always get confused with the combination of lead/lag and order by in the over clause which lead to couple of tries to get the desired output, faced similar confusion today and searched your channel for the these functions. Thank you for covering exactly what I was looking for!!
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Glad it helped you 😊
@ShriJi-Rasoi
@ShriJi-Rasoi Жыл бұрын
That's the best explanation I found on lead and lag, thanks bro
@ankitbansal6
@ankitbansal6 Жыл бұрын
Glad it helped
@ianpropst-campbell6028
@ianpropst-campbell6028 2 жыл бұрын
This was a helpful demonstration of the lead and lag functions. Thank you!
@jannatbhengray1650
@jannatbhengray1650 27 күн бұрын
Thank you so much, it made my topic crystal clear :-)
@adityeshchaturvedi6553
@adityeshchaturvedi6553 2 жыл бұрын
Short crisp and really informative!
@learnwithAashish
@learnwithAashish 2 жыл бұрын
Thanks for your valuable knowledge Sharing. Although I learned SQL but everytime I came here , always feel I know nothing. Keep Good work going 👍 & also if possible please start sharing your knowledge on Python it will be very helpful. Thanks
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Sure
@lokeshsharma9386
@lokeshsharma9386 Жыл бұрын
Thank you, I have got a job with 50% , I have learnt virtually from your videos, my concept got clear . Thank you so much
@ankitbansal6
@ankitbansal6 Жыл бұрын
👌
@shubhammeshram8504
@shubhammeshram8504 5 ай бұрын
Great. Very informative 😀.
@amitkushwah8401
@amitkushwah8401 11 ай бұрын
Really Good. Explained in the simplest way.
@sharans5771
@sharans5771 2 ай бұрын
Excellent explanation, especially with real time scenario example
@ankitbansal6
@ankitbansal6 2 ай бұрын
Glad it was helpful!
@dfkgjdflkg
@dfkgjdflkg 6 ай бұрын
As usual, great content. Excellent work. thank you
@minlin9705
@minlin9705 2 жыл бұрын
It is well explained. The example is aweomse. Thank you, Ankit!!
@ankitbansal6
@ankitbansal6 2 жыл бұрын
🙏
@DishantGupta-t
@DishantGupta-t 3 ай бұрын
Helpful 👍
@ankitbansal6
@ankitbansal6 3 ай бұрын
Glad it helped
@sivasuthan004
@sivasuthan004 2 жыл бұрын
Crisp and clear explanation!
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you 😊
@gyan_chakra
@gyan_chakra 2 жыл бұрын
Awesome 😎👍.. such a lovely & simple explanation 😊
@mehmetkaya4330
@mehmetkaya4330 Жыл бұрын
Thank you for the great examples!
@ankitbansal6
@ankitbansal6 Жыл бұрын
Glad you like them!
@vikasvk9174
@vikasvk9174 2 жыл бұрын
very informative video ... Thank you
@pavitrashailaja850
@pavitrashailaja850 2 жыл бұрын
Very neatly explained!
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Glad you liked it
@mdfurqan
@mdfurqan Жыл бұрын
Hi Ankit, I am using history table where create_dt is the indicator for comparison between 2 rows, I have used this lag logic to generate scd2 on my history table. Thanks
@apexemperor
@apexemperor Жыл бұрын
Hi... I am also probably looking for the same thing . I have a table which has Scd2 records and the last active records ends with high end dt something like 2200-01-01 Do u think this logic will work with some twigs ofcourse?
@mdfurqan
@mdfurqan Жыл бұрын
@@apexemperor yes have implemented and working fine
@ankush_in_sync5998
@ankush_in_sync5998 Ай бұрын
Love you sir, love you
@shankrukulkarni3234
@shankrukulkarni3234 Жыл бұрын
It really good if you can provide the dataset link so that we can practice simultaniously
@dfkgjdflkg
@dfkgjdflkg 6 ай бұрын
Look online, lots of datasets
@vikastyagi7811
@vikastyagi7811 Жыл бұрын
Crisp and clear
@anirudhupadhyay695
@anirudhupadhyay695 2 жыл бұрын
Congratulations and thanks.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you 😊
@god_father007i
@god_father007i 5 ай бұрын
Thanks men it helps
@sreedharagandla
@sreedharagandla 2 күн бұрын
Hi ankit , Can u let me know super data where it is or can share the link pls so that we can prasctise . Thanks
@gazart8557
@gazart8557 Жыл бұрын
Excellent
@ankitbansal6
@ankitbansal6 Жыл бұрын
Thank you! Cheers!
@pavankumarchahar
@pavankumarchahar Жыл бұрын
Suppose we have the YEAR, Revenue column but the year is 2012, 2015, 2016, 2017, and 2019 then this case how to calculate the missing default year 0 and subsequent.
@PhysicsCoachAnkitSaraswat
@PhysicsCoachAnkitSaraswat Жыл бұрын
do bring some more example question related to sql topics and provide data shert for practvie sir
@ankitbansal6
@ankitbansal6 Жыл бұрын
Sure
@anamikachaudhary6814
@anamikachaudhary6814 Жыл бұрын
Order_date column is in text format , maybe that is why it is giving me null select month(order_date) from superstore data table. Can you please suggest why is this happening. it pull null values for me. I am using MySQL workbench and when I use select EXTRACT(MONTH FROM Order_Date) as month from superstore_orders; it pulls null values for all the columns . Can someone help please.
@rashisingh8225
@rashisingh8225 2 жыл бұрын
Please provide the create and insert query so that we can practice
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Rashi scripts are there in most the videos description box. Will fix if anyone is missing
@rashisingh8225
@rashisingh8225 2 жыл бұрын
@@ankitbansal6 can you let me know in which video you have imported the data or share the link I cant find it
@ankitbansal6
@ankitbansal6 2 жыл бұрын
@@rashisingh8225 You can check in description box only for individual videos
@shifanasheriff
@shifanasheriff Жыл бұрын
Hi Ankit , What change should do in the query If I want to see the sales of same period last year till the date (YTD previous year)? Can you help ?
@pavan5208
@pavan5208 Жыл бұрын
Create a YTD Flag first and use that as a filter?
@themightyvk
@themightyvk Жыл бұрын
Thanks buddy...
@ankitbansal6
@ankitbansal6 Жыл бұрын
Always welcome
@prasadchowdary4870
@prasadchowdary4870 9 ай бұрын
Where we can download the superstore data
@riyalmasla
@riyalmasla 8 ай бұрын
thank you
@ankitbansal6
@ankitbansal6 8 ай бұрын
You're welcome
@ritikajaiswal3824
@ritikajaiswal3824 2 жыл бұрын
Can you make a video on the code which is different in different database like oracle, mysql workbench, postgresql, ms server?
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Sure
@harshupreti1526
@harshupreti1526 Жыл бұрын
Why use sql when we have powerful tools like powerbi , tableau ? I am very curious and no way mean to disrespect . Please answer
@aayushibirla2590
@aayushibirla2590 Жыл бұрын
SQL is used for storing and retreiving data from database. Power BI and tablaeu are the data visualization tools. Here we just load data and make visualizations from it.
@afonsoosorio2099
@afonsoosorio2099 Жыл бұрын
@Harsh, that is a valid and legitimate question. I had the very some concern but after doing some training in SQL, now I understand that it is a must skill to command in data analytics. You are absolutely right there are powerful data analysis tools such as power query, power BI, Python and R. We need SQL because is where we will often get plain raw data stored in multiple related tables (RDBMS). So we have to query and retrieve the subset or dataset we are interested in for detailed analysis using those powerful data analysis tools. Hardly you will get stored in spreadsheet and tabular format like Excel, or CSV and ready for analysis. In a nutshell, we need SQL for extracting datasets from database and then transform and get loaded in a powerful data analysis tool.
@jasleenkaur-cw2fw
@jasleenkaur-cw2fw Жыл бұрын
can you please provide the dataset?
@apexemperor
@apexemperor Жыл бұрын
Hi... I am also probably looking for the same thing . I have a table which has Scd2 records and the last active records ends with high end dt something like 2200-01-01 Do u think this logic will work with some twigs ofcourse? Came across your channel yesterday and there are lot of things to learn ❤
@ankitbansal6
@ankitbansal6 Жыл бұрын
What exactly do you want to achieve from your scd2 table ?
ROLLING DOWN
00:20
Natan por Aí
Рет қаралды 11 МЛН
PEDRO PEDRO INSIDEOUT
00:10
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 17 МЛН
Пройди игру и получи 5 чупа-чупсов (2024)
00:49
Екатерина Ковалева
Рет қаралды 4,2 МЛН
RANK, DENSE_RANK, ROW_NUMBER SQL Analytical Functions Simplified
9:42
LEAD & LAG in SQL | Analytical Functions Advanced SQL | Ashutosh Kumar
40:35
Working with SQL NULL values | Null Handling Functions
11:18
Ankit Bansal
Рет қаралды 21 М.
How to Crack Data Engineering Interviews
20:41
Ankit Bansal
Рет қаралды 11 М.
Database Indexing for Dumb Developers
15:59
Laith Academy
Рет қаралды 53 М.