当前位置:网站首页>MySQL——规范数据库设计
MySQL——规范数据库设计
2022-07-03 21:02:00 【Java学不会】
1、为什么需要设计数据库
- 当数据库比较复杂的时候,我们就需要设计
- 糟糕的数据库设计:
- 数据冗余,浪费空间
- 数据库插入和删除都会麻烦(屏蔽使用物理外键)
- 程序的性能差
- 良好的数据库设计:
- 节省空间
- 保证数据库的完成性
- 方便开发系统
- 数据库的设计:
- 分析需求: 分析业务和需求处理的时刻的需求
- 概要设计: 设计关系图E-R图
2、三大范式
为什么需要数据规范化
- 信息重复
- 更新异常
- 插入异常:无法正常显示信息
- 删除异常:丢失有效的信息
2.1、第一范式(1NF)
- 原子性: 保证一列不可再分
2.2、第二范式(2NF)
- 前提: 满足第一范式
- 每张表只描述一件事情
2.3、第三范式(3NF)
- 前提: 满足第一范式和第二范式
- 第三范式需要确保数据表中的没一列数据都和主键直接相关,而不能间接相关。
3、规范性和性能的问题
- 关联查询的表不得超过三张表
- 考虑商业化的需求和目标: 数据库的性能更加重要
- 在规范性能的问题的时候,需要适当的考虑一下
规范性性
- 故意给某些表增加一些冗余的字段。(从多表查询中变为单表查询)
- 故意增加一些计算列(从大数据量降低为小数据的查询,索引)
边栏推荐
- In 2021, the global general crop protection revenue was about $52750 million, and it is expected to reach $64730 million in 2028
- What is the maximum number of concurrent TCP connections for a server? 65535?
- Introduction to golang garbage collection
- [Yugong series] February 2022 Net architecture class 004 ABP vNext used in WPF project
- How can the outside world get values when using nodejs to link MySQL
- 同花顺开户注册安全靠谱吗?有没有风险的?
- For in, foreach, for of
- From the behind the scenes arena of the ice and snow event, see how digital builders can ensure large-scale events
- 设计电商秒杀系统
- 【c】 Digital bomb
猜你喜欢
Borui data and Sina Finance released the 2021 credit card industry development report
JMeter plug-in installation
Basic preprocessing and data enhancement of image data
Qtablewidget control of QT
How to do Taobao full screen rotation code? Taobao rotation tmall full screen rotation code
In 2021, the global revenue of thick film resistors was about $1537.3 million, and it is expected to reach $2118.7 million in 2028
19、 MySQL -- SQL statements and queries
Such as the visual appeal of the live broadcast of NBA Finals, can you still see it like this?
Inventory 2021 | yunyuansheng embracing the road
Study diary: February 14th, 2022
随机推荐
How can the outside world get values when using nodejs to link MySQL
Custom view incomplete to be continued
Refer to some books for the distinction between blocking, non blocking and synchronous asynchronous
Etcd 基于Raft的一致性保证
鹏城杯 WEB_WP
From the behind the scenes arena of the ice and snow event, see how digital builders can ensure large-scale events
Hcie security Day12: supplement the concept of packet filtering and security policy
淺析 Ref-NeRF
It is discussed that the success of Vit lies not in attention. Shiftvit uses the precision of swing transformer to outperform the speed of RESNET
Borui data and Sina Finance released the 2021 credit card industry development report
Single page application architecture
Fingerprint password lock based on Hal Library
Measurement fitting based on Halcon learning -- Practice [1]
2022 safety officer-c certificate examination and safety officer-c certificate registration examination
【愚公系列】2022年7月 Go教学课程 002-Go语言环境安装
Offset related concepts + drag modal box case
What is the maximum number of concurrent TCP connections for a server? 65535?
阻塞非阻塞和同步异步的区分 参考一些书籍
"Designer universe" argument: Data Optimization in the design field ultimately falls on cost, safety and health | chinabrand.com org
Hcie security Day11: preliminarily learn the concepts of firewall dual machine hot standby and vgmp