当前位置:网站首页>Simple and clear, the three paradigms of database design
Simple and clear, the three paradigms of database design
2022-08-04 06:04:00 【Live up to [email protected]】
Paradigm: Simply put, it is to standardize the design of database tables and some specifications that need to be met in order to optimize the way data is stored.
In relational databases these norms can be called paradigms.
First Normal Form
1. Each column attribute is a indivisible attribute value, ensuring the atomicity
of each column2. The attributes of the two columns are similar or similar or same, try to merge columns with the same attributes,Make sure not to generate redundant data.
Example:

If the need is to split the address into provinces and cities,And according to its classification, then obviously the first table is not easy to meet the needs, and does not conform to the first normal form.
After splitting, example:
After splitting, it conforms to the first normal form.
Second Normal Form
Each row of data can only be associated with one of the columns, that is, a row of data does only one thing.
A table split should be split whenever duplication of data occurs in a data column.
Example:
When a person books several rooms at the same time, multiple pieces of data will be generated for one order number, so that the sub-contacts are duplicated, which will cause data redundancy.We should take him apart.
Example:
After splitting, it conforms to the second normal form.
Third Normal Form
Data cannot have transitive relationship, that is, each attribute has a direct relationship with the primary key rather than an indirect relationship.
Such a relationship between attributes like: a–>b–>c does not conform to the third normal form.
Such as Student table (student number, name, age, gender, institution, institution address, institution phone number)
In such a table structure, the above relationship exists.Student ID –> Institution --> (Institution address, institution phone number)
Such a table structure should be disassembled, as follows.
(Student ID, Name, Age, Gender, School) – (School, School Address, School Phone)
版权声明
本文为[Live up to [email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/216/202208040525327395.html
边栏推荐
- ThinkPHP5.0.x 反序列化分析
- TensorFlow2学习笔记:8、tf.keras实现线性回归,Income数据集:受教育年限与收入数据集
- 关系型数据库-MySQL:多实例配置
- 多项式回归(PolynomialFeatures)
- 自动化运维工具Ansible(2)ad-hoc
- 剑指 Offer 2022/7/5
- npm install dependency error npm ERR! code ENOTFOUNDnpm ERR! syscall getaddrinfonpm ERR! errno ENOTFOUND
- TensorFlow2学习笔记:4、第一个神经网模型,鸢尾花分类
- Kubernetes基础入门(完整版)
- 自动化运维工具Ansible(6)Jinja2模板
猜你喜欢
随机推荐
Set集合与Map集合
浏览器中的同源策略
oracle临时表与pg临时表的区别
编程Go:内置打印函数 print、println 和 fmt 包中 fmt.Print、fmt.Println 的区别
postgresql 事务隔离级别与锁
ISCC2021——web部分
sql中group by的用法
(十五)B-Tree树(B-树)与B+树
(五)栈及其应用
CTFshow—Web入门—信息(1-8)
【go语言入门笔记】13、 结构体(struct)
flink onTimer定时器实现定时需求
智能合约安全——delegatecall (2)
二月、三月校招面试复盘总结(一)
MySQL事务详解(事务隔离级别、实现、MVCC、幻读问题)
Zend FrameWork RCE1
ES6 Const Let Var的区别
Postgresql 快照
对象存储-分布式文件系统-MinIO-1:概念
(十二)树--哈夫曼树









