LeetCode Medium 2238 Interview SQL Question with Detailed Explanation

preview_player
Показать описание

In this video I solve and explain a medium difficulty 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 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
Рекомендации по теме
Комментарии
Автор

Great explanation...keep it up...more power to you👏

ankit-egbo
Автор

select driver_id,
case when driver_id in(select passenger_id from Rides)
then count(passenger_id)
else 0
end as cnt
from Rides
group by driver_id;

maheshwaroli
Автор

TIP : CHANGE SNO COLORS OF NUMBER IN THUMNAILS AS (#80) IN WHITE FOR EASY, IN GREEN FOR MEDIUM IN RED FOR HARD, VISUALLY IT WILL BE BETTER (JUST MY OPINION)

mlvprasadofficial
Автор

with t1 (select distinct driver_id from rides)
select t1.driver_id, count(r.passenger_id) as cnt from t1 join rides r on t1.driver_id = r.passenger_id
group by driver_id

sanskarsuman
Автор

Bro, please make a python interview problem while explaining logic.

AbdulRahman-zpbp
Автор

Hey,
can you please tell the mistake I am committing here :

select driver_id, sum(if(driver_id in (select distinct passenger_id from rides), 1, 0)) as cnt
from rides
group by driver_id

abhinavmishra
join shbcf.ru