Notes > Database Systems > Entities and Entity-Relationship (ER) Modelling
ER Modelling provides a fully scalable solution to modelling relationships between groups of data elements. These groups of data elements can be described as "entities" or "entity types". These entities are items (real or otherwise) that are of relevance to the business.
An ER model will contain the following concepts:
- Entity types
- Relationship types
An entity type describes a type of item which is distinctly identifiable. The identification of entities is typically open to the interpretative skills of the systems analyst or designer. There are no quick and easy rules which can be used to identify entities.
An ER model consists of an ER diagram or set of ER diagrams, as well as a set of normalised relations (tables) which correspond to the ER diagrams. Additional information that can be provided along with the ER model is as follows:
- written description of entities / relationships
- any assumptions
- additional constraints on the model
Entity-Relationship (ER) Diagrams
Entities are shown within a box. The entities "Student", "Book", "DVD" and "Staff" can therefore be represented as shown below:
Relationships between entities can be shown by joining the entities with a line:
As shown in the above diagram, the relationship can be named and given a direction (shown with a small arrow) to indicate which way the named relationship applies. This naming of relationships adds meaning and can reduce ambiguity.
Cardinality constraints show the number of instances of entities that can be involved in a relationship. For example, 1 member of staff can look after no books, 1 book, or many books. A book has to be assigned to some member of staff though. This is represented by the "1..1" cardinality constraint. One and only one member of staff must be assigned to each book.
The degree of a relationship is the number of entities that participate in that relationship. A simple relationship involving two entities is known as a binary relationship. Relationships with three entities are known as ternary relationships. It is possible to have more entities involved in a relationship but this would lead to an increasing level of complexity.
Unary relationships involve a single entity which has a relationship with itself (i.e. the same entity type). Unary relationships are also known as recursive relationships.
See also Enhanced ER Modelling (EER)
Search for "Entities and Entity-Relationship (ER) Modelling" on:
eBay (UK) |
Search for "Entities and Entity-Relationship (ER) Modelling" on the rest of Computing Students: Entities and Entity-Relationship (ER) Modelling