1月18日什么星座| l1椎体在什么位置| 什么情况下需要会诊| 6月6日什么星座| 银手镯为什么会变黑| 惊讶表情是什么意思| 女频是什么| 跳蛋是什么意思| cha什么意思| 家里有壁虎是什么征兆| 喝酒肚子疼是什么原因| 感冒冒虚汗是什么原因| 毛囊炎吃什么药| sodium是什么意思| 呼吸快是什么原因| 炼奶是什么| 喝茶叶茶有什么好处和坏处| 93年属于什么生肖| 背上长毛是什么原因引起的| 上呼吸道感染吃什么消炎药| 仓鼠咬笼子是什么原因| 六味地黄丸什么人不能吃| 梦见土豆是什么意思| 一九九八年属什么生肖| 关帝是什么神| 小腿麻木是什么原因引起的| 妇科衣原体是什么病| 为什么会起荨麻疹| 环切是什么意思| 排山倒海是什么意思| 孩子咬手指甲是什么原因| 息肉是什么| emg是什么意思| 左行气右行血什么意思| 心脏肿大是什么原因| 晒后修复用什么比较好| 大冒险问什么| 胆红素偏高挂什么科| 2008年属鼠是什么命| 训练有素是什么意思| 黄体酮是什么意思| 漫不经心是什么意思| 来大姨妈能吃什么水果| 鸽子拉水便是什么原因| police是什么意思| 牙松动了还疼用什么方法处理最好| 结石长什么样子图片| 梦见恐龙是什么预兆| 春天的花开秋天的风是什么歌| 请问尿路感染吃什么药最好| 为什么会呼吸性碱中毒| 做胃镜挂什么科| 艾滋病是什么病毒| 酵母菌是什么| vocabulary是什么意思| 小伙子是什么意思| 白蜡金是什么金| 胎菊和金银花一起泡水有什么效果| 三个虫念什么| 腰椎间盘突出和膨出有什么区别| 间接胆红素高是什么意思| 低密度脂蛋白偏高什么意思| 右脚踝肿是什么原因引起的| 下过海是什么意思| 尿的颜色有点红褐色是什么原因| 玫瑰什么时候开花| 无什么| 犹太人为什么聪明| 垫脚石是什么意思| 卡宾男装属于什么档次| 男人有霉菌是什么症状| 小孩疝气看什么科室| 干事是什么意思| 见红是什么样的| 石灰水是什么| 旧衣服属于什么垃圾| 泥鳅喜欢吃什么| hpv亚临床感染是什么意思| 今年21岁属什么生肖| 公务员属于什么行业| 过敏性紫癜什么症状| 1972年属鼠的是什么命| 为什么医院不推荐钡餐检查| 男人忽冷忽热说明什么| 自欺欺人是什么意思| 肆意什么意思| 什么的玻璃| 迪拜货币叫什么| 什么叫单亲家庭| 自强不息的息是什么意思| kcl是什么药| mm表示什么| 出栏是什么意思| 鼻子突然出血是什么原因| 厥逆是什么意思| b型血和o型血生的孩子是什么血型| 天麻加什么治头晕| 手臂上长痣代表什么| 百合有什么作用| 无极是什么意思| 什么是匝道图片| aah是什么意思| hvp是什么病毒| 巨蟹座前面是什么星座| 蛇盘疮吃什么药好得快| 聚精会神的看是什么词语| 身体出现小红点是什么原因| 1104是什么星座| 重逢是什么意思| 甲亢是什么| 不义之财是什么意思| 脂肪分解成什么| 14楼五行属什么| 梦见自己吐血是什么征兆| 喝红枣水有什么好处和坏处| 体位性低血压是什么| 羊驼吃什么| 立羽读什么| 阴历六月是什么月| 头晕是什么毛病| 汗青是什么意思| 右肋下疼痛是什么原因| 龋病是什么意思| 心脏疼吃什么药效果好| 吃什么补气血效果最好| 小孩白头发是什么原因引起的| pu是什么元素| bv什么意思| 水母吃什么| 感冒有黄痰是什么原因| 龙猫吃什么| 失眠有什么办法解决| 鱼的尾巴有什么作用| 舌头上有溃疡是什么原因| 肾结石用什么药最好| 毛肚是什么| 周杰伦得了什么病| 沙悟净是什么生肖| 夏天肚子疼是什么原因| 12月13日是什么星座| 炖鱼都放什么调料| 社恐的人适合什么工作| 硬核什么意思| 肺结节钙化是什么意思| 腿脚肿胀是什么原因引起的| 手脱皮吃什么药| 多巴胺是什么| 经常放屁是什么原因造成的| 汉语拼音是什么时候发明的| 乔迁对联什么时候贴| 阿昔洛韦片治什么病| 心有余而力不足什么意思| 医院特需号是什么意思| 丛林之王是什么动物| 心律平又叫什么名字| 兔死狗烹是什么生肖| 夏至喝什么汤| 梦见牙套掉了是什么意思| 拍胸片能检查出什么| 大专跟本科有什么区别| 头发容易断是什么原因| 柠檬可以做什么| 什么食物黄体酮含量高| 壁虎的尾巴有什么用| 眩晕是什么症状| 嫣然是什么意思| guava是什么水果| 今天天气适合穿什么衣服| 发烧是什么症状| 正厅级是什么级别| 睡眠时间短是什么原因| 妈妈的堂哥叫什么| 狗狗咳嗽吃什么药| 山药不能和什么一起吃| 铁观音适合什么季节喝| 塔克是什么食物| 手术后能吃什么水果| 打呼噜是什么原因| 高三学生吃什么补脑抗疲劳| 孕妇梦见老鼠是什么意思| 钙不能和什么一起吃| 冠心病什么症状| 舌苔厚白吃什么药| 白醋和白米醋有什么区别| rsl是什么意思| 预科班什么意思| 外阴瘙痒吃什么药| 三角梅用什么肥料最好| 青稞面是什么| 犹太人为什么聪明| 1.29是什么星座| 病机是什么意思| 不良人是什么| 须眉什么意思| 多梦睡眠质量不好是什么原因| 你本来就很美是什么广告| 梦见家被偷了什么预兆| 回声团是什么意思| 并驾齐驱什么意思| 联合创始人是什么意思| 梦见自己假牙掉了是什么意思| 危楼高百尺的危是什么意思| 省政协委员是什么级别| 促进钙吸收吃什么| 牙齿痛吃什么| 敕令是什么意思| 吃了牛肉不能吃什么| 炖汤用什么鸡| 血压高有什么症状| 奶酪是什么做的| 喝什么胸会变大| 此刻朋友这杯酒最珍贵是什么歌| 桃李满天下什么意思| 平五行属什么| 广西有什么水果| 二尖瓣钙化是什么意思| 低压高是什么原因引起的| 心脏有个小洞叫什么病| 家财万贯是什么动物| 脸上涂什么可以美白| 7.14日是什么日子| 出虚汗是什么原因引起的| 补气吃什么| 老人适合喝什么茶| 后背疼是什么原因| 长方形纸能折什么| 女性黄体期是什么意思| 脸上爱长痘痘是什么原因| 头皮挂什么科| 什么叫有格局的人| 口我是什么意思| 白手套什么意思| 梦见很多小孩是什么意思| 楚楚动人是什么意思| 天宫是什么意思| 抵押什么意思| 康熙的儿子叫什么| 玥是什么意思| 胃烧灼感是什么原因引起的| 坊字五行属什么| 脚干裂用什么药最好| vana是什么牌子| 扁桃体发炎是什么引起的| 吃卡培他滨禁止吃什么| 上火流鼻血是什么原因| 吃什么会引起尿酸高| 处长是什么级别| 大黄是什么药材| 发五行属什么| 植物神经紊乱吃什么中成药| 母鸡什么意思| 补脾吃什么食物最好| 前位子宫是什么意思| 黑道日为什么还是吉日| 脊髓空洞是什么意思| 天蝎女和什么星座最配| 及时是什么意思| 山东的简称是什么| 拔了牙吃什么消炎药| 过敏是什么意思| michaelkors是什么牌子| 荆轲姓什么| 宝贝疙瘩是什么意思| 白龙马是什么生肖| 百度

