dbms数据库管理系统_数据库管理系统(DBMS)中的视图

dbms数据库管理系统

DBMS College professor once realized that students feel sad when they see their friend's marks higher than them and it creates a negative impact on them. It gave the Professor an idea to create a view table in his student academic result database.

DBMS学院的教授曾经意识到,当学生看到朋友的标记比他们高时会感到难过,这会对他们产生负面影响。 这给了教授一个想法, 可以在他的学生学术成绩数据库中创建视图表

In the database, View is a virtual table that combines the result set of a stored query. It is very important when we want to restrict a certain user from accessing the entire database. View is dynamic and can be computed from the data in the database. Changing the data in a table alters the data shown in the view as well.

在数据库中, View是一个虚拟表,它结合了存储查询的结果集 。 当我们想限制某个用户访问整个数据库时,这一点非常重要。 视图是动态的,可以根据数据库中的数据进行计算。 更改表中的数据也会更改视图中显示的数据。

When the Professor applies this technique, the student got to see their marks only and thus create a positive impact on the students as they are now competing with the one person only, themselves.

当教授应用此技术时,学生只能看到自己的标记,从而对学生产生积极的影响,因为他们现在仅与一个人自己竞争。

In a relational database, a view is not the part of a relational schema.

在关系数据库中, 视图不是关系模式的一部分。

1.创建视图 (1. Create view)

Syntax to create a view:

创建视图的语法:

    create or replace
    view view_name
    as
    select column_name1, column_name2,...
    from table_name
    where condition;

Example:

例:

Suppose, we have to create a student view table of view10.

假设我们必须创建一个view10的学生视图表。

create
view view10
select marks from student
where rollno = 10;

2.放下视图 (2. Drop View)

Syntax to drop a view:

删除视图的语法:

    drop view viewname;

Example:

例:

If view10 table has to be dropped, the command looks like:

如果必须删除view10表,则命令如下所示:

drop view view10;

DBMS中视图的优点 (Advantages of a view in DBMS)

  1. Views can subset the data in a table.

    视图可以将表中的数据子集化。

  2. Views can join and simplify the tables in a virtual table.

    视图可以联接并简化虚拟表中的表。

  3. Views do not require additional storage.

    视图不需要额外的存储。

  4. Views can hide the complexity of the database and the data the user must hide that.

    视图可以隐藏数据库的复杂性以及用户必须隐藏的数据。

  5. Views can act as aggregated tables where aggregated data (sum, average, etc.) are calculated and presented as part of data.

    视图可以用作汇总表,在汇总表中计算汇总数据(总和,平均值等)并将其显示为数据的一部分。

  6. Views can provide additional security from unauthorized users and unauthorized access.

    视图可以为未经授权的用户和未经授权的访问提供额外的安全性。

DBMS中视图的缺点 (Disadvantages of a view in DBMS)

Database view may be slow if it is approved from a view table that is generated from another view.

如果从另一个视图生成的视图表中批准了数据库视图,则数据库视图可能会变慢。

翻译自: https://www.includehelp.com/dbms/views-in-dbms.aspx

dbms数据库管理系统

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值