当前位置:网站首页>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 .
边栏推荐
- Customer information management system - C language
- MySQL basic query
- 【转载】C语言内存和字符操作函数大全
- Listiterator list iterator
- Deleted the jupyter notebook in the jupyter interface by mistake
- MySQL log management and master-slave replication
- Case - traversing the directory (file class & recursive call)
- How to Algorithm Evaluation Methods
- Pyqt5 controls qpixmap, qlineedit qsplitter, qcombobox
- 【多线程编程】Future接口获取线程执行结果数据
猜你喜欢
Simple-SR:Best-Buddy GANs for Highly Detailed Image Super-Resolution論文淺析
One of PowerShell optimizations: prompt beautification
Pycharm错误解决:Process finished with exit code -1073741819 (0xC0000005)
890. Find and Replace Pattern
Binary search and binary answer
ZABBIX wechat alarm
使用EasyDarwin+FFmpeg实现rtsp推流
Case - simulated landlords (upgraded version)
SQL table columns and statements of database
priority inversion problem
随机推荐
ZABBIX wechat alarm
powershell优化之一:提示符美化
redis
BM1Z002FJ-EVK-001开机测评
KVM hot migration for KVM virtual management
Standard input dialog for pyqt5 qinputdialog
Bicolor case
Problems encountered in the use of PgSQL
Windbos common CMD (DOS) command set
MySQL log management and master-slave replication
MySQL installation, architecture and management
Mysql database crud operation
Input a number and output each digit from high to low
Compilation croisée helloworld avec cmake
Modification and analysis of libcoap source code by Hongmeng device discovery module
Small project - household income and expenditure software (2)
Introduction to R language 4--- R language process control
One of PowerShell optimizations: prompt beautification
metaRTC4.0稳定版发布
priority inversion problem