当前位置:网站首页>MySQL——规范数据库设计
MySQL——规范数据库设计
2022-07-03 21:02:00 【Java学不会】
1、为什么需要设计数据库
- 当数据库比较复杂的时候,我们就需要设计
- 糟糕的数据库设计:
- 数据冗余,浪费空间
- 数据库插入和删除都会麻烦(屏蔽使用物理外键)
- 程序的性能差
- 良好的数据库设计:
- 节省空间
- 保证数据库的完成性
- 方便开发系统
- 数据库的设计:
- 分析需求: 分析业务和需求处理的时刻的需求
- 概要设计: 设计关系图E-R图
2、三大范式
为什么需要数据规范化
- 信息重复
- 更新异常
- 插入异常:无法正常显示信息
- 删除异常:丢失有效的信息
2.1、第一范式(1NF)
- 原子性: 保证一列不可再分
2.2、第二范式(2NF)
- 前提: 满足第一范式
- 每张表只描述一件事情
2.3、第三范式(3NF)
- 前提: 满足第一范式和第二范式
- 第三范式需要确保数据表中的没一列数据都和主键直接相关,而不能间接相关。
3、规范性和性能的问题
- 关联查询的表不得超过三张表
- 考虑商业化的需求和目标: 数据库的性能更加重要
- 在规范性能的问题的时候,需要适当的考虑一下
规范性性 - 故意给某些表增加一些冗余的字段。(从多表查询中变为单表查询)
- 故意增加一些计算列(从大数据量降低为小数据的查询,索引)
边栏推荐
- 2166. Design bit set
- Pengcheng cup Web_ WP
- 19、 MySQL -- SQL statements and queries
- C 10 new feature [caller parameter expression] solves my confusion seven years ago
- Do you really know how old you are?
- Sightseeing - statistics of the number of shortest paths + state transfer + secondary small paths
- Talk about daily newspaper design - how to write a daily newspaper and what is the use of a daily newspaper?
- Reinforcement learning - learning notes 1 | basic concepts
- Basic preprocessing and data enhancement of image data
- 淺析 Ref-NeRF
猜你喜欢

Nmap and masscan have their own advantages and disadvantages. The basic commands are often mixed to increase output

String and+
![Measurement fitting based on Halcon learning -- Practice [1]](/img/71/9f6c27aa89035b2550bdb0ac902045.jpg)
Measurement fitting based on Halcon learning -- Practice [1]

Line segment tree blue book explanation + classic example acwing 1275 Maximum number

Reinforcement learning - learning notes 1 | basic concepts

In 2021, the global revenue of syphilis rapid detection kits was about US $608.1 million, and it is expected to reach US $712.9 million in 2028

LabVIEW training

How can the outside world get values when using nodejs to link MySQL
![Capture de paquets et tri du contenu externe - - autoresponder, composer, statistiques [3]](/img/bf/ac3ba04c48e80b2d4f9c13894a4984.png)
Capture de paquets et tri du contenu externe - - autoresponder, composer, statistiques [3]

APEC industry +: father of the king of the ox mill, industrial Internet "king of the ox mill anti-wear faction" Valentine's Day greetings | Asia Pacific Economic media | ChinaBrand
随机推荐
Offset related concepts + drag modal box case
Use nodejs+express+mongodb to complete the data persistence project (with modified source code)
Producer consumer mode (multithreading, use of shared resources)
Qt6 QML Book/Qt Quick 3D/基础知识
JS three families
内存分析器 (MAT)
How can the outside world get values when using nodejs to link MySQL
Basic number theory -- Chinese remainder theorem
Hcie security Day10: six experiments to understand VRRP and reliability
Capture de paquets et tri du contenu externe - - autoresponder, composer, statistiques [3]
上周内容回顾
Discussion Net legacy application transformation
浅议.NET遗留应用改造
Refer to some books for the distinction between blocking, non blocking and synchronous asynchronous
JVM JNI and PVM pybind11 mass data transmission and optimization
你真的知道自己多大了吗?
Pengcheng cup Web_ WP
Summary of common operation and maintenance commands
[gd32l233c-start] 5. FLASH read / write - use internal flash to store data
Node MySQL serialize cannot rollback transactions