当前位置:网站首页>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 )
边栏推荐
- SQL Server视图
- 卷妹带你学jdbc---2天冲刺Day2
- A love that never leaves
- bingc(继承)
- Explore small program audio and video calls and interactive live broadcast from New Oriental live broadcast
- cross entropy loss = log softmax + nll loss
- 【群内问题学期汇总】初学者的部分参考问题
- DOM document
- Pre-Sale Analysis
- MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications
猜你喜欢

Class and object learning

421- binary tree (226. reversed binary tree, 101. symmetric binary tree, 104. maximum depth of binary tree, 222. number of nodes of complete binary tree)

冒泡排序(Bubble Sort)

Easy to understand from the IDE, and then talk about the applet IDE

Pytorch (network model)

How Navicat reuses the current connection information to another computer

String类学习

REUSE_ALV_GRID_DISPLAY 事件实现(DATA_CHANGED)

状态模式,身随心变

Kolla ansible deploy openstack Yoga version
随机推荐
Sql查询时间段内容
Written before father's Day
Prototype mode, Baa Baa
A new explanation of tcp/ip five layer protocol model
The model defined (modified) in pytoch loads some required pre training model parameters and freezes them
Upgrading technology to art
项目中止
Customize WebService as a proxy to solve the problem of Silverlight calling WebService across domains
cross entropy loss = log softmax + nll loss
Redis underlying data structure
On site commissioning - final method of kb4474419 for win7 x64 installation and vs2017 flash back
kolla-ansible部署openstack yoga版本
Factory method pattern, abstract factory pattern
重载和重写
写在父亲节前
E-commerce seeks growth breakthrough with the help of small program technology
423- binary tree (110. balanced binary tree, 257. all paths of binary tree, 100. same tree, 404. sum of left leaves)
Explore small program audio and video calls and interactive live broadcast from New Oriental live broadcast
Soft power and hard power in program development
操作符的优先级、结合性、是否控制求值顺序【详解】