Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Entity Relationship

Download as odt, pdf, or txt
Download as odt, pdf, or txt
You are on page 1of 6

Introduction

At the end of this Chapter, the learner will be able to:


• Learn how to convert functional needs to a conceptual data model
• Identify the main concepts of the Entity-relationship model

Entity / Relationship model


• The Entity-relationship model is a type of conceptual diagram widely used for databases
data, including relational databases.
• It is a tool for describing the structure of a database by highlighting many concepts:
• Entity
• Relation
• Cardinalities
• Attributes / Identifier
• etc.

Entity
• An entity is an abstract representation of a real world object.
• An entity represents a physical or logical object.
• The object which will be represented with an entity must have different characteristics.

Attributes
• Each entity is described based on a list of properties which characterize the entity.
• At this level, the attributes are defined with their names (designation). It is not necessary to
identify types of the different attributes
Entity Identifier
• An entity identifier is a property (attribute) which can qualify an occurrence of an entity.
• The entity identifier can be simple or composed of multiple attributes.
• An identifier must depend only on the entity to which it belongs.

Which from the following is true according to entity relationship diagramIt is a conceptual model
An entity identifier can depend only other entities
depend only other entities
An entity identifier should be simple False

Relationship
• A relationship represents links between entity occurrences.
• Several employees works in the department “department_1”.
• The relationship models the relation or association between department and employee
entities
Relationship

A relationship can have more information (attributes)

Cardinalities
• Cardinalities are among the properties of an association.
• In DBMS, cardinality refers to the relationship between two entities. We should have two
terms of cardinalities, on the side of each entity.
• It models the number of times (minimum-maximum) of participation of the entity in the
relationship.
• The minimum value is either 0 or 1 and the maximum value varies between 1 and N

Cardinalities

• One employee works in one department


• A department hires between one and N employees
• There are 4 types of cardinalities : 0..1, 0..N, 1..1, 1..N

Relationship types
• The type of a given relationship can be identified based on the cardinalities of each side.
• There are 3 types of relationship:
• OnetoOne (1..1)
• OnetoMany (1..N)
• ManytoMany (N..N)

Works_for” is OnetoMany relationship.


Which from the following is not a relationship typeManytoOne
Which from the following is not a cardinality type1..0
A relationship represents links betweenentities

Sub-Entity
• A sub-entity expresses the notion of inheritance.
• Sub-entities inherit attributes from the parent class with some specifications which are those
attributes.
Weak entity
• An entity that cannot be uniquely identified by its own attributes and relies on the
relationship with other entity is called weak entity.
• A weak entity is an entity without identifier which depends on another so-called strong
entity.
• The weak entity is represented by a double rectangle.

Reflexive relation
A reflexive association is a binary association which involves the same entity twice.
n-ary relationship
• In an n - ary relationship, the n shows the number of entities in the relationship.
• If n=1, we get a reflexive relation, if n=2, it is a binary relation which links between 2
entities.
• if n>2, we talk about n-ary relationship, which involves three or more entities.

A sub-entity represents the concept of:Inheritance


In n-ary relationship, there aren entities
A weak entity is independentFalse

You might also like