數據庫數據規范化看不懂_數據庫管理系統中的規范化

數據庫數據規范化看不懂

DBMS中的規范化 (Normalization in DBMS)

Every table must have a single idea. The method by which we divide tables approximately is called normalization and the rest used for normalization is a functional dependency. For the normalization process, every column in a table will have a unique name. Order of rows and columns are insignificant and every cell will contain single or atomic values. Every table will contain a primary key and the value of the primary key cannot be null.

每個表都必須有一個主意。 我們大致劃分表的方法稱為規范化,而其余用于規范化的方法則是功能相關性。 對于規范化過程,表中的每一列都將具有唯一的名稱。 行和列的順序無關緊要,每個單元格將包含單個或原子值。 每個表都將包含一個主鍵,并且主鍵的值不能為null。

Because of normalization number of tables in the database increase because of which excess become slow and query retrieval time increases in that cases, we must be in the position to combine decomposed table to get back the parent table. this process is called denormalization.

在這種情況下,由于數據庫中表的規范化數量增加,從而導致多余的速度變慢并且查詢檢索時間增加,因此我們必須處于組合分解表的位置才能返回父表。 此過程稱為非規范化。

DBMS中的規范化表單的類型 (Types of Normalization form in DBMS)

1) First Normalization form

1)第一個規范化表格

A relational schema R is said to be in first normal form if every cell in the row contains atomic values. It means first normal form does not allow composite or multivalued attributes. A table in first normal form will always have exactly one primary key (null value is not allowed in primary key). It always we assumed that if we have a proper relational table than it will always be in first normal form.

如果行中的每個單元格都包含原子值,則關系模式R被稱為第一范式。 這意味著第一個范式不允許使用復合或多值屬性。 第一個標準格式的表將始終僅具有一個主鍵(主鍵中不允許使用空值)。 我們總是假設,如果我們有一個適當的關系表,那么它將始終處于第一范式。

2) Second Normalization form

2)第二標準化表格

A table is said to in second normal form if it is first normal form and there must not be exist any partial dependency.

如果表是第一范式并且不能存在任何部分依賴關系,則稱該表為第二范式。

Partial dependency

部分依賴

If a non-prime attribute instead of depending on the entire candidate key depends on its subset than this is the partial dependency (from prime to non-prime).a attribute is called prime attribute if it is the part of any candidate key.

如果非素數屬性不是部分依賴項(從素數到非素數),而不是依賴于整個候選鍵的子集,那么它是部分依賴項。如果該屬性是任何候選鍵的一部分,則稱為素數屬性。

If a table is not in second normal form than construct first table for the candidate key only those attribute will come which totally depend on the key and then for every partial dependency we have a separate table.

如果一個表不是第二范式,而不是為候選鍵構造第一個表,則只有那些完全依賴于鍵的屬性才會出現,然后對于每個部分依賴項,我們都有一個單獨的表。

3) Third Normalization form

3)第三規范化形式

A relational table is said third normal form when it is in first normal form and there exit no transitive dependency.

當關系表處于第一范式并且不存在傳遞依存關系時,則稱為第三范式。

A relational schema is said to be in third normal form if every dependency from A → B either A is a superkey or a prime attribute.

如果從A→B的每個依賴關系(無論A是超鍵還是素數屬性),則關系模式都稱為第三范式。

Example- R (ABC) B → C

示例-R(ABC)B→C

Here, A is a prime attribute and BC are the non-prime attribute here dependency from B to C is transitive as one non-prime is finding another non-prime. Here if B gets null values at runtime then we cannot identify C.

在這里, A是素數屬性,而BC是非素數屬性,這里從BC的依賴關系是可傳遞的,因為一個非素數正在找到另一個非素數。 在這里,如果B在運行時獲得空值,則我們無法識別C。

4) Boyce-Codd Normalization form (BCNF)

4)Boyce-Codd規范化表格(BCNF)

A relational table is said to be in BCNF normal form if for dependency from A to B and A must be a super key.

如果從A到B的依賴關系以及A必須是超級鍵,則關系表被稱為BCNF范式。

查找關系的最高范式的步驟 (Steps to find the highest normal form of a relation)

  1. First of all, find the entire possible candidate key in the given relation.

    首先,找到給定關系中的所有可能的候選鍵。

  2. Divide all given attribute into two categories one is prime and other one is non-prime attributes.

    將所有給定屬性分為兩類,一類是質數,另一類是非質數屬性。

  3. Firstly check for the first normal form then second normal form and so on if we fail to satisfy nth normal form than the highest normal form will be n-1.

    首先檢查第一個范式,然后檢查第二個范式,依此類推,如果我們不滿足第n個范式,則最高范式將為n-1。

