欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

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

发布时间:2025/3/11 49 豆豆
生活随笔 收集整理的这篇文章主要介绍了 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 replaceview view_nameasselect column_name1, column_name2,...from table_namewhere 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)

  • Views can subset the data in a table.

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

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

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

  • Views do not require additional storage.

    视图不需要额外的存储。

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

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

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

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

  • 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数据库管理系统

    创作挑战赛新人创作奖励来咯,坚持创作打卡瓜分现金大奖

    总结

    以上是生活随笔为你收集整理的dbms数据库管理系统_数据库管理系统(DBMS)中的视图的全部内容,希望文章能够帮你解决所遇到的问题。

    如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。