[코드카타] SQL 38 Number of Unique Subjects Taught by Each Teacher

Data_Student·2024년 11월 20일
0

코드카타

목록 보기
47/82

[코드카타] SQL 38 Number of Unique Subjects Taught by Each Teacher

38. Number of Unique Subjects Taught by Each Teacher
https://leetcode.com/problems/number-of-unique-subjects-taught-by-each-teacher/

Write a solution to calculate the number of unique subjects 
each teacher teaches in the university.
Return the result table in any order.
select teacher_id, count(distinct subject_id) cnt
from Teacher
group by teacher_id
중복값 제거하고 count 하기!

0개의 댓글