LeetCode 1581 Interview SQL Question with Detailed Explanation | Practice SQL

preview_player
Показать описание
Previous Video: LeetCode 1571 Warehouse Manager

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 customers who visited but didn't make any transactions and customers per month 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
Рекомендации по теме
Комментарии
Автор

WOW, thank you for the super clear explaination!

wishimaunicorn
Автор

We can do this in simple way
SELECT customer_id, count(visit_id) as count_no_trans
FROM Visits
where visit_id not in (SELECT visit_id from Transactions)
GROUP BY customer_id
order by count_no_trans Desc

GajjalaDeepthi
Автор

Good Videos. I have started my leetcode problem solving journey and your videos are well described and easy to follow. Keep up the good work

factsandlogicsonly
Автор

how r we getting customer_id 54 ? he has visited with id 5 and done 3 tranasction !!!

PIYUSH-lzzq
Автор

Hi, Can you explain the Count(v.visit_id) part please? I get everything before that, but what exactly are we counting using this expression, and are we counting from the original visit table, or the table we formed? (Like 4 30 Null Null Null )? Thanks!

erichuang
Автор

why use "Where" and not "Having" ?

kiantopgun
Автор

select customer_id, count(customer_id) as count_no_trans
from
(select customer_id
from Visits
where visit_id NOT IN (select distinct(visit_id) from Transactions))a
group by customer_id

divyanshumnit