数据库数据规范化看不懂_数据库管理系统中的规范化

数据库数据规范化看不懂

DBMS中的规范化 (Normalization in DBMS)

Every table must have a single idea. The method by which we divide tables approximately is called normalization and the rest used for normalization is a functional dependency. For the normalization process, every column in a table will have a unique name. Order of rows and columns are insignificant and every cell will contain single or atomic values. Every table will contain a primary key and the value of the primary key cannot be null.

每个表都必须有一个主意。 我们大致划分表的方法称为规范化,而其余用于规范化的方法则是功能相关性。 对于规范化过程,表中的每一列都将具有唯一的名称。 行和列的顺序无关紧要,每个单元格将包含单个或原子值。 每个表都将包含一个主键,并且主键的值不能为null。

Because of normalization number of tables in the database increase because of which excess become slow and query retrieval time increases in that cases, we must be in the position to combine decomposed table to get back the parent table. this process is called denormalization.

在这种情况下,由于数据库中表的规范化数量增加,从而导致多余的速度变慢并且查询检索时间增加,因此我们必须处于组合分解表的位置才能返回父表。 此过程称为非规范化。

DBMS中的规范化表单的类型 (Types of Normalization form in DBMS)

1) First Normalization form

1)第一个规范化表格

A relational schema R is said to be in first normal form if every cell in the row contains atomic values. It means first normal form does not allow composite or multivalued attributes. A table in first normal form will always have exactly one primary key (null value is not allowed in primary key). It always we assumed that if we have a proper relational table than it will always be in first normal form.

如果行中的每个单元格都包含原子值,则关系模式R被称为第一范式。 这意味着第一个范式不允许使用复合或多值属性。 第一个标准格式的表将始终仅具有一个主键(主键中不允许使用空值)。 我们总是假设,如果我们有一个适当的关系表,那么它将始终处于第一范式。

2) Second Normalization form

2)第二标准化表格

A table is said to in second normal form if it is first normal form and there must not be exist any partial dependency.

如果表是第一范式并且不能存在任何部分依赖关系,则称该表为第二范式。

Partial dependency

部分依赖

If a non-prime attribute instead of depending on the entire candidate key depends on its subset than this is the partial dependency (from prime to non-prime).a attribute is called prime attribute if it is the part of any candidate key.

如果非素数属性不是部分依赖项(从素数到非素数),而不是依赖于整个候选键的子集,那么它是部分依赖项。如果该属性是任何候选键的一部分,则称为素数属性。

If a table is not in second normal form than construct first table for the candidate key only those attribute will come which totally depend on the key and then for every partial dependency we have a separate table.

如果一个表不是第二范式,而不是为候选键构造第一个表,则只有那些完全依赖于键的属性才会出现,然后对于每个部分依赖项,我们都有一个单独的表。

3) Third Normalization form

3)第三规范化形式

A relational table is said third normal form when it is in first normal form and there exit no transitive dependency.

当关系表处于第一范式并且不存在传递依存关系时,则称为第三范式。

A relational schema is said to be in third normal form if every dependency from A → B either A is a superkey or a prime attribute.

如果从A→B的每个依赖关系(无论A是超键还是素数属性),则关系模式都称为第三范式。

Example- R (ABC) B → C

示例-R(ABC)B→C

Here, A is a prime attribute and BC are the non-prime attribute here dependency from B to C is transitive as one non-prime is finding another non-prime. Here if B gets null values at runtime then we cannot identify C.

在这里, A是素数属性,而BC是非素数属性,这里从BC的依赖关系是可传递的,因为一个非素数正在找到另一个非素数。 在这里,如果B在运行时获得空值,则我们无法识别C。

4) Boyce-Codd Normalization form (BCNF)

4)Boyce-Codd规范化表格(BCNF)

A relational table is said to be in BCNF normal form if for dependency from A to B and A must be a super key.

如果从A到B的依赖关系以及A必须是超级键,则关系表被称为BCNF范式。

查找关系的最高范式的步骤 (Steps to find the highest normal form of a relation)

  1. First of all, find the entire possible candidate key in the given relation.

    首先,找到给定关系中的所有可能的候选键。

  2. Divide all given attribute into two categories one is prime and other one is non-prime attributes.

    将所有给定属性分为两类,一类是质数,另一类是非质数属性。

  3. Firstly check for the first normal form then second normal form and so on if we fail to satisfy nth normal form than the highest normal form will be n-1.

    首先检查第一个范式,然后检查第二个范式,依此类推,如果我们不满足第n个范式,则最高范式将为n-1。

