当前位置:网站首页>On the three paradigms of database design
On the three paradigms of database design
2022-04-23 20:45:00 【Jan York】
My blog https://www.ideaopen.cn/
normal form ?
Namely specification !
* The paradigm is “ A set of relational patterns that conform to a certain level , Indicates the degree of rationalization of the relationship between attributes within a relationship ”. * It's obscure, isn't it ? In fact, you can roughly understand it as the level of some design standard that the table structure of a data table conforms to .
The database paradigm is also divided into 1NF,2NF,3NF,BCNF,4NF,5N
Generally when we design a relational database , At best, consider BCNF
Is enough .
Design that conforms to the higher paradigm , Certainly Conform to the lower paradigm , For example, in line with
2NF
Relationship model of , It must be in line with1NF
.
1NF
- First normal form
Each column of the data table should maintain its atomic properties , That is, columns can no longer be split .
Such as this :
Stock it can also be divided into the quantity of stock , Purchase price and other attributes . So this is not in line with the first paradigm .
2NF
- Second normal form
Second normal form (
2NF
) It's in the first paradigm (1NF
) Based on , That is to meet the second paradigm (2NF
) We must first satisfy the first paradigm (1NF
).
- That is to meet the premise of the first paradigm , When There are multiple primary keys When , That's what happens when it doesn't fit the second paradigm !!!.
- For example, there are two primary keys , There can't be such an attribute , It only depends on one of the primary keys , This is not in line with the second paradigm .
- The popular understanding is that any field only depends on the same field in the table .
rely on
In the data sheet , attribute ( Attribute group )X In certain cases , Can completely exit the attribute Y Depend entirely on X.
Completely dependent on
Complete dependency is for attribute groups , When a set of attributes X Can push it out Y Say when you are Y Depend entirely on X.
Part of it depends on
A set of attributes X One or more of the properties in can deduce Y Just say Y Depend in part on X.
3NF
- Third normal form
First , To meet the third paradigm (3NF
) must First satisfy the second paradigm (2NF
).
in other words , Require a database table It doesn't contain Already included in other tables Non primary key Field .
Three paradigms must be ?
Our three paradigms are general norms . That is to say , It's just that I usually follow this specification .
however !!! It doesn't have to be observed , For example, sometimes , It's not a good thing that data is not redundant . therefore , We need to define , Build on requirements .
No redundant database is not necessarily the best database , Sometimes in order to improve operation efficiency , Improve reading performance , We must lower the standard of paradigm , Keep redundant data in place .
Other paradigms
BCNF
-BC normal form
Relationship model R<U,F> in , If every determinant contains a code , be R<U,F> Belong to BCFN
.
namely :
- All non primary attributes are fully function dependent on each code ;
- All primary attributes are also fully function dependent on each code that does not contain it ;
- No attribute completely depends on any set of non code attributes .
4NF
- Fourth normal form
It is not allowed to have nontrivial and non functional multivalued dependencies between attributes of relational schema .
5NF
- The fifth paradigm
- The fourth paradigm must be satisfied .
- Tables must be decomposable into smaller tables , Unless those tables logically have the same primary key as the original table .
Generally when we design a relational database , At best, consider
BCNF
Is enough .!!!
版权声明
本文为[Jan York]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204232039375929.html
边栏推荐
- Leetcode 709, convert to lowercase
- Solve the Chinese garbled code of URL in JS - decoding
- Install MySQL 5.0 under Linux 64bit 6 - the root password cannot be modified
- vulnhub DC:1渗透笔记
- How many hacking methods do you know?
- 6-5 字符串 - 2. 字符串复制(赋值) (10 分)C语言标准函数库中包括 strcpy 函数,用于字符串复制(赋值)。作为练习,我们自己编写一个功能与之相同的函数。
- DOS command of Intranet penetration
- Flex layout
- UnhandledPromiseRejectionwarning:CastError: Cast to ObjectId failed for value
- MySQL进阶之数据的增删改查(DML)
猜你喜欢
Come in and teach you how to solve the problem of port occupation
Shanghai responded that "flour official website is an illegal website": neglect of operation and maintenance has been "hacked", and the police have filed a case
GO語言開發天天生鮮項目第三天 案例-新聞發布系統二
电脑越用越慢怎么办?文件误删除恢复方法
Elastic box model
Syntax Error: TypeError: this. getOptions is not a function
Rt-1052 learning notes - GPIO architecture analysis
Commande dos pour la pénétration de l'Intranet
上海回應“面粉官網是非法網站”:疏於運維被“黑”,警方已立案
Solution: NPM err! code ELIFECYCLE npm ERR! errno 1
随机推荐
LeetCode 542、01 矩阵
SQL: query duplicate data and delete duplicate data
The problem of 1 pixel border on the mobile terminal
Unity ECS dots notes
BMP JPEG picture to vector image contourtrace
Leetcode 542, 01 matrix
Rt-1052 learning notes - GPIO architecture analysis
Imitation Baidu map realizes the three buttons to switch the map mode by automatically shrinking the bottom
MySQL基础合集
Commande dos pour la pénétration de l'Intranet
LeetCode 74、搜索二维矩阵
JS arrow function user and processing method of converting arrow function into ordinary function
内网渗透之DOS命令
2021-09-02 unity project uses rider to build hot change project failure record of ilruntime
黑客的入侵方式你知道几种?
Create vs project with MATLAB
MySQL进阶之数据的增删改查(DML)
Identifier CV is not defined in opencv4_ CAP_ PROP_ FPS; CV_ CAP_ PROP_ FRAME_ COUNT; CV_ CAP_ PROP_ POS_ Frames problem
Preliminary understanding of cache elimination algorithm (LRU and LFU)
Leetcode 20. Valid parentheses