LAG() and LEAD() in SQL | Part 10 | Data Science Interview Questions

Veröffentlicht am: 16 Juni 2021
auf dem Kanal: The Data Monk
2,168
37

This video shows the working of lead and lag functions. LEAD function is used to fetch the subsequent row data according to the given offset value. Similarly, the LAG function is used to fetch the previous row data according to the given offset value.

SYNTAX –
LEAD(ColName, Offset Value, DefaultValue) OVER (ORDER BY ColName1,ColName2..)
LAG(ColName, Offset Value, DefaultValue) OVER (ORDER BY ColName1,ColName2….)

where, Offset Value is no. of rows to lead or lag.
Default Value is if no of rows go first or last row, null will be the default value.

For better understanding , watch the video!
Website - https://thedatamonk.com/
SQL Complete Playlist -    • SQL Data Science Interview Questions  
Case Study Complete Playlist -    • Case Studies, Guesstimates and Data Scienc...  
We at The Data Monk aims at bridging the gap between theoretical knowledge and cracking an interview in Analytics domain.
Analytics domain includes:-
-Data Analysts
-Data Scientists
-Business Analysts
-Product Analysts
-Decision Scientists and similar roles

We currently have 30+ e-books on Amazon to prepare for Data Science interviews
You can also buy our set 10 e-books which covers 1400+ solved Interview Questions from here - https://thedatamonk.com/buy-e-books/
Please check our free resources:-
30+ companies complete interview questions - https://thedatamonk.com/analytics-int...
300+ Solved Python Questions - https://thedatamonk.com/python-questi...
300+ Solved SQL Questions - https://thedatamonk.com/sql-interview...
100+ Solved Case Studies and Guesstimates - https://thedatamonk.com/case-study-fo...
100+ Solved Interview Questions in R - https://thedatamonk.com/r-interview-q...
300 + Solved Machine Learning and Statistics Questions - https://thedatamonk.com/most-asked-ma...
200+ Solved Statistics Interview Questions - https://thedatamonk.com/statistics-da...
You can create your account on https://thedatamonk.com and participate in our Daily Quizzes and weekly free e-book giveaway by creating an account and subscribing to the website -https://thedatamonk.com/the-data-monk...


Auf dieser Seite können Sie das Online-Video LAG() and LEAD() in SQL | Part 10 | Data Science Interview Questions mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer The Data Monk 16 Juni 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 2,168 Mal angesehen und es wurde von 37 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!