728x90
https://leetcode.com/problems/number-of-unique-subjects-taught-by-each-teacher/
SELECT
teacher_id,
COUNT(DISTINCT(subject_id)) as cnt
FROM Teacher
GROUP BY teacher_id;
728x90
'IT > 코딩테스트' 카테고리의 다른 글
[Leetcode] 1683. Invalid Tweets (0) | 2023.08.29 |
---|---|
[Leetcode] 1148. Article Views I (0) | 2023.08.29 |
[Leetcode] 941. Valid Mountain Array (0) | 2023.08.28 |
[Leetcode] 1299. Replace Elements with Greatest Element on Right Side (0) | 2023.08.26 |
[Leetcode] 922. Sort Array By Parity II (0) | 2023.08.26 |