In this video we solve Leetcode 601 - Human Traffic of Stadium using SQL. These types of SQL interview questions/problems are often used by FAANG (Facebook/Meta, Amazon, Apple, Netflix and Google) and similar tech companies. This tutorial/walkthrough will serve as a step-by-step solution to the problem.
To solve this, I demonstrate a step-by-step walkthrough of creating a subset of data using a Common Table Expression (CTE), specifically by using row_number and subtracting the difference of IDs and row_number to generate a field that can help us identify consecutive numbers, and then perform my computations to reach the end result.
Here is the URL to the LeetCode problem itself: leetcode.com/problems/human-traffic-of-stadium/
Please give the video a THUMBS UP if you found it helpful. Your support to the channel is appreciated.
Here is the code I wrote:
#sql #sql101 #leetcode
コメント