1 / 5
文档名称:

实验六 视图、存储过程和触发器 实验报告.doc

格式:doc   大小:69KB   页数:5页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

实验六 视图、存储过程和触发器 实验报告.doc

上传人:bb21547 2021/2/27 文件大小:69 KB

下载得到文件列表

实验六 视图、存储过程和触发器 实验报告.doc

相关文档

文档介绍

文档介绍:实验六 视图、存储过程和触发器
实验内容1
建立视图
实现代码
create view 学生成绩
as
select ,,,
from sc,sections,course
where = and =
运行界面
数据查询
实现代码
select distinct cname from 学生成绩
where cname not in (select cname from 学生成绩where score < 60)
运行界面
实验内容2
建立存储过程1
实现代码
create procedure 学生信息;1
as select * from student
运行界面
建立存储过程2
实现代码
create procedure学生信息;2
@_birthyear int
as
select * from student
where year(birthday)=@_birthyear
运行界面
实验内容3
建立触发器1
实现代码
create trigger学号约束 on sc
for insert,update
as
begin
if((select snum from inserted ins)not in (select snum from student))
begin
print'违反参照完整性约束'
rollback
end
end
建立触发器2
CREA