zoukankan      html  css  js  c++  java
  • SQL必知必会-笔记(九)视图

    视图是虚拟的表,和包含数据的表不一样,视图只包含使用时动态检索数据的查询。

    为什么使用视图?

    • 重用SQL语句
    • 简化复杂的SQL操作
    • 使用表的一部分而不是整个表
    • 保护数据
    • 更改数据格式和表示
    create view ProductCustomers as select cust_name,cust_contact,prod_id from Customers,Orders,OrderItems where Customers.cust_id = Orders.cust_id and OrderItems.order_num = Orders.order_num;
    
    

    创建了一个名为 ProductCustomers的视图,返回订购了任意产品的所有顾客的列表。
    下面检索订购了产品RGAN01的顾客:

    select cust_name,cust_contact from ProductCustomers where prod_id = 'RGAN01';
    
  • 相关阅读:
    HTML超链接应用场景
    String 字符串和StringBuffer的知识点总结
    猜数游戏代码
    MemoryLayout
    偏swift框架
    git的使用
    寄存器
    swift基础
    枚举
    安装Ubuntu 20.04 以后
  • 原文地址:https://www.cnblogs.com/xLI4n/p/10348563.html
Copyright © 2011-2022 走看看