当前位置:网站首页>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 .

边栏推荐
- 基于 Docker Compose 搭建 Nacos 2(使用 MySQL 进行持久化)
- C language learning log 2.19
- Solution to prompt "permission is required to perform this operation" (file cannot be deleted) when win10 deletes a file
- System file interface open
- Unity game optimization [Second Edition] learning record 6
- MySQL installation, architecture and management
- Building Nacos 2 based on docker compose (using MySQL for persistence)
- Dynamic and static libraries
- [thread / multithread] execution sequence of threads
- Standard input dialog for pyqt5 qinputdialog
猜你喜欢

890. Find and Replace Pattern

About anonymous inner classes

行情绘图课程大纲1-基础知识

Use of natural sorting comparable

Django uses redis to store sessions starting from 0

MySQL transactions and foreign keys

C language learning log 1.22

Small project - household income and expenditure software (2)

Bm1z002fj-evk-001 startup evaluation

ZABBIX proxy, sender (without agent monitoring), performance optimization
随机推荐
Case - simulated landlords (upgraded version)
Building Nacos 2 based on docker compose (using MySQL for persistence)
基于 Docker Compose 搭建 Nacos 2(使用 MySQL 进行持久化)
MySQL built-in functions
powershell优化之一:提示符美化
Course outline of market drawing 1- basic knowledge
Violence enumeration~
JS output uincode code
metaRTC4.0稳定版发布
使用EasyDarwin+FFmpeg实现rtsp推流
Solve the problem of garbled code in the MySQL execution SQL script database in docker (no need to rebuild the container)
About Evaluation Metrics
Quartz database storage
MySQL main query and sub query
Unity游戏优化[第二版]学习记录6
First assessment
Std:: Map initialization
Anaconda configuring the mirror source
Difference between deviation and variance in deep learning
Float type value range