No video

1280. Students and Examinations| Leetcode SQL Easy

  Рет қаралды 3,401

Tech Timeout

Tech Timeout

Жыл бұрын

Welcome to the Leetcode SQL series
#leetcodesolution #leetcode #sql
Link to the problem:
leetcode.com/p...
👉 Link to Dense_rank, rank, and row_number functions video:
• Dense rank vs Rank vs ...
👉 Link to the video on Database Design:
• Database Design Crash ...
Instagram- / timeout_tech
Twitter- / timeout_tech
Facebook- / timeout.tech
Visit my KZbin channel here-
/ @techtimeout
Access the "SQL Interview Queries For Product-Based Companies" series playlist here:
• SQL Interview Queries ...

Пікірлер: 6
@sandeepnarwal8782
@sandeepnarwal8782 4 ай бұрын
Can we complete this question using only 1 join?
@aidanurulain4310
@aidanurulain4310 8 ай бұрын
why my below syntax did not work ? SELECT S.student_id, S.student_name, U.subject_name, COUNT(E.subject_name) as attended_exams FROM Students S JOIN Examinations E ON S.student_id = E.student_id LEFT JOIN Subjects U ON U.subject_name = E.subject_name GROUP BY S.student_id, S.student_name, U.subject_name ORDER BY S.student_id, U.subject_name
@_SanchitaPatil
@_SanchitaPatil Жыл бұрын
why did you count student id and why not subject name
@techtimeout
@techtimeout 11 ай бұрын
Interesting! I substituted Student_id by subject_id :"select s.student_id, s.student_name, sb.subject_name, ifnull(count(e.subject_name),0)attended_exams from students s cross join subjects sb left join examinations e on e.student_id = s.student_id and e.subject_name = sb.subject_name group by s.student_id, s.student_name, sb.subject_name order by s.student_id, sb.subject_name;" And it returned the correct result. This works because we want to count the number of times student appears in exam and that can be done by counting number of times a student_id appears for a subject OR number times a subject appears for a student as the count in both these cases in examination table is same. Thank you for this thought-provoking comment!
@_SanchitaPatil
@_SanchitaPatil 11 ай бұрын
@@techtimeout thank you for explaning
@Sattya998
@Sattya998 11 ай бұрын
Sound
LeetCode 1280 Interview SQL Question with Detailed Explanation | Practice SQL
20:13
Roadmap for Learning SQL
4:52
ByteByteGo
Рет қаралды 358 М.
黑天使遇到什么了?#short #angel #clown
00:34
Super Beauty team
Рет қаралды 40 МЛН
IQ Level: 10000
00:10
Younes Zarou
Рет қаралды 13 МЛН
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 62 МЛН
Fortunately, Ultraman protects me  #shorts #ultraman #ultramantiga #liveaction
00:10
Database Indexing for Dumb Developers
15:59
Laith Academy
Рет қаралды 51 М.
LeetCode 1280: Students and Examinations - Interview Prep Ep 23
12:36
MLV Prasad - LeetCode SQL [ EASY ] | 1280 | "Students and Examinations" |
14:07
Data Science University - MLV Prasad
Рет қаралды 3 М.
Why you should not be a data scientist
12:33
Tina Huang
Рет қаралды 758 М.
1251. Average Selling Price| Leetcode SQL Easy
7:19
Tech Timeout
Рет қаралды 3,2 М.
LeetCode 1211 Interview SQL Question with Detailed Explanation | Practice SQL
13:28
LeetCode 1934: Confirmation Rate [SQL]
12:08
Frederik Müller
Рет қаралды 1,3 М.
1205. Monthly Transactions II | Leetcode SQL Medium
15:22
Tech Timeout
Рет қаралды 462
黑天使遇到什么了?#short #angel #clown
00:34
Super Beauty team
Рет қаралды 40 МЛН