數據庫管理系統異常 (Anomalies in Database Management System)

There are different types of anomalies which can occur in referencing and the referenced relation which we will discuss with the help of an example,

在引用和引用的關系中可能會發生不同類型的異常,我們將借助一個示例來進行討論,

EnameSsnDnumberDnameDmgrssn
Smith12345Research3334
Wong33345Research3334
Zeloya99984Admin9876
Wallace98764Admin9876
Jabbar98794Admin9876
n 編號 姓名 Dmgrssn
史密斯 1234 5 研究 3334
3334 5 研究 3334
Zeloya 9998 4 管理員 9876
華萊士 9876 4 管理員 9876
賈巴爾 9879 4 管理員 9876

Insertion Anomalies

插入異常

If we need to insert a new employee with no department assigned yet, we need to enter null values. We cannot insert a new department with no employees working on it on SSN= null write not be valid, a primary key cannot be null.

如果需要插入尚未分配部門的新員工,則需要輸入空值。 我們不能插入沒有員工在SSN上工作的新部門=空寫入無效,主鍵不能為空。

Deletion Anomalies

刪除異常

If we delete last working employee of the department, the information regarding department will be lost.

如果我們刪除部門的最后一名工作人員,則有關部門的信息將丟失。

Modification anomalies

修改異常

If we change the 'depart_mgr' of dept 5 we must update the tuples of all employees who work that department otherwise database will be inconsistent.

如果我們更改部門5的'depart_mgr',則必須更新在該部門工作的所有員工的元組,否則數據庫將不一致。

翻譯自: https://www.includehelp.com/dbms/normalization-in-database-management-system.aspx

數據庫數據規范化看不懂

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/541690.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/541690.shtml
英文地址,請注明出處:http://en.pswp.cn/news/541690.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

c 語言開發一個四則運算器,C++實現四則運算器(無括號)

本文實例為大家分享了C實現無括號的四則運算器的具體代碼,供大家參考,具體內容如下完成度更高的帶括號版本可以看C實現四則運算器(帶括號)對于無括號的計算器,實現起來比較容易,下面讓我們一步步實現。舉例首先明確需要實現怎樣的…

iOS開發之解決系統數字鍵盤無文字時delete鍵無法監聽的技巧

最近在做用戶登錄獲取驗證碼時添加圖形驗證碼功能,就是只有正確輸入圖形驗證碼才能收到后臺發送的短信驗證碼。效果如下: 看起來雖然是個小功能,但是實際操作起來,會發現蘋果給我們留下的坑,當然更多的是自己給自己挖的…

c ++查找字符串_C ++結構| 查找輸出程序| 套裝1

c 查找字符串Program 1: 程序1&#xff1a; #include <iostream>#include <math.h>using namespace std;struct st {int A NULL;int B abs(EOF EOF);} S;int main(){cout << S.A << " " << S.B;return 0;}Output: 輸出&#xff1a…

二級c語言加油,二級C語言 備考指南及常見問題(2013版)

該樓層疑似違規已被系統折疊 隱藏此樓查看此樓3、關于上機操作部分的復習最好買一本上機題庫方面的教材&#xff0c;或打印、閱讀南開百題之類的電子文檔。配合上機模擬軟件(無紙化考試軟件)&#xff0c;上機練習是必須的。上機軟件一般有100套題多一點&#xff0c;每套有程序填…

開放定址散列表

再散列之后散列函數要重新計算。 // kaifangliaobiao.cpp : 定義控制臺應用程序的入口點。 //使用平方探測解決沖突問題時&#xff0c;散列表至少空一半時&#xff0c;總能插入一個新的元素#include "stdafx.h" #include<iostream> using namespace std;#ifnde…

合并兩個鏈表數據結構c語言,合并兩個鏈表.

該樓層疑似違規已被系統折疊 隱藏此樓查看此樓#include #define N1 10#define N2 10struct list{int date ;struct list *next;};main(){struct list *p1,*p2,*p3,*p4,*head,*head1,*head2,*p;int n0;head1head2NULL;p1p2(struct list *)malloc(sizeof(struct list));p1->da…

c ++查找字符串_C ++結構| 查找輸出程序| 套裝2

c 查找字符串Program 1: 程序1&#xff1a; #include <iostream>using namespace std;int main(){typedef struct{int A;char* STR;} S;S ob { 10, "india" };S* ptr;ptr &ob;cout << ptr->A << " " << ptr->STR[2];…

連接fiddler后手機無法顯示無網絡

升級了fiddler到4.6版本&#xff0c;手機設置代理后提示無網絡&#xff0c;試試以下解決方法&#xff1a; 1.fiddler升級后對應的.net framework也要升級&#xff0c;安裝最新的.net framework 4.6&#xff0c;升級安裝后&#xff0c;可以正確抓包啦 2.如果上述方法無效&#x…

