时间:2021-07-01 10:21:17 帮助过:22人阅读
select a.s_id from (select s_id,score from SC where C_ID=‘001‘) a,(select s_id,scorefrom SC where C_ID=‘002‘) b where a.score>b.score and a.s_id=b.s_id;
select S_ID,avg(score) from sc group by S_ID having avg(score) >60;
select Student.S_ID,Student.Sname,count(SC.C_ID),sum(score) from Student left Outer join SC on Student.S_ID=SC.S_ID group by Student.S_ID,Sname
select count(distinct(Tname)) from Teacher where Tname like ‘李%‘;
select S_ID,Sname from Student where S_ID not in (select S.S_ID from Student AS S,SC where S.S_ID=SC.S_ID and score>60);
select distinct S_ID,Sname from Student,SC where Student.S_ID=SC.S_ID and SC.C_ID in (select C_ID from SC where S_ID=‘1001‘);
Mysql数据库技术(四)
标签:技术 count select 课程 mysql数据库 family not style ike