select student_id, sum(score) as sum_score
from scores
where exam_date = '2024-06-30'
and subject in ('语文','数学','英语')
group by student_id
having sum(score) > 330;
select student_id, sum(score) as sum_score
from scores
where exam_date = '2024-06-30'
and subject in ('语文','数学','英语')
group by student_id
having sum(score) >= 330;
select
case when enter_date >= '2010-01-01' then '青年教师'
when enter_date < '2000-01-01' then '资深教师'
else '中年教师'
end as teacher_type,
count(*)
from teachers
group by teacher_type;
select student_id, max(score), min(score), avg(score)
from scores
where (student_id = 460093or student_id = 735011) and subject = '数学'
group by student_id;
select name, subject, class_code, graduate_date
from teachers
where graduate_date >='1994-01-01' and graduate_date <='1997-12-31'
and gender = 'f'
order by graduate_date;
select name, subject, class_code, qualification
from teachers
where (fir_degr = '北京大学' or fir_degr = '清华大学')
and head_teacher is not null
order by name
;
select name, subject, class_code, qualification
from teachers
where fir_degr = '北京大学' or fir_degr = '清华大学'
and head_teacher is not null
order by name
;