数据库管理系统异常 (Anomalies in Database Management System)

There are different types of anomalies which can occur in referencing and the referenced relation which we will discuss with the help of an example,

在引用和引用的关系中可能会发生不同类型的异常,我们将借助一个示例来进行讨论,

EnameSsnDnumberDnameDmgrssn
Smith12345Research3334
Wong33345Research3334
Zeloya99984Admin9876
Wallace98764Admin9876
Jabbar98794Admin9876
n 编号 姓名 Dmgrssn
史密斯 1234 5 研究 3334
3334 5 研究 3334
Zeloya 9998 4 管理员 9876
华莱士 9876 4 管理员 9876
贾巴尔 9879 4 管理员 9876

Insertion Anomalies

插入异常

If we need to insert a new employee with no department assigned yet, we need to enter null values. We cannot insert a new department with no employees working on it on SSN= null write not be valid, a primary key cannot be null.

如果需要插入尚未分配部门的新员工,则需要输入空值。 我们不能插入没有员工在SSN上工作的新部门=空写入无效,主键不能为空。

Deletion Anomalies

删除异常

If we delete last working employee of the department, the information regarding department will be lost.

如果我们删除部门的最后一名工作人员,则有关部门的信息将丢失。

Modification anomalies

修改异常

If we change the 'depart_mgr' of dept 5 we must update the tuples of all employees who work that department otherwise database will be inconsistent.

如果我们更改部门5的'depart_mgr',则必须更新在该部门工作的所有员工的元组,否则数据库将不一致。

翻译自: https://www.includehelp.com/dbms/normalization-in-database-management-system.aspx

数据库数据规范化看不懂

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/541690.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

c 语言开发一个四则运算器,C++实现四则运算器(无括号)

本文实例为大家分享了C实现无括号的四则运算器的具体代码,供大家参考,具体内容如下完成度更高的带括号版本可以看C实现四则运算器(带括号)对于无括号的计算器,实现起来比较容易,下面让我们一步步实现。举例首先明确需要实现怎样的…

iOS开发之解决系统数字键盘无文字时delete键无法监听的技巧

最近在做用户登录获取验证码时添加图形验证码功能,就是只有正确输入图形验证码才能收到后台发送的短信验证码。效果如下: 看起来虽然是个小功能,但是实际操作起来,会发现苹果给我们留下的坑,当然更多的是自己给自己挖的…

c ++查找字符串_C ++结构| 查找输出程序| 套装1

c 查找字符串Program 1: 程序1&#xff1a; #include <iostream>#include <math.h>using namespace std;struct st {int A NULL;int B abs(EOF EOF);} S;int main(){cout << S.A << " " << S.B;return 0;}Output: 输出&#xff1a…

二级c语言加油,二级C语言 备考指南及常见问题(2013版)

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼3、关于上机操作部分的复习最好买一本上机题库方面的教材&#xff0c;或打印、阅读南开百题之类的电子文档。配合上机模拟软件(无纸化考试软件)&#xff0c;上机练习是必须的。上机软件一般有100套题多一点&#xff0c;每套有程序填…

开放定址散列表

再散列之后散列函数要重新计算。 // kaifangliaobiao.cpp : 定义控制台应用程序的入口点。 //使用平方探测解决冲突问题时&#xff0c;散列表至少空一半时&#xff0c;总能插入一个新的元素#include "stdafx.h" #include<iostream> using namespace std;#ifnde…

合并两个链表数据结构c语言,合并两个链表.

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼#include #define N1 10#define N2 10struct list{int date ;struct list *next;};main(){struct list *p1,*p2,*p3,*p4,*head,*head1,*head2,*p;int n0;head1head2NULL;p1p2(struct list *)malloc(sizeof(struct list));p1->da…

c ++查找字符串_C ++结构| 查找输出程序| 套装2

c 查找字符串Program 1: 程序1&#xff1a; #include <iostream>using namespace std;int main(){typedef struct{int A;char* STR;} S;S ob { 10, "india" };S* ptr;ptr &ob;cout << ptr->A << " " << ptr->STR[2];…

连接fiddler后手机无法显示无网络

升级了fiddler到4.6版本&#xff0c;手机设置代理后提示无网络&#xff0c;试试以下解决方法&#xff1a; 1.fiddler升级后对应的.net framework也要升级&#xff0c;安装最新的.net framework 4.6&#xff0c;升级安装后&#xff0c;可以正确抓包啦 2.如果上述方法无效&#x…

