3 Very Important SQL Interview Questions on LeetCode | Practise SQL Questions

  ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 35,110

Sumit Mittal

Sumit Mittal

2 ะถั‹ะป ะฑาฑั€ั‹ะฝ

๐–๐š๐ง๐ญ ๐ญ๐จ ๐Œ๐š๐ฌ๐ญ๐ž๐ซ ๐’๐๐‹? ๐‹๐ž๐š๐ซ๐ง ๐’๐๐‹ ๐ญ๐ก๐ž ๐ซ๐ข๐ ๐ก๐ญ ๐ฐ๐š๐ฒ ๐ญ๐ก๐ซ๐จ๐ฎ๐ ๐ก ๐ญ๐ก๐ž ๐ฆ๐จ๐ฌ๐ญ ๐ฌ๐จ๐ฎ๐ ๐ก๐ญ ๐š๐Ÿ๐ญ๐ž๐ซ ๐œ๐จ๐ฎ๐ซ๐ฌ๐ž - ๐’๐๐‹ ๐‚๐ก๐š๐ฆ๐ฉ๐ข๐จ๐ง๐ฌ ๐๐ซ๐จ๐ ๐ซ๐š๐ฆ ๐›๐ฒ ๐’๐ฎ๐ฆ๐ข๐ญ ๐’๐ข๐ซ!
"๐€ 8 ๐ฐ๐ž๐ž๐ค ๐๐ซ๐จ๐ ๐ซ๐š๐ฆ ๐๐ž๐ฌ๐ข๐ ๐ง๐ž๐ ๐ญ๐จ ๐ก๐ž๐ฅ๐ฉ ๐ฒ๐จ๐ฎ ๐œ๐ซ๐š๐œ๐ค ๐ญ๐ก๐ž ๐ข๐ง๐ญ๐ž๐ซ๐ฏ๐ข๐ž๐ฐ๐ฌ ๐จ๐Ÿ ๐ญ๐จ๐ฉ ๐ฉ๐ซ๐จ๐๐ฎ๐œ๐ญ ๐›๐š๐ฌ๐ž๐ ๐œ๐จ๐ฆ๐ฉ๐š๐ง๐ข๐ž๐ฌ ๐›๐ฒ ๐๐ž๐ฏ๐ž๐ฅ๐จ๐ฉ๐ข๐ง๐  ๐š ๐ญ๐ก๐จ๐ฎ๐ ๐ก๐ญ ๐ฉ๐ซ๐จ๐œ๐ž๐ฌ๐ฌ ๐š๐ง๐ ๐š๐ง ๐š๐ฉ๐ฉ๐ซ๐จ๐š๐œ๐ก ๐ญ๐จ ๐ฌ๐จ๐ฅ๐ฏ๐ž ๐š๐ง ๐ฎ๐ง๐ฌ๐ž๐ž๐ง ๐๐ซ๐จ๐›๐ฅ๐ž๐ฆ."
๐‡๐ž๐ซ๐ž ๐ข๐ฌ ๐ก๐จ๐ฐ ๐ฒ๐จ๐ฎ ๐œ๐š๐ง ๐ซ๐ž๐ ๐ข๐ฌ๐ญ๐ž๐ซ ๐Ÿ๐จ๐ซ ๐ญ๐ก๐ž ๐๐ซ๐จ๐ ๐ซ๐š๐ฆ -
๐‘๐ž๐ ๐ข๐ฌ๐ญ๐ซ๐š๐ญ๐ข๐จ๐ง ๐‹๐ข๐ง๐ค (๐‚๐จ๐ฎ๐ซ๐ฌ๐ž ๐€๐œ๐œ๐ž๐ฌ๐ฌ ๐Ÿ๐ซ๐จ๐ฆ ๐ˆ๐ง๐๐ข๐š) : rzp.io/l/SQLINR
๐‘๐ž๐ ๐ข๐ฌ๐ญ๐ซ๐š๐ญ๐ข๐จ๐ง ๐‹๐ข๐ง๐ค (๐‚๐จ๐ฎ๐ซ๐ฌ๐ž ๐€๐œ๐œ๐ž๐ฌ๐ฌ ๐Ÿ๐ซ๐จ๐ฆ ๐จ๐ฎ๐ญ๐ฌ๐ข๐๐ž ๐ˆ๐ง๐๐ข๐š) : rzp.io/l/SQLUSD
๐–๐š๐ง๐ญ ๐ญ๐จ ๐ฅ๐ž๐š๐ซ๐ง ๐๐ข๐  ๐ƒ๐š๐ญ๐š ๐›๐ฒ ๐’๐ฎ๐ฆ๐ข๐ญ ๐’๐ข๐ซ?
๐œ๐ก๐ž๐œ๐ค๐จ๐ฎ๐ญ ๐ญ๐ก๐ž ๐›๐ข๐  ๐๐š๐ญ๐š ๐œ๐จ๐ฎ๐ซ๐ฌ๐ž ๐๐ž๐ญ๐š๐ข๐ฅ๐ฌ
๐–๐ž๐›๐ฌ๐ข๐ญ๐ž : trendytech.in/?src=youtube&su...
I have trained over 20,000+ professionals in the field of Data Engineering in the last 5 years.
3 Very Important SQL Interview Questions on LeetCode | Practise SQL Questions
178. Rank Scores
180. Consecutive Numbers
181. Employees Earning More Than Their Managers
Do Like, Comment & Subscribe ..
๐—๐—ผ๐—ถ๐—ป ๐—บ๐—ฒ ๐—ผ๐—ป ๐—ฆ๐—ผ๐—ฐ๐—ถ๐—ฎ๐—น ๐— ๐—ฒ๐—ฑ๐—ถ๐—ฎ:๐Ÿ”ฅ
๐Ÿ”…Sumit LinkedIn - / bigdatabysumit
๐Ÿ”…Sumit Instagram - / bigdatabysumit
In this video, we will solve SQL question on LeetCode. LeetCode is an excellent platform for practicing SQL Queries. The SQL Questions on LeetCode are framed pretty similar to how they are asked on SQL Interviews hence solving SQL questions on LeetCode can give you a good hands on experience on solving real world SQL questions.
#SQL #RDBMS #database #bigdata #dataengineering

