- select * from student inner join sc on student.sno = sc.sno
-
-
set statistics io on
-
-
select student.sno,student.sname,sc.cno,sc.grade from student join sc on student.sno=sc.sno where student.sdept='计算机'
-
-
select sname,cno,grade from student,sc where sc.sno = student.sno and student.sdept='计算机'
-
select student.sname,sc.cno,sc.grade from student join sc on student.sno = sc.sno where student.sdept='计算机'
-
-
select cno,grade from sc where sc.sno<>990001
-
-
select grade from sc where sno=(select sno from student where sname='张忠和') and cno = (select cno from course where cname='软件工程')
-
-
select student.sname,student.sno,sc.grade,sc.cno,course.cname from student,sc,course where student.sno=sc.sno and sc.cno=course.cno and student.sname='张忠和' and course.cname='软件工程'
-
-
select student.sname,student.sno,sc.grade,sc.cno,course.cname from student
-
join sc on student.sno=sc.sno
-
join course on sc.cno=course.cno
-
where student.sname='张忠和' and course.cname='软件工程'
-
-
select * into student1 from student
-
-
select * into student2 from student union select * from student1
-
-
select * from student where sno in (select sno from sc where cno='001')
-
select * from student where exists (select * from sc where sno=student.sno and cno='001')
-
-
select * from student a where exists (select * from student b where a.sdept=b.sdept and b.sname='张三')
-
-
select *from student where sno not in(select sno from sc where cno=001)
-
-
select * from student where not exists (select sno from sc where student.sno=sc.sno and cno='001')
本文转自sucre03 51CTO博客,原文链接:http://blog.51cto.com/sucre/420273,如需转载请自行联系原作者