查看mysql的实例_MySQL查询实例
数据库内容:mysql查看所有存储过程
新闻网站首页模板
查询Score表中⾄少有5名学⽣选修的并以3开头的课程的平均分数。
select avg(Degree) from Score where Cno in (select Cno from Score group by Cno having count(*)>5) and Cno like '3%' group by Cno
select avg(Degree) from Score where Cno like '3%' group by Cno having count(*)>5
查询选修“3-105”课程的成绩⾼于“109”号同学成绩的所有同学的记录。
select * from Score where Cno ='3-105' and Degree>(select Degree from Score where Sno = '109' and Cno = '3-105')
查询成绩⾼于学号为“109”、课程号为“3-105”的成绩的所有记录。
select * from Score where Degree >(select Degree from Score where Sno = '109' and Cno = '3-105')
查询score中选学多门课程的同学中分数为⾮最⾼分成绩的记录。
理解1
select * from Score a where Sno in (select Sno from Score group by Sno having count(*)>1 ) and Degree not in (select max(Degree) from Score b where b.Cno =
ubuntu无法解析域名a.Cno)
extjs进度条理解2
select * from Score a where Sno in (select Sno from Score group by Sno having count(*)>1 ) and De
gree not in (select max(Degree) from Score a where Sno in
(select Sno from Score group by Sno having count(*)>1 ))
capacity into full play查询所有“⼥”教师和“⼥”同学的name、sex和birthday.
select Sname,Ssex,Sbirthday from Student where Ssex='⼥' union
select Tname,Tsex,Tbirthday from Teacher where Tsex='⼥'
dom解析xml查询Student表中最⼤和最⼩的Sbirthday⽇期值。
select max(Sbirthday) from Student union select min(Sbirthday) from Student
查询Student表中不姓“王”的同学记录。
select * from Student where Sno not in(select Sno from Student where Sname like '王%')
查询和“李军”同性别并同班的同学Sname.
select Sname from Student where Ssex = (select Ssex from Student where Sname='李军') and Class=(select Class from Student where Sname = '李军')

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。