Advanced SQL Tutorial | Lag and Lead Window Functions in SQL Server

Опубликовано: 01 Январь 2024
на канале: Value Driven Analytics
1,732
43

Advanced SQL Tutorial | Lag and Lead Window Functions in SQL Server

Partner with us as a channel member to get access to exclusive perks:    / @valuedrivenanalytics  

In this training video, we highlight the lag and lead windows functions available in SQL Server (and other SQL platforms), which allows a column to be created based on prior row and next row values. Toward the end, I show how duplicate rows can be handled with an advanced use case.

If you'd like to learn more about SQL data manipulation, you can check out our intro to SQL training here, which covers selecting data from a data table, creating new columns, joining tables together, and aggregating and grouping data:    • SQL Tutorial for Beginners | Stock Market ...  

Learn more about joins and unions in SQL here:    • Join and Union Tables in SQL and Pandas  

Learn more about subqueries and CTEs in SQL here:    • Mastering Advanced SQL Techniques | Subque...  

Learn more about the rank statement in SQL here:    • Intermediate SQL | Using Rank and Partitio...  

Learn more about the having clause in SQL here:    • Advanced SQL Tutorial | Having Clause  

Learn more about the coalesce function in SQL here:    • Coalesce Function in SQL Server: An Interm...  

Learn more about date functions in SQL Server here:    • Intermediate SQL Tutorial | Date Functions...  

______________________________________________

CHAPTERS:
0:00 What are the lag and lead functions in SQL?
1:06 How to create a schema in SQL server?
1:15 How to create a table in SQL server?
1:35 How to manually insert rows into a table in SQL Server
1:45 How to view all rows and columns in a table in SQL Server
3:25 How to create a lag variable in SQL
4:18 What is a partition by statement in SQL?
4:55 What does an order by statement do in a lag function?
6:05 Why is value null in a lag column?
7:30 How to order by multiple variables in lag function
8:35 lag function doesn’t have to have a partition by statement
9:18 How to create a lag based on order in table
9:55 How to reference %%physloc%% to get the order of the rows in a table in sql server
11:03 How to get lag more than 1 period back
11:42 How to make a lag function act as a lead function in sql
12:26 How to create a lead variable in SQL
12:43 Why is value null in lead column
13:07 How to filter on a window function in SQL
14:15 How to format a subquery in SQL
14:38 How to avoid filtering out null values in a where clause
15:34 How to use multiple SQL techniques together
16:34 How to deduplicate in SQL with distinct
17:15 What is an inner query in SQL?
18:25 How to join a subquery back to the original table in SQL
19:45 How to join on multiple fields in SQL

______________________________________________

ADDITIONAL VIDEOS YOU MAY LIKE:

Please subscribe to get updates on the latest analytics training videos available!
Whether you’re looking for training on technical skills or soft skills, whether you’re an aspiring analyst or an analytics executive, we have the perfect analytics training video for you! Check out our free training videos at https://valuedrivenanalytics.com/comp...

______________________________________________

ABOUT VALUE DRIVEN ANALYTICS:

Value Driven Analytics is your source of rigorous, affordable, and fast analytics consulting and transformation. If you need an interactive dashboard, analysis, data science model build, automated data process, analytics or leadership training, analytics team management, analytics transformation, or 1-hour analytics consultation (troubleshooting, project advice, career advice), give us a call at 1-877-VAL-DRVN (1-877-825-3786) or learn more about our services at https://valuedrivenanalytics.com/serv...

Stay connected with us!
LinkedIn:   / value-driven-analytics  
Twitter:   / vda_consulting  
Facebook:   / 61550273999898  

If you need help troubleshooting code, project advice, or personalized career advice, consider booking a 1-hour analytics consultation with me. You'll be amazed by what we can accomplish in just 1 hour! https://valuedrivenanalytics.com/hour...

If your organization would like customized and more advanced analytics training, you can read more about the Value Driven Analytics analytics & leadership trainings offered here: https://valuedrivenanalytics.com/anal...

______________________________________________

KEYWORDS:

lead, lag, functions, window functions, window functions in sql, sql, windowed functions, lead function, lag function, sql lead, sql lag, lead sql, lag sql, lag function, lead function sql, sql server examples, partition by, order by, over, sql window function, sql window functions, window functions in sql, sql analytic function, sql analytic functions, analytic function, over clause, sql partition by, sql query tutorial, sql tutorial


На этой странице сайта вы можете посмотреть видео онлайн Advanced SQL Tutorial | Lag and Lead Window Functions in SQL Server длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Value Driven Analytics 01 Январь 2024, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 1,732 раз и оно понравилось 43 зрителям. Приятного просмотра!