zoukankan      html  css  js  c++  java
  • 数据库视图--学生教师信息表为例

    --视图,视图就是一个虚拟的表,只能查询,不能修改!只能用作查询!
    
    select *from View_1 
    
    --显示101这个学生的学生sno,sname,cno,degree
    create view view 2
    as
       select Student.Sno,sname,cno,DEGREE from Student join Score on Student.Sno=Score.Sno
    go
    
    
    select Student.Sno,sname,cno,DEGREE from Student join Score on Student.Sno=Score.Sno
    select *from View_2 where Sno=101--视图view_2里面只选择sno,sname,cno,degree
    
    
    select *from(select Student.Sno,sname,cno,DEGREE from Student join Score on Student.Sno=Score.Sno) as table2 where Sno=101
    --select Student.Sno,sname,cno,DEGREE from Student join Score on Student.Sno=Score.Sno当作一个临时表来用,就是子查询

    二百个不间断的重复,只是让我看到了人的命运无法改变这一事实而已。
  • 相关阅读:
    商品表(spu)、规格表(sku)设计
    Links
    About
    AFO
    口胡题
    NOIP2014 飞扬的小鸟
    CSP2019 Emiya 家今天的饭
    CSP2019 括号树
    CSP-J2019 加工零件
    CSP-J2019 纪念品
  • 原文地址:https://www.cnblogs.com/dlexia/p/4462129.html
Copyright © 2011-2022 走看看