数据库中的view有何作用?

原文:http://searchsqlserver.techtarget.com/definition/view

在数据库管理系统当中,view是描述数据库中信息的一种方式。若要将数据项按某种特定的序列排列、突出某些数据项,或者只显示特定的数据项,这些都可以通过view(视图)来实现。对于任何数据库来说,可能有一些视图需要定义。与拥有少量数据项的数据库相比,拥有很多数据项的数据库可能有更多的视图。就像虚拟表一样,视图本身并不真正的存储信息,但仅仅只是从一个或多个已经存在的表中将数据取出。虽然很无常,一个视图能通过存储其查询标准,而被重复的访问。

以用户需要的信息为目睹定义最好的视图。比如,在一本电话目录中,一个用户可能只想查询名字和其电话,并不关心其住址。为该目的设计的最好的视图只有两列:phone numbers(按数字排序)放在第一列,与该号码相对应的名字放在第二列。另一个用户只想查询电话和与其相对应的住址,并不需要知道与其对应的名字。为该目的设计的最好视图拥有这两列:住址(按字母排列)放在第一列,电话放在第二列。

原文

In a database management system, a view is a way of portraying information in thedatabase. This can be done by arranging the data items in a specific order, by highlighting certain items, or by showing only certain items. For any database, there are a number of possible views that may be specified. Databases with many items tend to have more possible views than databases with few items. Often thought of as a virtual table, the view doesn't actually store information itself, but just pulls it out of one or more existing tables. Although impermanent, a view may be accessed repeatedly by storing its criteria in a query.

The best view for a particular purpose depends on the information the user needs. For example, in a telephone directory, a user might want to look up the name associated with a number, without concern for the street address. The best view for this purpose would have two columns: the phone numbers (in numeric sequence) in the first column, and the name associated with each number in the second column. Another user might want to look up the phone number associated with a street address, without any need to know the name. The best view for this purpose would have two columns: the street addresses (in alphanumeric order) in the first column, and the phone number in the second column.


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值