dbms数据库管理系统_数据库管理系统(DBMS)中的视图
dbms數(shù)據(jù)庫(kù)管理系統(tǒng)
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學(xué)院的教授曾經(jīng)意識(shí)到,當(dāng)學(xué)生看到朋友的標(biāo)記比他們高時(shí)會(huì)感到難過(guò),這會(huì)對(duì)他們產(chǎn)生負(fù)面影響。 這給了教授一個(gè)想法, 可以在他的學(xué)生學(xué)術(shù)成績(jī)數(shù)據(jù)庫(kù)中創(chuàng)建視圖表 。
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.
在數(shù)據(jù)庫(kù)中, View是一個(gè)虛擬表,它結(jié)合了存儲(chǔ)查詢的結(jié)果集 。 當(dāng)我們想限制某個(gè)用戶訪問(wèn)整個(gè)數(shù)據(jù)庫(kù)時(shí),這一點(diǎn)非常重要。 視圖是動(dòng)態(tài)的,可以根據(jù)數(shù)據(jù)庫(kù)中的數(shù)據(jù)進(jìn)行計(jì)算。 更改表中的數(shù)據(jù)也會(huì)更改視圖中顯示的數(shù)據(jù)。
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.
當(dāng)教授應(yīng)用此技術(shù)時(shí),學(xué)生只能看到自己的標(biāo)記,從而對(duì)學(xué)生產(chǎn)生積極的影響,因?yàn)樗麄儸F(xiàn)在僅與一個(gè)人自己競(jìng)爭(zhēng)。
In a relational database, a view is not the part of a relational schema.
在關(guān)系數(shù)據(jù)庫(kù)中, 視圖不是關(guān)系模式的一部分。
1.創(chuàng)建視圖 (1. Create view)
Syntax to create a view:
創(chuàng)建視圖的語(yǔ)法:
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.
假設(shè)我們必須創(chuàng)建一個(gè)view10的學(xué)生視圖表。
create view view10 select marks from student where rollno = 10;2.放下視圖 (2. Drop View)
Syntax to drop a view:
刪除視圖的語(yǔ)法:
drop view viewname;Example:
例:
If view10 table has to be dropped, the command looks like:
如果必須刪除view10表,則命令如下所示:
drop view view10;DBMS中視圖的優(yōu)點(diǎn) (Advantages of a view in DBMS)
Views can subset the data in a table.
視圖可以將表中的數(shù)據(jù)子集化。
Views can join and simplify the tables in a virtual table.
視圖可以聯(lián)接并簡(jiǎn)化虛擬表中的表。
Views do not require additional storage.
視圖不需要額外的存儲(chǔ)。
Views can hide the complexity of the database and the data the user must hide that.
視圖可以隱藏?cái)?shù)據(jù)庫(kù)的復(fù)雜性以及用戶必須隱藏的數(shù)據(jù)。
Views can act as aggregated tables where aggregated data (sum, average, etc.) are calculated and presented as part of data.
視圖可以用作匯總表,在匯總表中計(jì)算匯總數(shù)據(jù)(總和,平均值等)并將其顯示為數(shù)據(jù)的一部分。
Views can provide additional security from unauthorized users and unauthorized access.
視圖可以為未經(jīng)授權(quán)的用戶和未經(jīng)授權(quán)的訪問(wèn)提供額外的安全性。
DBMS中視圖的缺點(diǎn) (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.
如果從另一個(gè)視圖生成的視圖表中批準(zhǔn)了數(shù)據(jù)庫(kù)視圖,則數(shù)據(jù)庫(kù)視圖可能會(huì)變慢。
翻譯自: https://www.includehelp.com/dbms/views-in-dbms.aspx
dbms數(shù)據(jù)庫(kù)管理系統(tǒng)
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來(lái)咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的dbms数据库管理系统_数据库管理系统(DBMS)中的视图的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: duration java_Java D
- 下一篇: c语言中memcpy函数_带有示例的C中