数据库范式4nf什么意思

In this tutorial we will learn about the 1st(First) Normal Form which is more like the Step 1 of the Normalization process. The 1st Normal form expects you to design your table in such a way that it can easily be extended and it is easier for you to retrieve data from it whenever required.

在本教程中,我们将学习第一(第一)范式,它更像是“归一化”过程的步骤1。 1st Normal表单希望您以易于扩展的方式设计表,并在需要时更轻松地从中检索数据。

In our last tutorial we learned and understood how data redundancy or repetition can lead to several issues like Insertion, Deletion and Updation anomalies and how Normalization can reduce data redundancy and make the data more meaningful.

在上一教程中,我们了解并理解了数据冗余或重复如何导致诸如插入,删除和更新异常之类的若干问题,以及规范化如何减少数据冗余并使数据更有意义。

演示地址

bad database design.错误的数据库设计

第一个范式的规则 (Rules for First Normal Form)

The first normal form expects you to follow a few simple rules while designing your database, and they are:

第一个范式期望您在设计数据库时遵循一些简单的规则,它们是:

规则1:单值属性 (Rule 1: Single Valued Attributes)

Each column of your table should be single valued which means they should not contain multiple values. We will explain this with help of an example later, let's see the other rules for now.

表的每一列应为单值,这意味着它们不应包含多个值。 我们将在后面的示例中对此进行解释,现在让我们看看其他规则。

规则2:属性域不应更改 (Rule 2: Attribute Domain should not change)

This is more of a "Common Sense" rule. In each column the values stored must be of the same kind or type.

这更多是“常识”规则。 在每一列中,存储的值必须具有相同的种类或类型。

For example: If you have a column dob to save date of births of a set of people, then you cannot or you must not save 'names' of some of them in that column along with 'date of birth' of others in that column. It should hold only 'date of birth' for all the records/rows.

例如:如果你有一列dob保存一组人,那么你就不能或者你不能在该列保存的一些人的名字“在该列别人的“出生日期”沿的出生日期。 所有记录/行都应仅保留“出生日期”。

规则3:属性/列的唯一名称 (Rule 3: Unique name for Attributes/Columns)

This rule expects that each column in a table should have a unique name. This is to avoid confusion at the time of retrieving data or performing any other operation on the stored data.

该规则要求表中的每一列都应具有唯一的名称。 这是为了避免在检索数据或对存储的数据执行任何其他操作时造成混乱。

If one or more columns have same name, then the DBMS system will be left confused.

如果一个或多个列具有相同的名称,那么DBMS系统将被混淆。

规则4:顺序无关紧要 (Rule 4: Order doesn't matters)

This rule says that the order in which you store the data in your table doesn't matter.

该规则表明,在表中存储数据的顺序无关紧要。

实例时间 (Time for an Example)

Although all the rules are self explanatory still let's take an example where we will create a table to store student data which will have student's roll no., their name and the name of subjects they have opted for.

尽管所有规则都是不言自明的,但还是让我们以一个示例为例,在该示例中,我们将创建一个表来存储学生数据,其中将包含学生卷名,他们的姓名和他们选择的学科名称。

Here is our table, with some sample data added to it.

这是我们的表,其中添加了一些示例数据。

roll_no name subject
101 Akon OS, CN
103 Ckon Java
102 Bkon C, C++
roll_no 名称 学科
101 阿Kong 操作系统,CN
103 Java
102 布Kong C,C ++

Our table already satisfies 3 rules out of the 4 rules, as all our column names are unique, we have stored data in the order we wanted to and we have not inter-mixed different type of data in columns.

我们的表已经满足了4条规则中的3条规则,因为我们所有的列名都是唯一的,我们已经按照想要的顺序存储了数据,并且没有在列中混合使用不同类型的数据。

But out of the 3 different students in our table, 2 have opted for more than 1 subject. And we have stored the subject names in a single column. But as per the 1st Normal form each column must contain atomic value.

但是在我们表中的3名不同的学生中,有2名选择了超过1门科目。 并且我们将主题名称存储在单个列中。 但是按照第一范式的形式,每一列都必须包含原子值。

如何解决这个问题呢? (How to solve this Problem?)

It's very simple, because all we have to do is break the values into atomic values.

这很简单,因为我们要做的就是将这些值分解为原子值。

Here is our updated table and it now satisfies the First Normal Form.

这是我们更新的表格,现在满足第一范式。

roll_no name subject
101 Akon OS
101 Akon CN
103 Ckon Java
102 Bkon C
102 Bkon C++
roll_no 名称 学科
101 阿Kong 操作系统
101 阿Kong CN
103 Java
102 布Kong C
102 布Kong C ++

By doing so, although a few values are getting repeated but values for the subject column are now atomic for each record/row.

这样,尽管一些值被重复,但是对于每个记录/行, subject列的值现在都是原子的。

Using the First Normal Form, data redundancy increases, as there will be many columns with same data in multiple rows but each row as a whole will be unique.

使用“第一范式”,数据冗余增加,因为在多行中将有许多列具有相同的数据,但整体上每一行都是唯一的。

翻译自: https://www.studytonight.com/dbms/first-normal-form.php

数据库范式4nf什么意思

数据库范式4nf什么意思_什么是第一范式(1NF)?相关推荐

  1. 数据库范式5nf_第四范式(4NF)| 数据库管理系统

    数据库范式5nf Fourth normal form (4NF) is a normal form used in database normalization, in which there ar ...

  2. 从第一范式(2nf)到第二范式(3nf)_啥是数据库范式

    前言: 关于数据库范式,时常有听说过,一直没有详细去了解.一般数据库书籍或数据库课程会介绍范式相关内容,范式也经常出现在数据库考试题目中.不清楚你是否对范式有比较清晰的了解呢?本篇文章我们一起来学习下 ...

  3. mysql三大范式和反范式_数据库范式:三大范式、BC范式和反范式化

    一.什么是数据库范式 无规矩不成方圆,同理范式是数据表设计的一些约束和规范.为了让各个属性间的关系更加合理,减少数据冗余. 一般来说,主要满足 3NF 就可以了,因为范式过高,虽然对数据关系有更好的约 ...

  4. 什么是数据库范式(NF)?从一范式到五范式分别是什么?

    什么是数据库范式(NF)?从一范式到五范式分别是什么? 什么是数据库范式(NF)? 为了建立冗余较小.结构合理的数据库,设计数据库时必须遵循一定的规则.在关系型数据库中这种规则就称为范式.范式是符合某 ...

  5. 【转载】数据库范式那些事

    数据库范式那些事 简介 数据库范式在数据库设计中的地位一直很暧昧,教科书中对于数据库范式倒是都给出了学术性的定义,但实际应用中范式的应用却不甚乐观,这篇文章会用简单的语言和一个简单的数据库DEMO将一 ...

  6. 数据库范式 1NF, 2NF, 3NF的问题与细解

    转自https://www.jianshu.com/p/94a274ef35a9 一. 关于数据冗余与异常 数据库的规范化 数据库规范化是一种在数据库中组织数据的技术. 规范化是消除冗余(重复)和不良 ...

  7. 数据库范式:1NF、2NF、3NF、BCNF

    首先要明白"范式(NF)"是什么意思.按照教材中的定义,范式是"符合某一种级别的关系模式的集合,表示一个关系内部各属性之间的联系的合理化程度".很晦涩吧?实际上 ...

  8. 数据库范式5nf_第五范式(5NF)| 数据库管理系统

    数据库范式5nf Fifth normal form (5NF) is also known as project-join normal form (PJ/NF). It is designed t ...

  9. oracle 第一范式,数据库范式之第一范式

    数据库范式(Database Normalization) 设计关系数据库时,遵从不同的规范要求,设计出合理的关系型数据库,这些不同的规范要求被称为不同的范式,各种范式呈递次规范,越高的范式数据库冗余 ...

最新文章

  1. 【Kaggle Learn】Python 5-8
  2. R语言系统自带及附属包开元可用数据集汇总
  3. 报错: eclipse加载maven工程提示pom.xml无法解析org.apache.maven.plugins:maven-resources-plugin:2.3.2...
  4. tomcat 启动时 Initializing Spring root WebApplicationContext停止启动
  5. 深究angularJS——(上传)FileUploader中文翻译
  6. python与rpc服务
  7. CAM350 10.7 中文界面
  8. 734. [网络流24题] 方格取数问题 二分图点权最大独立集/最小割/最大流
  9. oracle设置控制文件多路径,【备份恢复】 控制文件多路径
  10. 接口测试时,输入所有参数的参数值后,接口返回“参数错误:所有参数都不能为空”
  11. 在职场,没有永远的朋友,也没有永远的敌人,因为只有利益
  12. 蓝桥杯 ALGO-81 算法训练 动态数组使用
  13. Tableau上面地图与条形图结合_Tableau | 20种常用图表(上文)
  14. ARToolkit介绍
  15. 用了这些浏览器插件,让你的科研效率飞起
  16. DIV 内容上下居中
  17. Elasticsearch Cat 命令
  18. 处理Nginx返回octet-stream数据流的配置
  19. IDEA springboot 项目启动报错 Shorten the command line via JAR manifest or via a classpath file and rerun
  20. 人脸识别之insightface开源代码使用——自定义数据集制作

热门文章

  1. Exceptional C++读书笔记:编译器防火墙与Pimpl惯用法(一)
  2. 在VS中关于boost::geometry图形开发库的几何图形可视化插件(Graphical Debugging)
  3. 3G时代:什么是中国移动不能承受之重
  4. 搭建私有云:OwnCloud
  5. 泓博医药在创业板上市:市值超过37亿元,预计全年增收不增利
  6. 第一财经周刊:互联网公司正在瓦解传统广告业
  7. 叶梓老师 人工智能兼职讲师之深度学习《计算机视觉的深度学习实践》
  8. flex布局详解(配图-简洁易懂)
  9. LIMS实验室管理平台——校园实验教育智能化管理工具
  10. 如何修改git空文件夹的错误