https://leetcode.com/problems/students-and-examinations/description/
Students and Examinations - LeetCode
Can you solve this real interview question? Students and Examinations - Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
1
2
3
4
5
6
7
8
9
10
11
12
|
# Write your MySQL query statement below
select
s.student_id,
s.student_name, sub.subject_name,
count(e.subject_name) attended_exams
from Students s
join Subjects sub
left join Examinations e
on s.student_id = e.student_id and e.subject_name =sub.subject_name
group by s.student_id, sub.subject_name
order by s.student_id, sub.subject_name
|
cs |
반응형
'SQL' 카테고리의 다른 글
leetcode 1661. Average Time of Process per Machine (0) | 2023.04.14 |
---|---|
leetcode 1068. Product Sales Analysis I (0) | 2023.04.14 |
leetcode 577. Employee Bonus (0) | 2023.04.12 |
leetcode 1327. List the Products Ordered in a Period (0) | 2023.04.08 |
leetcode 1789. Primary Department for Each Employee (0) | 2023.04.08 |
댓글