当前位置:网站首页>MySQL-09
MySQL-09
2022-06-26 05:58:00 【Mr.Rop】
9、 Standardize database design
9.1、 Why design is needed
When the database is complex , It needs to be designed
Bad database design :
data redundancy , Waste space
Database insertion and deletion are troublesome 、 abnormal [ Shielding uses physical foreign keys ]
The performance of the program is poor
Good database design :
- Save memory space
- Ensure the integrity of the database
- It is convenient to develop the system
Software development , About the design of database
- Analyze requirements : Analyze the business and the database needs to be processed
- Outline design : Design diagrams E-R chart
The steps to design a database ( Personal blog ):
- To collect information , Analyze requirements
- User table ( User login and logout , User's personal information , Blogging , Create classification )
- Classification table ( The article classification , Who created )
- Article table ( Information about the article )
- Comment table
- Friend list ( Friend chain information )
- Custom table ( system information , A key word , Or some main fields )key:value
- Tell me about the watch ( Publish your mood … ID … CONTENT … CREATE_TIME)
- Identifying entities ( Implement the requirements to each field )
- Identify the relationship between entities
- Blogging :user- >blog
- Create classification :user->category
- Focus on :user->user
- Friend chain :links
- Comment on :user-user-blog
9.2、 Three paradigms
Why design standardization is needed
- Repetition of information
- Update exception
- Insertion exception
- Unable to display information properly
- Delete exception
- Loss of valid information
Three paradigms ( understand , Written examination may ask )
First normal form (1NF)
Atomicity : Make sure that each column is no longer divisible

Second normal form (2NF)
Premise : Satisfy the first paradigm
Each table only describes one thing

** Third normal form (3NF) **
Premise : Satisfy the first paradigm and the second paradigm
The third paradigm needs to ensure that each column of data in the data table is directly related to the primary key , Not indirectly

Standardize the design of database
Normative and performance The problem of
The associated query cannot have more than three tables
- Consider the needs and goals of commercialization ,( cost , User experience !) Database performance is more important
- When it comes to regulating performance , We need to give due consideration to normalization
- Deliberately add some redundant fields to some tables ( From multi table query to single table query )
- Intentionally add some calculation Columns ( Reduce the amount of data from large to small : Indexes )
边栏推荐
- What management systems (Updates) for things like this
- numpy.random.choice
- The model defined (modified) in pytoch loads some required pre training model parameters and freezes them
- Pytorch (environment, tensorboard, transforms, torchvision, dataloader)
- numpy. random. choice
- Gram matrix
- 小程序如何关联微信小程序二维码,实现二码聚合
- Level signal and differential signal
- On site commissioning - final method of kb4474419 for win7 x64 installation and vs2017 flash back
- Redis底层数据结构
猜你喜欢

Gram matrix

On site commissioning - final method of kb4474419 for win7 x64 installation and vs2017 flash back
Posting - don't get lost in the ocean of Technology

String类学习
转帖——不要迷失在技术的海洋中

Record how to modify the control across threads

操作符的优先级、结合性、是否控制求值顺序【详解】

Pytorch (network model)

小程序如何关联微信小程序二维码,实现二码聚合
![[C language] deep analysis of data storage in memory](/img/2e/ff0b5326d796b9436f4a10c10cfe22.png)
[C language] deep analysis of data storage in memory
随机推荐
Soft power and hard power in program development
Win socket programming (Mengxin initial battle)
COW读写复制机制在Linux,Redis ,文件系统中的应用
A love that never leaves
Written before father's Day
MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications
06. talk about the difference and coding between -is and = = again
C generic speed
Machine learning 07: Interpretation of PCA and its sklearn source code
FindControl的源代码
The most refined language interprets the event dispatcher (also known as the event scheduler)
numpy.log
Definition of Halcon hand eye calibration
How Navicat reuses the current connection information to another computer
Prototype mode, Baa Baa
Something about MariaDB
Posting - don't get lost in the ocean of Technology
Solve the problem that Cmdr cannot use find command under win10
Pre-Sale Analysis
MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications