题目描述
leetcode题目:2356. 每位教师所教授的科目种类的数量


Code
select teacher_id, count(distinct subject_id) as cnt
from Teacher
group by teacher_id
反思点:不要想的太复杂了,不要受联合主键(复合主键)的干扰。。。
本文讨论了解一道LeetCode题目,涉及查询数据库中每位教师教授的科目种类数量,提醒读者避免过度考虑复合主键带来的干扰,保持问题简洁。
leetcode题目:2356. 每位教师所教授的科目种类的数量


select teacher_id, count(distinct subject_id) as cnt
from Teacher
group by teacher_id
反思点:不要想的太复杂了,不要受联合主键(复合主键)的干扰。。。
1289
1105

被折叠的 条评论
为什么被折叠?