ะŸั–ะบั–ั€ะปะตั€: 31
@sumitmittal07
@sumitmittal07 ะ–ั‹ะป ะฑาฑั€ั‹ะฝ
Checkout the Big Data course details here: trendytech.in/?referrer=youtube_lc3
@rajorshi1000
@rajorshi1000 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
Thanks Sumit sir for such wonderful content and resolution. I have tried to resolve the problem-180 (Consecutive Numbers )with CTE and window function on my own and this is my 2 cents on it : with consecutive_val (num,next_val,next_to_next_val) as (select num , (lead(num,1) over (order by id asc)) as next_val , (lead(num,2) over (order by id asc)) as next_to_next_val from Logs) select distinct num as ConsecutiveNums from consecutive_val where num=next_val and num=next_to_next_val
@sumitmittal07
@sumitmittal07 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
That is nice. Keep practicing and improving on your skills
@rajorshi1000
@rajorshi1000 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
@@sumitmittal07 Thanks a lot for all the motivation.
@mystuffstudy1403
@mystuffstudy1403 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
Thanks for these videos sir. for 180 this is another way of doing with cte as ( select *, lead(val) over(order by id) 'nextval', lead(val,2) over(order by id) '2nd next val' from #test ) select distinct [2nd next val] from cte where val = nextval and val = [2nd next val]
@swastiktripathy8412
@swastiktripathy8412 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
These videos are very helpful in getting clarity on such topics also this will help to crack interviews in the top IT firms. Thank you very much Sumit sir.
@sumitmittal07
@sumitmittal07 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
I am happy that you are finding it helpful!
@arunsundar3739
@arunsundar3739 3 ะฐะน ะฑาฑั€ั‹ะฝ
able to understand when to use self-join & how to use self-join practically, SQL looks very interesting now, thank you very much sir :)
@technicalknowledge9828
@technicalknowledge9828 ะ–ั‹ะป ะฑาฑั€ั‹ะฝ
Thank you sumit for such useful videos
@mallikarjunpatil7553
@mallikarjunpatil7553 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
Thanks for uploading... Waiting for next one
@sumitmittal07
@sumitmittal07 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
Will be uploaded soon!
@nareshmallick6121
@nareshmallick6121 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
Very helpful to this video
@dineshchavan9462
@dineshchavan9462 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
Hi sumit sir ..nice video.. Just 1 question in problem number 180..what if we have string value instead of integers for ID column...please reply..
@sameerpandey2344
@sameerpandey2344 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
love to watch your videos!!
@sumitmittal07
@sumitmittal07 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
I'm so glad you are loving the videos.
@ningus8522
@ningus8522 ะ–ั‹ะป ะฑาฑั€ั‹ะฝ
Thank you sir...
@mubashirali9396
@mubashirali9396 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
lovely sumit sir
@sumitmittal07
@sumitmittal07 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
Thank you Mubashir :)
@kiran4608
@kiran4608 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
Sir what about java please make video on java interview
@dubeypushpendra4558
@dubeypushpendra4558 ะ–ั‹ะป ะฑาฑั€ั‹ะฝ
plz solve more videos sir
@girih-yt6de
@girih-yt6de 3 ะฐะน ะฑาฑั€ั‹ะฝ
select num as ConsecutiveNums from( SELECT num,row_number() OVER (PARTITION BY num) as cu FROM Logs) where cu>=3; does this work for second problem?
@mukeshrajpurohit5593
@mukeshrajpurohit5593 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
For Q.180. Canโ€™t we use Row Number partition by num, order by num and select Row Number > = 3??
@girih-yt6de
@girih-yt6de 3 ะฐะน ะฑาฑั€ั‹ะฝ
select num as ConsecutiveNums from( SELECT num,row_number() OVER (PARTITION BY num) as cu FROM Logs) where cu>=3;
@shivangikhanna6163
@shivangikhanna6163 ะ–ั‹ะป ะฑาฑั€ั‹ะฝ
I have one doubt here in problem statement 180. Consecutive Numbers. I understand we need to compare the ids in the join operation. But how is the = operator working. if logs l1 and l2 are pointing to same table,l1.id how is l1.id=l2.id+1 . isn't it comparing 1=2 in first case ? Will it not fail?
@upendrabalija9835
@upendrabalija9835 10 ะฐะน ะฑาฑั€ั‹ะฝ
Same doubt i have
@karthikbs8457
@karthikbs8457 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
the second problem where you added 1 and 2 was quite confusing.
@santoshingle3977
@santoshingle3977 6 ะฐะน ะฑาฑั€ั‹ะฝ
For problem-180 (Consecutive Numbers ) - I have used LEAD function. select distinct num as ConsecutiveNums from (select num, LEAD(num, 1) OVER (ORDER BY id) as lead_1, LEAD(num, 2) OVER (ORDER BY id) as lead_2 from Logs) as temp where temp.num=temp.lead_1 and temp.num=temp.lead_2
@amalkumar5201
@amalkumar5201 ะ–ั‹ะป ะฑาฑั€ั‹ะฝ
Sir how to join your session
@kishorekunal7194
@kishorekunal7194 2 ะถั‹ะป ะฑาฑั€ั‹ะฝ
179 : SELECT s.score, DENSE_RANK() OVER(ORDER BY score DESC) AS rank FROM scores s ORDER BY s.score DESC; 181:select E.name as employee from employee E where E.managerid is not null and E.salary > (select t1.salary from employee t1 where E.managerId = t1.id);
@sandeepmanjunath8004
@sandeepmanjunath8004 ะ–ั‹ะป ะฑาฑั€ั‹ะฝ
Are these for beginners or for the ones with 1-2 years of experience ?
@satishraj5303
@satishraj5303 ะ–ั‹ะป ะฑาฑั€ั‹ะฝ
it tried this way to get number which are repeting 3 time. -- create CREATE TABLE EMPLOYEE ( id INTEGER PRIMARY KEY, number INTEGER NOT Null ); -- insert INSERT INTO EMPLOYEE VALUES (1,1); INSERT INTO EMPLOYEE VALUES (2,1); INSERT INTO EMPLOYEE VALUES (3,1); INSERT INTO EMPLOYEE VALUES (4,2); INSERT INTO EMPLOYEE VALUES (5,2); INSERT INTO EMPLOYEE VALUES (6,3); INSERT INTO EMPLOYEE VALUES (7,3); -- fetch select t.number,count(t.number) from (select id,number,rank() over(order by id,number) as 'rank' from EMPLOYEE) t group by t.number having count(t.number)=3
Leetcode SQL Interview Questions  | Practise SQL questions
17:50
Sumit Mittal
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 21 ะœ.
SQL Interview Question - Find Nth Highest Salary | LeetCode
30:40
Sumit Mittal
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 37 ะœ.
Looks realistic #tiktok
00:22
ะะฝะฐัั‚ะฐัะธั ะขะฐั€ะฐัะพะฒะฐ
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 101 ะœะ›ะ
Cat Corn?! ๐Ÿ™€ #cat #cute #catlover
00:54
Stocat
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 15 ะœะ›ะ
ะŸะ ะžะ’ะ•ะ ะ˜ะ› ะะ ะ‘ะฃะ—ะซ #shorts
00:34
ะŸะฐัˆะฐ ะžัะฐะดั‡ะธะน
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 2 ะœะ›ะ
ะšะฐั…ะฐ ะธ ััƒะฟ
00:39
ะš-Media
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 5 ะœะ›ะ
The 25 SQL Questions You MUST Know for Data Analyst Interviews
32:47
KSR Datavizon
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 199 ะœ.
10 recently asked Pyspark Interview Questions | Big Data Interview
28:36
Sumit Mittal
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 26 ะœ.
LeetCode 175 | SQL Interview Questions on LeetCode
20:59
Sumit Mittal
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 53 ะœ.
Rank and Dense Rank in MySQL - Important SQL Interview Question
18:12
Sumit Mittal
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 45 ะœ.
Very Famous SQL Interview Question | Department Highest Salary
13:39
Sumit Mittal
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 23 ะœ.
Top 5 Advanced SQL Interview Questions and Answers | Frequently Asked SQL interview questions
36:59
Ankit Bansal
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 39 ะœ.
CTE in SQL (Common Table Expression) | SQL WITH Clause | CTE Query Performance | Advanced SQL
55:39
Sumit Mittal
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 96 ะœ.
Solving Complex SQL Query from HackerRank | SQL Interview Query
38:22
techTFQ
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 75 ะœ.
pwc question and answer in sql | top interview questions and answer in sql | #interview
18:26
DEwithDhairy
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 3,2 ะœ.
LeetCode Medium 180 "Consecutive Numbers" Amazon Uber Interview SQL Question Detailed Explanation
6:46
Everyday Data Science
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 8 ะœ.
Looks realistic #tiktok
00:22
ะะฝะฐัั‚ะฐัะธั ะขะฐั€ะฐัะพะฒะฐ
ะ ะตั‚ า›ะฐั€ะฐะปะดั‹ 101 ะœะ›ะ