UD2 ER Model
UD2 ER Model
◉ An Instance (or item) of an Entity represents one element from the real
world we want to show.
UD2 - Components of a E/R Diagram - Entities
An entity is represented by …
◉ … rectangles, the entity name is written inside the rectangle (in capital
letters).
◉ Usually can MUST be named as a noun (singular or plural, but the same
criteria for the ERD).
UD2 - Components of a E/R Diagram - Entities
An Entity can represent a set of instances that are of interest to a particular
business.
Suppose this typical case of study: an ERD for a
Secondary school's website.
UD2 - Components of a E/R Diagram - Entities
Entities are a compound of items I can put together because of their
relationship between them. Below some examples ...
◉ Related to People:
○ Students, Teachers, Staff, …
○ Players, Referees, Managers
◉ Related to Places:
○ Banks, Secondary Schools, Stadiums, Departments, Areas, Zones
○ Countries, States, Provinces, Cities or Villages, Streets, Postal code
zones
◉ Related to Intangible items:
○ Customers, Suppliers, Invoices, Payments, Charges, Services,
Prices, Categories of something (Type of …),
UD2 - Components of a E/R Diagram - Attributes
Attributes are ...
◉ Describe an entity and are the specific information that must be known.
◉ The name of the attribute should not include the name of the entity
because attributes describe the entity.
◉ MUST be named as a singular noun.
UD2 - Components of a E/R Diagram - Attributes
Key Attributes are …
◉ ... defined to identify easily any instance (item) in an entity.
Examples:
◉ address: consisting of street name, number, postal code, city ...
◉ surnames: 1st surname, 2nd surname
◉ movie-produced-by: co-produced by several produced films.
UD2 - Components of a E/R Diagram - Attributes
Derived (or calculated) attributes are ...
The value for this type of attribute can be derived from the values of other
related attributes or entities.
Example:
◉ suppose that a student entity has an attribute named "age", which
indicates the student’s age. If the student entity also has an attribute
"date-of-birth", we can calculate age from date-of-birth and the current
date. Thus, age is a derived attribute. Somehow, take into account that
"date-of-birth" can provide more information than "age".
UD2 - Components of a E/R Diagram - Attributes
Repetitive attributes are ...
A limited number of attributes representing
Examples:
◉ phone-number: anybody may have zero, one or several phone
numbers: Telephone1, Telephone2, Telephone3, ...
◉ movie-produced-by: co-produced by several produced films:
Producer1, Producer2, Producer3, …
◉ A list of skills for a Person: Skill1, Skill2, Skill3, ...
UD2 - Components of a E/R Diagram - Attributes
Multivalued, Derived and Repetitive attributes must ...
… not be present at the end of Designing phase, hence should be cleared up
from Physical Design.
Examples:
◉ phone-number: unknown value at this moment
◉ video-rent-data: null value when video is saled
UD2 - Components of a E/R Diagram - Attributes
Attributes are represented by ...
… an ellipse in lower letters and a line (solid for mandatory attribute, and
broken for non) which link attributes to entity.
An employee can be
A company can have
related to a Company or to
Employees related or have
be related to no one
no one.
Company.
Common usage for a 1 : N
Uncommon usage for a 1 :
relationship.
N relationship.
UD2 - Components of a E/R Diagram - Relationships
Strong and weak entities are ...
◉ Strong entity: is the one whose existence does not depend on the
existence of any other entity in a schema. A strong entity always has the
primary key in the set of attributes that describes the strong entity.
◉ Weak entity: is the one whose existence that depends on a strong entity
for its existence. The primary key of a weak entity is a composite key
formed from the primary key of the strong entity and partial key of the
weak entity.
UD2 - Components of a E/R Diagram - Relationships
Relationships also have ...
◉ Transferable: related to relationships 1 : N and strong / weak entities.
→ Strong entity
→ Weak entity
UD2 - Components of a E/R Diagram - Relationships
Relationships are represented by ...
There are many representations of an ERD. Below are some examples:
◉ Standard notation
◉ Depending on the author:
○ Chen notation,
○ Bachman notation,
○ Martin notation,
○ Barker notation.
UD2 - Components of a E/R Diagram - Relationships
Standard notation
UD2 - Components of a E/R Diagram - Relationships
Chen notation
UD2 - Components of a E/R Diagram - Relationships
Bachman notation
UD2 - Components of a E/R Diagram - Relationships
Martin notation
UD2 - Components of a E/R Diagram - Relationships
The notation we will use (Barker Notation) ...
UD2 - Components of a E/R Diagram - Domains
Domains are ...
… a set of values which an attribute can derive from. Each simple attribute is
associated with a domain, which specifies its valid values.
Examples:
◉ NAMES: a character string of up to 30 chars.
◉ DESCRIPTIONS: a character string of up to 100 chars.
◉ PHONE-NUMBERS: a character string of up to 9 numbers.
◉ GENDERS: a character string of 1 char: M → male, F → female.
UD2 - Components of a E/R Diagram - Domains
Domains are represented by ...
It is not used to represent the relationship between domains and their
attributes.
DOMAIN ATTRIBUTES
... ...
Recursos de la UD
El llicenciador no pot revocar aquestes llibertats, sempre que seguiu els termes de la llicència.
No hi ha cap restricció addicional — No podeu aplicar termes legals ni mesures tecnològiques que
restringeixin legalment a altres de fer qualsevol cosa que la llicència permet
https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode