LeetCode Medium 2041 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
Рекомендации по теме
Комментарии
Автор

Can't we group by interview I'd?

ashishjha
Автор

The Below cod works in MySQL

with cte as
(select *, SUM(score) OVER(partition by interview_id) as total_scores from rounds)
select distinct c2.candidate_id
FROM cte c1
LEFT JOIN candidates c2
ON c1.interview_id = c2.interview_id
where c2.years_of_exp >= 2 and c1.total_scores > 15;

sivasrimakurthi
Автор

select candidate_id from candidates
where years_of_expe >=2 and
interview_id in
( select interview_id from rounds
group by interview_id
having sum(scores) > 15)

meenayegan
Автор

with cte as (
select *, sum(scores) over(partition by r.interview_id) as total_score from Candidates c join Rounds r on c.interview_id=r.interview_id where c.years_of_exp>1 )
select candidate_id from cte where total_score>15

yashnikhare
Автор

with cte as (select interview_id, sum(score) as total_score
from Rounds group by interview_id)
select candidate_id from Candidates
join cte on
where cte.total_score>15 and Candidates.years_of_exp>=2;

maheshwaroli