📜  DBMS中ER模型和关系模型的区别

📅  最后修改于: 2021-09-11 03:43:54             🧑  作者: Mango

ER 模型和关系模型是 DBMS 中存在的两种数据模型。让我们简要介绍一下它们:

1. ER 型号:
ER 模型代表实体关系模型。 ER 模型用于从数据角度对系统的逻辑视图进行建模,它由以下组件组成:实体、实体类型、实体集。

实体可能是具有物理存在的对象——特定的人、汽车、房子或雇员——或者它可能是具有概念存在的对象——公司、工作或大学课程。实体是实体类型的对象,所有实体的集合称为实体集。例如; E1是一个实体类型为Student的实体,所有学生的集合称为实体集。

实体类型定义了相似实体的集合,所有实体的集合称为实体集。

2. 关系模型:
关系模型由 EF Codd 提出,以关系或表格的形式对数据进行建模。使用ER图设计数据库的概念模型后,我们需要将概念模型转换为关系模型,关系模型可以使用任何RDMBS语言,如Oracle SQL、MySQL等。

考虑具有属性 ROLL_NO、NAME、ADDRESS、PHONE 和 AGE 的关系 STUDENT,如表 1 所示。


学生

ROLL_NO NAME ADDRESS PHONE AGE
1 RAM DELHI 9455123451 18
2 RAMESH GURGAON 9652431543 18
3 SUJIT ROHTAK 9156253131 20
4 SURESH DELHI 18

让我们看看ER模型和关系模型之间的区别:

S.No. ER model Relational model
1. ER model is the high level or conceptual model. It is the representational or implementation model.
2. It is used by people who don’t know how database is implemented. It is used by programmers.
3. It represents collection of entities and describes relationship between them. It represent data in the form of tables and describes relationship between them. 4. It consists of components like Entity, Entity Type, Entity Set. It consists of components like domain, attributes, tuples. 5. It is easy to understand the relationship between entities. It is less easy to derive the relationship between different tables. 6. It describes cardinality. It does not describes cardinality.