android 人臉解鎖 鎖屏動畫,人臉保護鎖(人臉識別鎖屏)

這是一款十分炫酷的鎖屏工具&#xff0c;還記得電影中的特工所用的人臉識別鎖嗎&#xff1f;這款應用也能讓你過過癮&#xff01;人臉識別鎖屏安卓版是一款用人臉做密碼來打開手機屏保鎖的一個APP。不僅可以作屏保鎖&#xff0c;也可以單獨保護某些重要程序不被偷窺,例如查看短…

dbms_排名前50位的DBMS面試問答

dbms1) What are the drawbacks of the file system which is overcome on the database management system? 1)在數據庫管理系統上克服的文件系統有哪些缺點&#xff1f; Ans: Data redundancy & isolation, difficulty in accessing data, data isolation, and integri…

linux時間

CST代表中國標準時間rtc實時時鐘linux主要有兩種時間硬件時鐘 clock系統時鐘 date修改時間 date 03300924必須是兩位或者 date -s 2017:03:30將系統時間同步到硬件時間 hwclock -w將硬件時間同步到系統時間 hwclock -s轉載于:https://blog.51cto.com/12372297/1911608

查找Python中給定字符串的所有排列

Python itertools Module Python itertools模塊 "itertools" are an inbuilt module in Python which is a collection of tools for handling iterators. It is the most useful module of Python. Here, a string is provided by the user and we have to print a…

android 圖片疊加xml,Android實現圖片疊加效果的兩種方法

本文實例講述了Android實現圖片疊加效果的兩種方法。&#xff0c;具體如下&#xff1a;效果圖&#xff1a;第一種&#xff1a;第二種&#xff1a;第一種是通過canvas畫出來的效果:public void first(View v) {// 防止出現Immutable bitmap passed to Canvas constructor錯誤Bit…

Win10系列:VC++ 定時器

計時器機制俗稱"心跳"&#xff0c;表示以特定的頻率持續觸發特定事件和執行特定程序的機制。在開發Windows應用商店應用的過程中&#xff0c;可以使用定義在Windows::UI::Xaml命名空間中的DispatcherTimer類來創建計時器。DispatcherTimer類包含了如下的成員&#xf…

dbms系統 rdbms_DBMS與傳統文件系統之間的區別

dbms系統 rdbmsIntroduction 介紹 DBMS and Traditional file system have some advantages, disadvantages, applications, functions, features, components and uses. So, in this article, we will discuss these differences, advantages, disadvantages and many other …

android 百度地圖api密鑰,Android百度地圖開發獲取秘鑰之SHA1

最近在做一個關于百度地圖的開發。不過在正式開發之前還必須要在百度地圖API官網里先申請秘鑰&#xff0c;而在申請秘鑰的過程中&#xff0c;就需要獲取一個所謂的SHA1值。如上所示&#xff0c;但是由于不是正式開發&#xff0c;所以以上的發布版和開發版的SHA1可以先填寫相同。…

單位矩陣的逆| 使用Python的線性代數

Prerequisites: 先決條件&#xff1a; Defining a Matrix 定義矩陣 Identity Matrix 身份矩陣 There are matrices whose inverse is the same as the matrices and one of those matrices is the identity matrix. 有些矩陣的逆與矩陣相同&#xff0c;并且這些矩陣之一是單位…

華為榮耀七能升級鴻蒙系統嗎,華為鴻蒙系統來了,你知道哪些華為手機榮耀手機可以升級嗎?...

從鴻蒙系統第一次開始登場&#xff0c;到現在慢慢有許多鴻蒙系統設備出現&#xff0c;手機市場的格局似乎又要升級變化了。科技樹兒了解到&#xff0c;在某數碼博主經過和相關人員的溝通核實之后&#xff0c;目前暫定的是搭載華為麒麟710芯片以上的機型&#xff0c;無論華為或榮…

day5-shutil模塊

一、簡述 我們在日常處理文件時&#xff0c;經常用到os模塊&#xff0c;但是有的時候你會發現&#xff0c;像拷貝、刪除、打包、壓縮等文件操作&#xff0c;在os模塊中沒有對應的函數去操作&#xff0c;下面我們就來講講高級的 文件、文件夾、壓縮包 處理模塊&#xff1a;shuti…

matlab中now函數_now()方法以及JavaScript中的示例

matlab中now函數JavaScript now()方法 (JavaScript now() method) now() method is a Date class method, it is used to current time in milliseconds, it returns the total number of milliseconds since 01st January 1970, 00:00:00 UTC. now()方法是Date類的一種方法&am…