Entity Relationship Modeling (ER Modeling) is by far the most common way to express the analytical result of an early stage in the construction of a new database. E-R Diagram are the way to achieve this.
Entity Relationship diagram are a way to represent the structure and layout of a database. It is used frequently to describe the database schema. ER diagrams are very useful as they provide a good conceptual view of any database, regardless of the underlying hardware and software. An ERD is a model that identifies the concepts or entities that exist in a system and the relationships between those entities.
An ERD is often used as a way to visualize a relational database: each entity represents a database table, and the relationship lines represent the keys in one table that point to specific records in related tables.
Entity-Relationship (ER) model was originally proposed by peter in 1976 [chen76] as a way to unify the network and relational database views.
Simply stated the ER model is a conceptual data model that views the real world as entities and relationships. A basic component of the model is the Entity-Relationship diagram which is used to visually represent data objects.
Basic Constructs of E-R Modeling
The ER Model views the real world as a construct of entities and association between entities.
Entities are the principal data object about which information is to be collected. Entities are usually recognizable concepts, either concrete or abstract, such as person, places, things, or events which have relevance to the database.
Entities are classified as independent or dependent. An independent entity is one that does not rely on another for identification. A dependent entity is one that relies on another for identification.
An entity occurrence (also called an instance) is an individual occurrence of an entity. An occurrence is analogous to a row in the relational table.
Special Entity Types
Associative entities (also known as intersection entities) are entities used to associate two or more entities in order to reconcile a many-to-many sub-type entities are used in generalization hierarchies to represent a subset of instances of their parent entity, called the super-type, but which have attributes or relationships that apply only to the subset.
Degree of Relationship
The degree of a relationship is the number of entities associated with 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.
Binary relationships, the association between two entities are the most common type in the real world. A recursive binary relationship occurs when an entity is related to itself. An example might be “some employees are married to other employees”.
A ternary relationship involves three entities and is used when a binary relationship is inadequate. Many modeling approaches recognize only binary relationships. Ternary or n-ary relationships are decomposed into two or more binary relationships.
Connectivity and Cardinality
The connectivity of a relationship describes the mapping of associated 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 two entities. The basic types of connectivity for relations are:
One-to-one one-to-many many to many
One-to-one (1:1) Relationship
one-to-one relationship is when at most one instance of a entity A is associated with one instance of entity B.
One-to-many (1:N) Relationship
one-to-many relationships is when for one instance of entity A, there are zero, one, or many instance of entity B, but for one instance of entity B, there is only one instance of entity A.
Many-to-many (M:N) Relationship
Many-to-many relationship, sometimes called non-specific, is when for one instance of entity A, there are zero, one, or many instances of entity B and for one instance of entity B there are zero, one, or many instances of entity A.