12
ER Model Overview Igor Myroshnichenko, M.S. myrosh.com/er-model-overview

ER Model Overview

Embed Size (px)

Citation preview

Page 1: ER Model Overview

ER Model OverviewIgor Myroshnichenko, M.S.

myrosh.com/er-model-overview

Page 2: ER Model Overview

Introduction• The ER (Entity-Relationship) model is a semantic

data model used during the conceptual stage of database design.

• The ER model describes a domain of knowledge in terms of entities and relationships.

• Roughly, entities are things that exist independently of other things, whereas relationships are connections between things.

Page 3: ER Model Overview

ER Notation

Page 4: ER Model Overview

ER Notation: Explanation• Entities are represented as rectangles.

• Rectangles with a double border are weak entities (Dependent).

• Attributes are ovals. Underlined attributes are keys (Employee.ssn).

• Composite attributes are represented as a parent-child hierarchy of ovals (Project.location).

• Relationships are diamonds. Minimum and maximum cardinality constraints for a relationship’s participating entities are represented in the form of (min, max) above the connector corresponding to the appropriate participating entity.

Page 5: ER Model Overview

Entities• Entities are recognizable concepts such as

persons, places, things or events which have relevance to the database.

• A strong entity is one that does not rely on another for identification.

• A weak entity is one that relies on another for identification.

Page 6: ER Model Overview

Attributes• Attributes describe the entity or relationship with

which they are associated.

• Identifier attributes or keys uniquely identify an entity. Keys of a weak entity are called partial keys.

• Descriptor attributes describe non-unique characteristics of an entity.

• Composite attributes aggregate other related attributes.

Page 7: ER Model Overview

Relationships

• A relationship represents an association between two or more entities.

• Relationships are classified in terms of degree, connectivity, cardinality and existence.

Page 8: ER Model Overview

Relationships: Degree

• The degree of a relationship is the number of entities participating in the relationship.

• The n-ary relationship is the general form for degree n.

• Special cases are the binary and ternary, where the degree is 2, and 3, respectively.

Page 9: ER Model Overview

Relationships: Connectivity and Cardinality

• The connectivity of a relationship describes the mapping of participating entity instances in the relationship. The values of connectivity are one or many.

• The cardinality of a relationship is the actual number of related occurrences for each of the participating entities.

• The basic types of connectivity are: one-to-one, one-to-many and many-to-many.

Page 10: ER Model Overview

Relationships: Direction• The direction of a relationship indicates the originating

entity of a binary relationship.

• In a one-to-one relationship the direction is from the independent entity to a dependent entity. If both entities are independent, the direction is arbitrary.

• With one-to-many relationships, the entity occurring once is the parent.

• The direction of many-to-many relationships is arbitrary.

Page 11: ER Model Overview

Relationships: Type and Existence

• An identifying relationship is one in which one of the child entities is also a weak entity. A non-identifying relationship is one in which both entities are independent.

• Existence denotes whether the existence of an entity instance is dependent upon the existence of another, related, entity instance. The existence of an entity in a relationship is defined as either mandatory or optional.

Page 12: ER Model Overview

Thank you!

• Please refer to myrosh.com/er-model-overview for more details on ER model and references.