当前位置:网站首页>Three paradigms of MySQL
Three paradigms of MySQL
2022-06-13 05:33:00 【zrllllll】
Last week , Feeling comfortable in life , The project functions are almost written , Suddenly the senior said he would interview us this week java Basics , All of a sudden, I feel refreshed . Yesterday, I had an interview and the results came out , The following is the senior's evaluation of me 
I forgot a lot about the database , Although usually used in projects , But I still haven't remembered some basic knowledge .
Three paradigms of database :
The concept of paradigm :
Some specifications to follow when designing a database , At present, there are six paradigms of relational database : First normal form (1NF)、 Second normal form (2NF)、 Third normal form (3NF)、 buss - The COD paradigm (BCNF)、 Fourth normal form (4NF) And the fifth paradigm (5NF, Also called perfect paradigm ).
Meeting the first three paradigms can design a more standardized database .
Some specifications to follow when designing a database , At present, there are six paradigms of relational database : First normal form (1NF)、 Second normal form (2NF)、 Third normal form (3NF)、 buss - The COD paradigm (BCNF)、 Fourth normal form (4NF) And the fifth paradigm (5NF, Also called perfect paradigm ).
One 、 First normal form (1NF): No more columns can be split 
Upper figure , There are two sub columns under the major column , Obviously, it does not conform to the first paradigm .

This is in line with the first paradigm .
Two 、 Second normal form (2NF): On the basis of the first paradigm , Non primary key columns are completely dependent on the primary key , Instead of relying on a part of the primary key .
1. Function dependency : If you pass A attribute ( Attribute group ), It's certain that the only B The value of the property , that B Depend on A. For example, the name shown above , Completely dependent on the student id
2. Completely function dependent : If A It's an attribute group , be B The determination of attribute values depends on A All attribute values in the attribute group . Attribute groups refer to multiple fields , So for example, if we want to know a score , You must rely on the two attributes of student number and course name to determine a score , Other attributes cannot determine a certain score
3. Part of the function depends on : If A It's an attribute group , be B The determination of attribute value depends on A Some fields of the attribute group can , For example, the student number and course name are an attribute group , In fact, the student name can be determined only by the student number
4. The transfer function depends on : If A attribute ( Attribute group ), The only one can be determined B The value of the property , Re pass B The value of the attribute can be uniquely determined C The value of the property , For example, a student number determines a department name , A department name corresponds to a dean
5. Primary key : In a table , An attribute or group of attributes , Completely dependent on all other properties , This attribute is called the table of the code , For example, the attribute group composed of student ID and course name in the above figure
1. Function dependency : If you pass A attribute ( Attribute group ), It's certain that the only B The value of the property , that B Depend on A. For example, the name shown above , Completely dependent on the student id
2. Completely function dependent : If A It's an attribute group , be B The determination of attribute values depends on A All attribute values in the attribute group . Attribute groups refer to multiple fields , So for example, if we want to know a score , You must rely on the two attributes of student number and major name to determine a score , Other attributes cannot determine a certain score
3. Part of the function depends on : If A It's an attribute group , be B The determination of attribute value depends on A Some fields of the attribute group can , For example, student ID and major name are an attribute group , In fact, the student name can be determined only by the student number
4. The transfer function depends on : If A attribute ( Attribute group ), The only one can be determined B The value of the property , Re pass B The value of the attribute can be uniquely determined C The value of the property , For example, a student ID determines a major name , A major name corresponds to a major leader .
5. Primary key : In a table , An attribute or group of attributes , Completely dependent on all other properties , This attribute is called the table of the code , For example, the attribute group composed of student ID and major name in the above figure
Simply speaking , The second normal form is to eliminate the partial dependence of non primary keys on primary keys on the basis of the first normal form .
So we can divide the watch into two 

3、 ... and 、 Third normal form (3NF): On the basis of the second paradigm , Non primary key columns only depend on the primary key , Not dependent on other non primary keys .

边栏推荐
- 若依框架=》如何设置导入导出模板全局为文本格式(解决科学计数问题)
- [multithreading] thread pool core class -threadpoolexecutor
- Wang Dao Chapter II linear table exercises
- SQL table columns and statements of database
- Automatic database backup (using Navicat)
- Search DFS and BFS
- 使用cmake交叉编译helloworld
- Mysql database backup and restore:
- Getclassloader() returns null, getclassloader() gets null
- Windbos run command set
猜你喜欢

Information collection for network security (2)

ZABBIX wechat alarm

Listiterator list iterator

Case - recursive factorial (recursive)

Hainan University Postgraduate Entrance Examination electronic information (085400) landing experience

Django uploads local binaries to the database filefield field

JS output uincode code

KVM hot migration for KVM virtual management

C language learning log 1.22

Enhanced for loop
随机推荐
Small project - household income and expenditure software (1)
redis
顶部下滑沉浸式dialog
JS output uincode code
Customer information management system - C language
Mysql database crud operation
Web site learning and sorting
Agile conflicts and benefits
使用cmake交叉編譯helloworld
ZABBIX wechat alarm
C calls the API and parses the returned JSON string
RTSP streaming using easydarwin+ffmpeg
Case - simulated landlords (primary version)
Bm1z002fj-evk-001 startup evaluation
动态规划-最长公共子串
Building Nacos 2 based on docker compose (using MySQL for persistence)
Nonstandard compiler attribute extension
关于匿名内部类
Simple sr: Best Buddy Gans for highly detailed image super resolution Paper Analysis
Case - traversing the directory (file class & recursive call)