SQL视图部分实验

在数据库中,以Student Course 和sc 表为基础完成以下视图定义:

1. 定义计算机系学生基本情况视图V_Computer;

答:建立语句视图如下:

create view v_computer(sno,sname,sex,cname)

as

select student.sno,sname,ssex,cname

from student,sc,course

where student.sno=sc.sno and 

      sc.cno=course.cno and

      sdept='CS'

结果如下:

猜你喜欢

转载自blog.csdn.net/PD137/article/details/80919510