android 人脸解锁 锁屏动画,人脸保护锁(人脸识别锁屏)

这是一款十分炫酷的锁屏工具&#xff0c;还记得电影中的特工所用的人脸识别锁吗&#xff1f;这款应用也能让你过过瘾&#xff01;人脸识别锁屏安卓版是一款用人脸做密码来打开手机屏保锁的一个APP。不仅可以作屏保锁&#xff0c;也可以单独保护某些重要程序不被偷窥,例如查看短…

dbms_排名前50位的DBMS面试问答

dbms1) What are the drawbacks of the file system which is overcome on the database management system? 1)在数据库管理系统上克服的文件系统有哪些缺点&#xff1f; Ans: Data redundancy & isolation, difficulty in accessing data, data isolation, and integri…

linux时间

CST代表中国标准时间rtc实时时钟linux主要有两种时间硬件时钟 clock系统时钟 date修改时间 date 03300924必须是两位或者 date -s 2017:03:30将系统时间同步到硬件时间 hwclock -w将硬件时间同步到系统时间 hwclock -s转载于:https://blog.51cto.com/12372297/1911608

查找Python中给定字符串的所有排列

Python itertools Module Python itertools模块 "itertools" are an inbuilt module in Python which is a collection of tools for handling iterators. It is the most useful module of Python. Here, a string is provided by the user and we have to print a…

android 图片叠加xml,Android实现图片叠加效果的两种方法

本文实例讲述了Android实现图片叠加效果的两种方法。&#xff0c;具体如下&#xff1a;效果图&#xff1a;第一种&#xff1a;第二种&#xff1a;第一种是通过canvas画出来的效果:public void first(View v) {// 防止出现Immutable bitmap passed to Canvas constructor错误Bit…

Win10系列:VC++ 定时器

计时器机制俗称"心跳"&#xff0c;表示以特定的频率持续触发特定事件和执行特定程序的机制。在开发Windows应用商店应用的过程中&#xff0c;可以使用定义在Windows::UI::Xaml命名空间中的DispatcherTimer类来创建计时器。DispatcherTimer类包含了如下的成员&#xf…

dbms系统 rdbms_DBMS与传统文件系统之间的区别

dbms系统 rdbmsIntroduction 介绍 DBMS and Traditional file system have some advantages, disadvantages, applications, functions, features, components and uses. So, in this article, we will discuss these differences, advantages, disadvantages and many other …

android 百度地图api密钥,Android百度地图开发获取秘钥之SHA1

最近在做一个关于百度地图的开发。不过在正式开发之前还必须要在百度地图API官网里先申请秘钥&#xff0c;而在申请秘钥的过程中&#xff0c;就需要获取一个所谓的SHA1值。如上所示&#xff0c;但是由于不是正式开发&#xff0c;所以以上的发布版和开发版的SHA1可以先填写相同。…

单位矩阵的逆| 使用Python的线性代数

Prerequisites: 先决条件&#xff1a; Defining a Matrix 定义矩阵 Identity Matrix 身份矩阵 There are matrices whose inverse is the same as the matrices and one of those matrices is the identity matrix. 有些矩阵的逆与矩阵相同&#xff0c;并且这些矩阵之一是单位…

华为荣耀七能升级鸿蒙系统吗,华为鸿蒙系统来了,你知道哪些华为手机荣耀手机可以升级吗?...

从鸿蒙系统第一次开始登场&#xff0c;到现在慢慢有许多鸿蒙系统设备出现&#xff0c;手机市场的格局似乎又要升级变化了。科技树儿了解到&#xff0c;在某数码博主经过和相关人员的沟通核实之后&#xff0c;目前暂定的是搭载华为麒麟710芯片以上的机型&#xff0c;无论华为或荣…

day5-shutil模块

一、简述 我们在日常处理文件时&#xff0c;经常用到os模块&#xff0c;但是有的时候你会发现&#xff0c;像拷贝、删除、打包、压缩等文件操作&#xff0c;在os模块中没有对应的函数去操作&#xff0c;下面我们就来讲讲高级的 文件、文件夹、压缩包 处理模块&#xff1a;shuti…

matlab中now函数_now()方法以及JavaScript中的示例

matlab中now函数JavaScript now()方法 (JavaScript now() method) now() method is a Date class method, it is used to current time in milliseconds, it returns the total number of milliseconds since 01st January 1970, 00:00:00 UTC. now()方法是Date类的一种方法&am…