Solving the most complex SQL Problem on LeetCode | SQL Interview Question and Answer

preview_player
Показать описание
In this video, we will solve the most complex SQL problem on LeetCode.
The problem is the LeetCode 1917. Leetcodify Friends Recommendation problem.
The problem is mentioned as HARD in LeetCode but after you see my solution, you may wonder if this was a MEDIUM problem (I definitely think so).

LeetCode problem link:

Download the scripts and dataset from below:

Thanks for watching!
Рекомендации по теме
Комментарии
Автор

Please do more leet code problems bro it helps us to understand complex problems

maradanaajaykumar
Автор

instead of l1.user_id < l2.user_id we can write l1.user_id !=l2.user_id so that we do not have to union the table at the end

vanshagrawal
Автор

because of previous sql videos I easily understand thelogic he used to write queries in this video. really thanks for such educational video.

hassamulhaq
Автор

Sir leetcode sql premium questions are difficult. Would appreciate few more videos on this topic.

anonymousgreen
Автор

You should definitely do another. Very good content Sir.

jirikalina
Автор

looking forward to more such videos! thanks in advance!

GarvitaSaraswat-tr
Автор

Could you please do more leet code problems?

iamdushyanta
Автор

@techtfq sir please leetcode SQL problem solution series please

roz_world
Автор

Thank you very much! very very helpful. Look forward to more such problems.

sujaa
Автор

Nice. Be posting leetcode solutions for sql.

lioneleli
Автор

Please do more leetcode complex problem

saadmultani
Автор

It's a good approach, but have one doubt do we need the valid_user cte?. Because we are anyway filtering it using having in a freinds cte.

bestquotes
Автор

Hii sir thanku for this quality video but sir i have a big question to solve in SQL sir there any way to connect with you and tell you the problem and other student also learn form the question
Kindly provide me the way to connect with you

Mr.nikk
Автор

Please which tool are you using to record your screen?

adesholaolaitan
Автор

When you understand the logic and know the cte logic it's like playing game

Naveenvuppala
Автор

sir try to make videos on transactions and cursors

marrapumani
Автор

sir please teach transaction management with real world exampless

Malaika_ki_rahein
Автор

For what roles are such questions asked in the interview, sir?

JoelJeremiah-vt
Автор

hello everyone, i am having a tiny problem while writing query, if anyone could help me that would be so great. so, when i write query and press enter to go to next line, it automaticaly add some space at the begining which i don't want for ex:
(select * from abc
where aaa
group by bbb) somthin like this. if anyone knows what settings should i chaneg to write just like sir writing in the video, i would be so greatfull to you.

rohit_vora
Автор

Sir, I am clicking this question then require subscribe to unlock. Can you suggest me how it will open.

MohdSaeed-gl