LeetCode 1821 Interview SQL Question with Detailed Explanation | Practice SQL

preview_player
Показать описание
Previous Video: LeetCode 1757 Low Fat and Recyclable Products

In this video I solve and explain a leetcode SQL question using MySQL query. This question has been asked in Apple, Facebook, Amazon, Google, Adobe, Microsoft, Adobe interviews or what we popularly call FAANG interviews.
I explain the related concept as well. This question is about finding customers with positive revenue and also includes points to keep in mind to develop SQL queries.

LeetCode is the best platform to help you enhance your skills, expand your knowledge and prepare for technical interviews.

If you found this helpful, Like and Subscribe to the channel for more content.

#LeetCodeSQL #FAANG #SQLinterviewQuestions
Рекомендации по теме
Комментарии
Автор

u made us easy to solve sql query bro thanks a lot

dornalanavya
Автор

WHERE clause is a conditional statement s used before GROUP BY and HAVING is used after GROUP BY and also I think HAVING is used only with aggregate function. This question asked to me in one data analyst interview recently.

abhimanyutiwari
Автор

Hello ! Thank you for all the videos you make about SQL and especially regarding the questions from LeetCode.
Many Thanks!
I have a big request please-i don t have a LeetCode subscription and i have left to solve only 2 question regarding SQL-2153-The number of passengers in each bus || and the last question 2175-The Change in Global Rankings
Please can you help me only with the data from this 2 question and the requests-i don t need the solution.
I can not find on internet the data from this 2 question.
I will let here my solution-maybe is useful for someone at the question2142-The number of passengers in each bus | -
with bus as (
select bus_id, arrival_time,
row_number()over(order by arrival_time) as tip
from buses
)
select b.bus_id, count(p.pasager_id) as how_many
from bus b left join passengers p on p.arrival_id between b.tip and b.arrival_time
group by b.bus_id
order by 1
All the best!

florincopaci