본문 바로가기
[스파르타코딩클럽]데이터분석 과정/SQL

[SQL 코드카타] 99번 (LeetCode)

by doo_ 2024. 1. 12.

99번 number-of-unique-subjects-taught-by-each-teacher

SELECT
    teacher_id, count(distinct subject_id) as cnt
FROM
    teacher
GROUP BY
    teacher_id