#97. [LeetCode / MySQL] 2356. Number of Unique Subjects Taught by Each Teacher

문제

 

입력 코드

SELECT teacher_id, COUNT(DISTINCT(subject_id)) AS cnt
FROM Teacher
GROUP BY teacher_id;

 

 

코드 설명

#SELECT #COUNT #DISTINCT #GROUP BY 

 

 

문제 출처

 

LeetCode - The World's Leading Online Programming Learning Platform

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