--问题3.3将COURSE中报名人数大于20的课程编号、课程名称、学分和上课时间抽取到NEW_COURSE表中
use [xk-zcx]
go
select couno,couname,credit,schooltime into new_course
from Course
where WillNum>20
go
use [xk-zcx]
go
select '课程编号'=couno ,'课程名称'=couname,'学分'=credit,'上课时间'=schooltime
into new_course1
from Course
where WillNum >20
go
--问题3.4将'01'旅游管理“班级同学的学好、姓名和选修的课程编号、课程名称抽取到名称为my_class的新表中
use [xk-zcx]
go
select s.stuno,stuname,c.couno,couname into my_class
from Student s,Course c,StuCou sc,Class cl
where s.StuNo=sc.StuNo and
c.CouNo=sc.CouNo and
cl.ClassNo=s.ClassNo and
ClassName='01旅游管理'
go
--问题3.5向DEPARTMENT表中添加如下3行数据
use [xk-zcx]
go
insert Department
values('11','数学系')
insert Department (DepartName ,DepartNo )
values('数理系','12')
insert Department (DepartNo ,DepartName )
values('13','化学系')
go
select *
from Department
go
--问题3.6问班级表添加如下4行数据
use [xk-zcx]
go
insert INto Class
select '20110001','03旅游管理','03'
union
select '20110002','03旅游管理','03'
union
select '20110003','02旅游管理','02'
union
select '20110004','02旅游管理','02'
go
select *
from Class
go
--删除表明
delete from Student
where '名称'