50个常用sql前十个就够用了要素.doc

Student(S#,Sname,Sage,Ssex) 学生表 Course(C#,Cname,T#) 课程表 SC(S#,C#,score) 成绩表 Teacher(T#,Tname) 教师表 ? create table Student( S# varchar(20), Sname varchar(10), Sage int, Ssex varchar(2)) 前面加一列序号: if exists(select table_name from information_schema.tables where table_name=Temp_Table) drop table Temp_Table go select 排名=identity(int,1,1),* INTO Temp_Table from Student go select * from Temp_Table go ? drop database [ ] --删除空的没有名字的数据库 问题: 1、查询“”课程比“”课程成绩高的所有学生的学号; select a.S# from (select s#,score from SC where C#=001) a, (select s#,score from SC where C#=002) b where a.scoreb.score and

文档评论(0)

1亿VIP精品文档

相关文档