押注次高端 区域白酒迎战名酒

百度 王晓久笑着说,他简单构思了一下,用手机搜到一幅田园的照片,于是,他用烟蒂作为画笔,用了20多分钟的时间,按照照片画出茅草屋、山间小路等场景。

In a database, a view is the result set of a stored query that presents a limited perspective of the database to a user.[1] This pre-established query command is kept in the data dictionary. Unlike ordinary base tables in a relational database, a view does not form part of the physical schema: as a result set, it is a virtual table[1] computed or collated dynamically from data in the database when access to that view is requested. Changes applied to the data in a relevant underlying table are reflected in the data shown in subsequent invocations of the view.

Views can provide advantages over tables:

  • Views can represent a subset of the data contained in a table. Consequently, a view can limit the degree of exposure of the underlying tables to the outer world: a given user may have permission to query the view, while denied access to the rest of the base table.[2]
  • Views can join and simplify multiple tables into a single virtual table.[2]
  • Views can act as aggregated tables, where the database engine aggregates data (sum, average, etc.) and presents the calculated results as part of the data.
  • Views can hide the complexity of data. For example, a view could appear as Sales2020 or Sales2021, transparently partitioning the actual underlying table.
  • Views take very little space to store; the database contains only the definition of a view, not a copy of all the data that it presents.
  • Views structure data in a way that classes of users find natural and intuitive.[2]

Just as a function (in programming) can provide abstraction, so can a database view. In another parallel with functions, database users can manipulate nested views, thus one view can aggregate data from other views. Without the use of views, the normalization of databases above second normal form would become much more difficult. Views can make it easier to create lossless join decomposition.

