当前位置:网站首页>数据库设计及范式讲解
数据库设计及范式讲解
2022-06-11 10:01:00 【不想当个程序员】
数据库复杂就需要设计
糟糕得数据库设计:
- 数据冗余,浪费空间
- 数据库插入和删除都会麻烦、异常【屏蔽使用武力外键】
- 程序得性能差
良好得数据库设计
- 节省内存空间
- 保证数据库得完整性
- 方便我们开发系统
软件开发中,关于数据库得设计
- 分析需求
- 概要设计:E-R图
** 设计数据库得步骤:(个人博客)
- 收集信息,分析需求
- 标识实体(把需求落地到每个字段)
- 标识实体之间的关系
三大范式
为什么需要数据规范化?
- 信息重复
- 更新异常
- 插入异常 :无法正常插入
- 删除异常:
第一范式:原子性,保证每一列不可再分
要求数据库表的每一列都是不可分割的原子数据
第二范式:满足第一范式的前提下,每张表只描述一件事
第三范式:满足第一范式和第二范式的前提下,需要确保数据表中的每一列数据都和主键直接相关,而不能间接相关
规范性和性能的问题:
关联查询的表不得超过三张表
- 考虑商业化的需求和目标,(成本,用户体验!)数据库的性能更加重要
- 在规范性能的问题的时候,需要适当的考虑一下 规范性!
- 故意给某些表增加一些冗余的字段。(从多表查询中变为单表查询)
- 故意增加一些计算列(从大数据量减为小数据量查询:索引)
边栏推荐
- Q1 revenue exceeded expectations. Why did man Bang win headwind growth?
- 面试复习手写题--函数截流与抖动
- ESP8266_ Connect to Alibaba cloud through mqtt protocol
- RSA签名问题
- 整型提升例题
- Beginning simple blog emlog theme template V3
- ZigBee模块通信协议的树形拓扑组网结构
- B站到底能不能赚到钱?
- [Clickhouse column] user initialization of new library role
- JS foundation -- Operator
猜你喜欢

RAC单独修改scanip到不同网段时会报错

Servlet 的初次部署

Q1 revenue exceeded expectations. Why did man Bang win headwind growth?

Vk2c22a/b anti-interference series electric meter, water meter segment code LCD driver chip data (customized dice/cog)

Redis transaction details

基于SSM+Vue+OSS的“依伴汉服”商城设计与开发(含源码+论文+ppt+数据库)

远程工作时代的物联网安全

Product list display

帝国CMS仿《手艺活》DIY手工制作网源码/92kaifa仿手艺活自适应手机版模板

【Objective-C】‘NSAutoreleasePool‘ is unavailable: not available in automatic reference counting mode
随机推荐
GDB debugging common commands
Understanding of the keyword this in JS
科技云报道:Web3.0浪潮下的隐私计算
卸载grid时运行脚本报错Can‘t locate Env.pm in @INC
Function and function of wandfluh proportional valve
C+每日练题(15)
What is the difference between an interface and an abstract class?
Oracle DG physical standby database uses alias data file to change path to OMF path
JS foundation -- Operator
rac expdp导出时报错:ORA-31693、ORA-31617、ORA-19505
Chemical composition of q355hr steel plate
About prototype and prototype chain
有哪些ABAP关键字和语法,到了ABAP云环境上就没办法用了?
ORA-00059 超过db_files限制
What are the application fields of MAG gear pump? To sum up
Oracle XDB组件的重建
Leetcode brushing questions - hand tearing binary tree
What are the functions and functions of the EMG actuator
Finish C language
《1.图书馆里系统》