What is the difference between ER Diagrams and Database Schema? MySQL Workbench has facility to draw ER diagrams, but the symbols for ER diagrams different in other drawing tools than MySQL Workbench method.
ER图和数据库模式的区别是什么?MySQL Workbench具有绘制ER图的功能,但在其他绘图工具中,ER图的符号不同于MySQL Workbench方法。
3 个解决方案
#1
9
A database schema is usually a relational model/diagram. it shows the link between tables: primary keys and foreign keys.
数据库模式通常是关系模型/关系图。它显示了表之间的链接:主键和外键。
In database diagram the relation between an apple and a apple tree would be: A foreign key "ID__TRE" which cannot be null in the table "APPLE" is linked to a primary key "ID_TRE" in the table "TREE".
在数据库图中,苹果和苹果树之间的关系是:表“apple”中不能为空的外键“ID__TRE”与表“tree”中的主键“ID_TRE”相连。
An entity relationship diagram. Shows links between the entities and the kind of relation between them. We are not talking about tables or keys there! Usually the entity relationship diagram follows Merise model. Database manager and developer as myself usually build an entity relationship model before conceiving the relational model/diagram.
The set of symbol in Merise are:(0-1, 0-n, 1-1, 1-n). The first number 0 or 1 describes whether the other part of the association is required for an object to exist. If it is zero, it means it can exists without being associated. If it is One it means that the object only exist in relation with an other object (e.g an apple need a tree to exist --> 1, a tree needn't apple to exists -->0) The second character tell us how many objects are accepted in the other part of the association. If it is 1, then only one object can exists in the relation, if it is n, a infinite number of object can be linked (e.g.: an apple can have one tree --> 1, a tree can have multiples apples --> n)
一个实体关系图。显示实体之间的联系以及它们之间的关系。我们不是在谈论桌子或钥匙!通常实体关系图遵循Merise模型。数据库管理器和开发人员通常在构建关系模型/关系图之前构建实体关系模型。Merise中的符号集是:(0-1,0-n, 1-1, 1-n)。第一个数字0或1描述一个对象是否需要关联的其他部分。如果它是零,意味着它可以存在而不被关联。如果它是一个,则意味着该对象只存在于另一个对象(e)中。一个苹果需要一棵树来存在——> 1,树不需要苹果来存在——>0)第二个字符告诉我们在这个关联的另一个部分中接受了多少对象。如果它是1,那么关系中只能存在一个对象,如果它是n,那么可以链接无数个对象(例如:一个苹果可以有一棵树——> 1,一棵树可以有多个苹果——> n)
With Entity relationship the relationship will be described as : An apple has to belong to at least one tree to exists and can belong to only one tree(1-1). A tree needn't an apple to exist but it can have an infinite number of apples (0-n).
对于实体关系,这种关系将被描述为:一个苹果必须属于至少一棵树才能存在,并且只能属于一棵树(1-1)。树不需要一个苹果存在,但它可以有无数个苹果(0-n)。
In fact both description mean the same but one is database oriented while the other is modelling oriented. Some modelling software such as DB-MAIN convert automatically an ER diagram to the relational diagram.
事实上,这两种描述都是相同的,但是一种是面向数据库的,另一种是面向建模的。一些建模软件如DB-MAIN会自动地将ER图转换为关系图。
#2
3
A database schema is a description of the actual construction of the database. It is an all-encompassing term that refers to the collective of tables, columns, triggers, relationships, key constraints, functions and procedures. It can refer to a document that describes all of this (such as an XML Schema) or as an abstraction of database makeup itself ("It would be difficult to change the schema of the database at this point"). It does not refer to rows inserted into the schema, or data itself. You would insert data into an existing schema.
数据库模式是对数据库实际构造的描述。它是一个包罗万象的术语,指的是表、列、触发器、关系、关键约束、函数和过程的集合。它可以引用描述所有这些的文档(例如XML模式),也可以引用数据库组成本身的抽象(“此时很难更改数据库的模式”)。它不引用插入到模式中的行或数据本身。将数据插入到现有模式中。
An Entity Relationship Diagram is a visualization of the relationships between tables in a database. At the very least, it includes table names visualized as squares connected by lines that represent primary and foreign key constraints. It often includes the column names and symbols that include information about what kind of relationship exists between the columns (one-to-one, one-to-many, many-to-many).
实体关系图是数据库中表之间关系的可视化。至少,它包括表名,这些表名可视化为由表示主键和外键约束的行连接的正方形。它通常包括列名称和符号,其中包含关于列之间存在何种关系的信息(一对一、一对多、多对多)。
#3
3
ENTITY RELATIONSHIP DIAGRAMS (ERDs) are just that: DIAGRAMS which describe the RELATIONSHIPS between ENTITIES. Now let's look closer...
实体关系图(ERDs)就是描述实体之间关系的图。现在让我们看起来更近……
- ERDs are often created by Business Analysts (NOT DBAs);
- erd通常由业务分析人员(而不是dba)创建;
- ERDs are often described in LAYMAN's terms (NOT techno-speak of DBAs or other);
- erd通常用外行人的术语来描述(而不是用技术术语来描述dba或其他dba);
- ERDs are meant to summarize & clarify understanding for End Users and Business SMEs (again, NOT the DBAs or Developers)
- ERDs旨在总结和澄清对最终用户和业务中小型企业(同样,不是dba或开发人员)的理解
- ERDs work best when each entity is described in the SINGULAR, and the lines connecting various entities to other entities in the ERD use verbs (of action or possession, or existence) to describe each relation;
- 当以单数来描述每个实体,并且在ERD中连接不同实体与其他实体的线使用动词(动作、占有或存在)来描述每个关系时,ERD工作得最好;
- ERDs can (and do) include lines which denote n:n relationships, but this is not a requirement.
- ERDs可以(和do)包含表示n:n关系的行,但这不是一个要求。
- Examples of entities in an ERD for a blog: Member, Post, Comment, Category
- 博客ERD中的实体示例:成员、帖子、评论、类别
- Examples of relationships described in an ERD:
- Member "posts" 1 to n Posts; (note we AREN'T describe WHAT a post looks like)
- 成员“员额”1至n个员额;(注意我们没有描述文章的样子)
- Post "relevant-to" 1 to n Categories etc.
- 发布“相关的”1到n个类别等。
- ERD中描述的关系示例:成员“posts”1到n个post;(注意,我们没有描述post是什么样子)post“相关度”1到n个类别等等。
DATA SCHEMAS bear some resemblance to ERDs, but they should NOT be considered either equivalent or interchangeable. If you make an ERD which can be used as a data schema... be open to the possibility you DIDN'T make an ERD ! ;-)
数据模式与ERDs有一些相似之处,但它们不应该被认为是等价的或可互换的。如果您制作一个ERD,它可以用作数据模式……有可能你没有做ERD !:-)
DATA schemas are diagrams used to describe to a DBA how data will be stored in a database (relational or non-relational).
数据模式是用来向DBA描述如何将数据存储在数据库中的关系图或非关系图。
- Data Schemas almost invariable describe the structure & characteristics of TABLES;
- 数据模式几乎不变,描述表的结构和特征;
- Tables are "containers" (cardboard boxes);
- 桌子是“容器”(硬纸板箱);
- As such tables in a data schema are BEST named in the PLURAL
- 在数据模式中,这样的表最好以复数形式命名。
- Examples of the TABLES in a SCHEMA for the same blog:
MEMBERS
,POSTS
,CATEGORIES
,COMMENTS
(relational database) orPOSTS
(keyed by Member-Date and all other columns in 1 table (non-relational database like for a "big data" project); - 同一个博客模式中的表示例:成员、帖子、类别、评论(关系数据库)或帖子(按成员日期和1个表中的所有其他列键入)(非关系数据库,如“大数据”项目);
-
a data schema would then describe the data contained in each table:
数据模式将描述每个表中包含的数据:
MEMBER FirstName (char:25) LastName (char:25)
etc.
等。
-
the lines between tables in a data schema would NOT try to represent any 'relation' other than a "KEY" between 2 fields which could be used to "join" the tables, and some additional characteristics of those lines to denote n:n relationships.
数据模式中的表之间的行不尝试表示任何“关系”,而只表示可以用于“连接”表的两个字段之间的“键”,以及这些行中表示n:n关系的一些附加特征。
BOTH diagrams serve quite DIFFERENT purposes: ERD: to make mere mortal end-users (and business owners) UNDERSTAND the model of a given business solution; and DATA SCHEMA: a "blueprint" used by DBAs to BUILD databases, and by DEVELOPERS to CONSUME the data in that database.
这两个图的目的都完全不同:ERD:使纯粹的终端用户(和业务所有者)理解给定业务解决方案的模型;以及数据模式:dba用来构建数据库的“蓝图”,以及开发人员使用该数据库中的数据的“蓝图”。
#1
9
A database schema is usually a relational model/diagram. it shows the link between tables: primary keys and foreign keys.
数据库模式通常是关系模型/关系图。它显示了表之间的链接:主键和外键。
In database diagram the relation between an apple and a apple tree would be: A foreign key "ID__TRE" which cannot be null in the table "APPLE" is linked to a primary key "ID_TRE" in the table "TREE".
在数据库图中,苹果和苹果树之间的关系是:表“apple”中不能为空的外键“ID__TRE”与表“tree”中的主键“ID_TRE”相连。
An entity relationship diagram. Shows links between the entities and the kind of relation between them. We are not talking about tables or keys there! Usually the entity relationship diagram follows Merise model. Database manager and developer as myself usually build an entity relationship model before conceiving the relational model/diagram.
The set of symbol in Merise are:(0-1, 0-n, 1-1, 1-n). The first number 0 or 1 describes whether the other part of the association is required for an object to exist. If it is zero, it means it can exists without being associated. If it is One it means that the object only exist in relation with an other object (e.g an apple need a tree to exist --> 1, a tree needn't apple to exists -->0) The second character tell us how many objects are accepted in the other part of the association. If it is 1, then only one object can exists in the relation, if it is n, a infinite number of object can be linked (e.g.: an apple can have one tree --> 1, a tree can have multiples apples --> n)
一个实体关系图。显示实体之间的联系以及它们之间的关系。我们不是在谈论桌子或钥匙!通常实体关系图遵循Merise模型。数据库管理器和开发人员通常在构建关系模型/关系图之前构建实体关系模型。Merise中的符号集是:(0-1,0-n, 1-1, 1-n)。第一个数字0或1描述一个对象是否需要关联的其他部分。如果它是零,意味着它可以存在而不被关联。如果它是一个,则意味着该对象只存在于另一个对象(e)中。一个苹果需要一棵树来存在——> 1,树不需要苹果来存在——>0)第二个字符告诉我们在这个关联的另一个部分中接受了多少对象。如果它是1,那么关系中只能存在一个对象,如果它是n,那么可以链接无数个对象(例如:一个苹果可以有一棵树——> 1,一棵树可以有多个苹果——> n)
With Entity relationship the relationship will be described as : An apple has to belong to at least one tree to exists and can belong to only one tree(1-1). A tree needn't an apple to exist but it can have an infinite number of apples (0-n).
对于实体关系,这种关系将被描述为:一个苹果必须属于至少一棵树才能存在,并且只能属于一棵树(1-1)。树不需要一个苹果存在,但它可以有无数个苹果(0-n)。
In fact both description mean the same but one is database oriented while the other is modelling oriented. Some modelling software such as DB-MAIN convert automatically an ER diagram to the relational diagram.
事实上,这两种描述都是相同的,但是一种是面向数据库的,另一种是面向建模的。一些建模软件如DB-MAIN会自动地将ER图转换为关系图。
#2
3
A database schema is a description of the actual construction of the database. It is an all-encompassing term that refers to the collective of tables, columns, triggers, relationships, key constraints, functions and procedures. It can refer to a document that describes all of this (such as an XML Schema) or as an abstraction of database makeup itself ("It would be difficult to change the schema of the database at this point"). It does not refer to rows inserted into the schema, or data itself. You would insert data into an existing schema.
数据库模式是对数据库实际构造的描述。它是一个包罗万象的术语,指的是表、列、触发器、关系、关键约束、函数和过程的集合。它可以引用描述所有这些的文档(例如XML模式),也可以引用数据库组成本身的抽象(“此时很难更改数据库的模式”)。它不引用插入到模式中的行或数据本身。将数据插入到现有模式中。
An Entity Relationship Diagram is a visualization of the relationships between tables in a database. At the very least, it includes table names visualized as squares connected by lines that represent primary and foreign key constraints. It often includes the column names and symbols that include information about what kind of relationship exists between the columns (one-to-one, one-to-many, many-to-many).
实体关系图是数据库中表之间关系的可视化。至少,它包括表名,这些表名可视化为由表示主键和外键约束的行连接的正方形。它通常包括列名称和符号,其中包含关于列之间存在何种关系的信息(一对一、一对多、多对多)。
#3
3
ENTITY RELATIONSHIP DIAGRAMS (ERDs) are just that: DIAGRAMS which describe the RELATIONSHIPS between ENTITIES. Now let's look closer...
实体关系图(ERDs)就是描述实体之间关系的图。现在让我们看起来更近……
- ERDs are often created by Business Analysts (NOT DBAs);
- erd通常由业务分析人员(而不是dba)创建;
- ERDs are often described in LAYMAN's terms (NOT techno-speak of DBAs or other);
- erd通常用外行人的术语来描述(而不是用技术术语来描述dba或其他dba);
- ERDs are meant to summarize & clarify understanding for End Users and Business SMEs (again, NOT the DBAs or Developers)
- ERDs旨在总结和澄清对最终用户和业务中小型企业(同样,不是dba或开发人员)的理解
- ERDs work best when each entity is described in the SINGULAR, and the lines connecting various entities to other entities in the ERD use verbs (of action or possession, or existence) to describe each relation;
- 当以单数来描述每个实体,并且在ERD中连接不同实体与其他实体的线使用动词(动作、占有或存在)来描述每个关系时,ERD工作得最好;
- ERDs can (and do) include lines which denote n:n relationships, but this is not a requirement.
- ERDs可以(和do)包含表示n:n关系的行,但这不是一个要求。
- Examples of entities in an ERD for a blog: Member, Post, Comment, Category
- 博客ERD中的实体示例:成员、帖子、评论、类别
- Examples of relationships described in an ERD:
- Member "posts" 1 to n Posts; (note we AREN'T describe WHAT a post looks like)
- 成员“员额”1至n个员额;(注意我们没有描述文章的样子)
- Post "relevant-to" 1 to n Categories etc.
- 发布“相关的”1到n个类别等。
- ERD中描述的关系示例:成员“posts”1到n个post;(注意,我们没有描述post是什么样子)post“相关度”1到n个类别等等。
DATA SCHEMAS bear some resemblance to ERDs, but they should NOT be considered either equivalent or interchangeable. If you make an ERD which can be used as a data schema... be open to the possibility you DIDN'T make an ERD ! ;-)
数据模式与ERDs有一些相似之处,但它们不应该被认为是等价的或可互换的。如果您制作一个ERD,它可以用作数据模式……有可能你没有做ERD !:-)
DATA schemas are diagrams used to describe to a DBA how data will be stored in a database (relational or non-relational).
数据模式是用来向DBA描述如何将数据存储在数据库中的关系图或非关系图。
- Data Schemas almost invariable describe the structure & characteristics of TABLES;
- 数据模式几乎不变,描述表的结构和特征;
- Tables are "containers" (cardboard boxes);
- 桌子是“容器”(硬纸板箱);
- As such tables in a data schema are BEST named in the PLURAL
- 在数据模式中,这样的表最好以复数形式命名。
- Examples of the TABLES in a SCHEMA for the same blog:
MEMBERS
,POSTS
,CATEGORIES
,COMMENTS
(relational database) orPOSTS
(keyed by Member-Date and all other columns in 1 table (non-relational database like for a "big data" project); - 同一个博客模式中的表示例:成员、帖子、类别、评论(关系数据库)或帖子(按成员日期和1个表中的所有其他列键入)(非关系数据库,如“大数据”项目);
-
a data schema would then describe the data contained in each table:
数据模式将描述每个表中包含的数据:
MEMBER FirstName (char:25) LastName (char:25)
etc.
等。
-
the lines between tables in a data schema would NOT try to represent any 'relation' other than a "KEY" between 2 fields which could be used to "join" the tables, and some additional characteristics of those lines to denote n:n relationships.
数据模式中的表之间的行不尝试表示任何“关系”,而只表示可以用于“连接”表的两个字段之间的“键”,以及这些行中表示n:n关系的一些附加特征。
BOTH diagrams serve quite DIFFERENT purposes: ERD: to make mere mortal end-users (and business owners) UNDERSTAND the model of a given business solution; and DATA SCHEMA: a "blueprint" used by DBAs to BUILD databases, and by DEVELOPERS to CONSUME the data in that database.
这两个图的目的都完全不同:ERD:使纯粹的终端用户(和业务所有者)理解给定业务解决方案的模型;以及数据模式:dba用来构建数据库的“蓝图”,以及开发人员使用该数据库中的数据的“蓝图”。