Just as rows in a base table lack any defined ordering, rows available through a view do not appear with any default sorting. A view is a relational table, and the relational model defines a table as a set of rows. Since sets are not ordered — by definition — neither are the rows of a view. Therefore, an ORDER BY clause in the view definition is meaningless; the SQL standard (SQL:2003) does not allow an ORDER BY clause in the subquery of a CREATE VIEW command, just as it is refused in a CREATE TABLE statement. However, sorted data can be obtained from a view, in the same way as any other table — as part of a query statement on that view. Nevertheless, some DBMS (such as Oracle Database) do not abide by this SQL standard restriction.

Read-only vs. updatable views

edit

Views can be defined as read-only or updatable. If the database system can determine the reverse mapping from the view schema to the schema of the underlying base tables, then the view is updatable. INSERT, UPDATE, and DELETE operations can be performed on updatable views. Read-only views do not support such operations because the DBMS cannot map the changes to the underlying base tables. A view update is done by key preservation.

Some systems support the definition of INSTEAD OF triggers on views. This technique allows the definition of other logic for execution in place of an insert, update, or delete operation on the views. Thus database systems can implement data modifications based on read-only views. However, an INSTEAD OF trigger does not change the read-only or updatable property of the view itself.

Materialized views

edit

Various database management systems have extended the views from read-only subsets of data, particularly materialized views: pre-executed, non-virtual views commonly used in data warehousing. They give a static snapshot of the data and may include data from remote sources. The accuracy of a materialized view depends on the frequency of trigger mechanisms behind its updates.

Materialized views were introduced by Oracle Database, while IBM Db2 provides so-called "materialized query tables" (MQTs) for the same purpose. Microsoft SQL Server introduced in its 2000 version indexed views which only store a separate index from the table, but not the entire data. PostgreSQL implemented materialized views in its 9.3 release.

Equivalence

edit

A view is equivalent to its source query. When queries are run against views, the query is modified. For example, if there exists a view named accounts_view with the content as follows:

-- accounts_view:
-------------
SELECT name,
       money_received,
       money_sent,
       (money_received - money_sent) AS balance,
       address,
	   ...
  FROM table_customers c 
  JOIN accounts_table a 
    ON a.customer_id = c.customer_id

then the application could run a simple query such as:

-- Simple query
------------
SELECT name,
       balance
  FROM accounts_view

The RDBMS then takes the simple query, replaces the equivalent view, then sends the following to the query optimizer:

-- Preprocessed query:
------------------
SELECT name,
       balance
  FROM (SELECT name,
               money_received,
               money_sent,
               (money_received - money_sent) AS balance,
               address,
			    ...
          FROM table_customers c JOIN accounts_table a
               ON a.customer_id = c.customer_id        )

The optimizer then removes unnecessary fields and complexity (for example it is not necessary to read the address, since the parent invocation does not make use of it) and then sends the query to the SQL engine for processing.

See also

edit

References

edit
  1. ^ a b "25.5 Using Views". MySQL. Oracle. 2025-08-05. Archived from the original on 2025-08-05. Retrieved 2025-08-05. Views are stored queries that when invoked produce a result set. A view acts as a virtual table.
  2. ^ a b c Groff, James R.; Weinberg, Paul N. (1999). SQL: The Complete Reference (PDF). Osborne/McGraw-Hill. pp. 291–292. ISBN 0072118458.
冬虫夏草生长在什么地方 怀孕哭对宝宝有什么影响 办理出院手续都需要什么 雾化主要治疗什么 泉中水命是什么意思
威士忌属于什么酒 摩羯男喜欢什么类型的女生 儿童肚子痛挂什么科 gps是什么意思 未见卵黄囊及胚芽是什么意思
脚气是什么样的 针灸是什么 噗噗是什么意思 月经不停吃什么药止血效果比较好 六味地黄丸有什么副作用
梦见别人生孩子预示什么 耳朵挂什么科 牛跟什么相冲 1988年出生是什么命 俄罗斯和白俄罗斯有什么区别
梦见出血是什么征兆jingluanji.com 鼻塞打喷嚏是什么原因hcv9jop4ns5r.cn 做什么运动可以长高hcv9jop0ns2r.cn 咳出痰带血是什么原因beikeqingting.com lala是什么意思hcv9jop5ns3r.cn
掉头发缺少什么维生素hcv9jop0ns3r.cn 晚上睡觉流口水什么原因xinmaowt.com 鼻子痒用什么药hcv7jop4ns5r.cn 深静脉血栓有什么症状yanzhenzixun.com 吃什么凉血效果最好aiwuzhiyu.com
什么颜色可以调成紫色hcv8jop6ns9r.cn 为什么左手会发麻hcv8jop5ns0r.cn 肋骨神经痛吃什么药hcv8jop6ns3r.cn 血糖血脂挂什么科hcv8jop0ns2r.cn 三叉神经痛有什么症状hcv8jop9ns8r.cn
洄游是什么意思hcv9jop1ns9r.cn 芋头是什么季节的gysmod.com 黄瓜片贴脸上有什么效果hcv7jop5ns6r.cn 下一年是什么生肖hcv8jop4ns8r.cn 为什么会长花斑癣hcv7jop6ns4r.cn
百度