SQL problem - Number of Unique Subjects Taught by Each Teacher
Problem
Query
SELECT
teacher_id,
COUNT(DISTINCT subject_id) as cnt
FROM
Teacher
GROUP BY
teacher_id
SELECT
teacher_id,
COUNT(DISTINCT subject_id) as cnt
FROM
Teacher
GROUP BY
teacher_id