database 实体类型和实体集的区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26653114/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between entity type and entity set?
提问by Niranjan
What is attribute. What is the difference between entity, entity type and entity set? Please explain the difference with an example.
什么是属性。实体、实体类型和实体集有什么区别?请举例说明区别。
回答by Vikas786
STUDENT
学生
ID Name AGE
身姓名年龄
1 Ram 12
2 Sam 13
1 公羊 12
2 山姆 13
Above is an example of a table called Student having 2 rows (1,Ram,12) and (2,Sam,13) . Using this we can understand the difference.
上面是一个名为 Student 的表的示例,它有 2 行 (1,Ram,12) 和 (2,Sam,13) 。使用这个我们可以理解差异。
Entity
实体
It is something which has real existence. Like tuple1 contains information about Ram(id, name and Age) which has existence in real world . So the tuple1 is an entity. So we may say each tuple is an entity.
它是真实存在的东西。就像 tuple1 包含有关现实世界中存在的 Ram(id, name and Age) 的信息。所以 tuple1 是一个实体。所以我们可以说每个元组都是一个实体。
Entity Type
实体类型
It is collection of entity having common attribute. As in Student table each row is an entity and have common attributes. So STUDENTis an entity type which contains entities having attributes id, name and Age.Also each entity type in a database is described by a name and a list of attribute.So we may say a table is an entity type
它是具有共同属性的实体的集合。在 Student 表中,每一行都是一个实体并具有共同的属性。所以STUDENT是一种实体类型,它包含具有属性 id、name 和 Age 的实体。此外,数据库中的每个实体类型都由名称和属性列表描述。所以我们可以说表是一种实体类型
Entity SET
实体集
It is a set of entities of same entity type. so a set of one or more entities of Student Entity type is an Entity Set.
它是一组相同实体类型的实体。所以一组一个或多个学生实体类型的实体是一个实体集。
ATTRIBUTE
属性
It is a property of an entity. For example, in table STUDENT id,name and Age are properties of an entity of entity type student. Hence these are attributes.
它是实体的属性。例如,在表 STUDENT id、name 和 Age 中,实体类型为 student 的实体的属性。因此,这些是属性。
Comments are Welcome
欢迎评论
回答by Dr. Debasish Jana
Entity means anything with distinct and independent existence. Entity type is basically a collection of entities that have the similar attributes. Entity set is the collection as a set of all entities of the similar type. So, Entity type and entity set are analogous. Example of entity set: set of all persons, universities, companies An entity is represented by a set of attributes, that is descriptive properties possessed by all members of an entity set. Example: student = (student-id, student-name, address-street, address-city), item = (item-number, price)
实体是指任何具有独特和独立存在的事物。实体类型基本上是具有相似属性的实体的集合。实体集是作为相似类型的所有实体的集合的集合。因此,实体类型和实体集是类似的。实体集示例:所有人员、大学、公司的集合 实体由一组属性表示,即实体集的所有成员所拥有的描述性属性。示例:student = (student-id, student-name, address-street, address-city), item = (item-number, price)
回答by PASKALINA EDWARD
The entity type refers to the collection of entity that share a common definition Entity set is the set of entities of the same type that share the same attributes.Eg set of all people who are customer at a particular bank can be defined as the entity customer.
实体类型是指具有共同定义的实体的集合实体集是具有相同属性的相同类型的实体的集合。例如,可以将特定银行的所有客户的集合定义为实体客户.
回答by Gichinga PK
Entity type is a group of entities that has similar attributes. While, Entity set of entities of the same entity type.
实体类型是一组具有相似属性的实体。而 Entity 是同一实体类型的实体集合。