赞
踩
注意:Sno、Cno是主键
select * from SC
select Sno, Sname, Sdept from Student
select Sname, Sage
from Student
where Sdept='数学' and Ssex='男' and Sage BETWEEN 18 AND 22
select min(Grade) from SC where Cno='C01'
select Sdept, count(*) from Student group by Sdept
select * from Student where Ssex='女' and Sdept='计算机'
select count(*) from Student
select Sname, Sdept from Student, SC where Student.Sno=SC.Sno and SC.Cno='C02'
select Sname, Smajor, Grade
from Student, SC
where Student.Sno=SC.Sno and Grade>80 order by Grade DESC
select Sno, Sname, Sdept from Student, SC where Sno NOT IN(
select Sno from SC
)
select Sname, Sdept from Student, SC where Sno IN(
select Sno from SC where Cno='C01'
)
select Sno, Sname, Cno, Grade from Student, SC where Sdept='数学' and Sno IN(
select Sno from SC where Grade>80
)
select Sname from Student, SC where Sdept='计算机' and Sno IN(
select Sno from SC where Grade IN(
select Max(grade) from SC
)
)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。