You are on page 1of 19

College of electronics technology

________Baniwalid _______

High level conceptual model, Entity-


Relationship model
(ER)Model

Week 3
Mustafa Abuali spring 2017
Outline

 Entities
 Attributes
 Relationship
 Entity Types
 Attributes Types
ER Model concepts

- Entities and Attributes.


Entities:- are specific persons , places ,events ,and objects or things in the mini-world
which the user needs to keep data ,that are represented in the database.

# For example the EMPLOYEE ,DEPARTMENT, PROJECT, OFFICE, TASKS and


CONFERENCE .
ER Model concepts

Attribute:- are properties used to describe an entity.

# For example an EMPLOYEE entity may have the attributes


Name.
SSN.
Address.
Sex.
BirthDate.
ER Model concepts

Relationships:- relates two or more distinct entities with a specific meaning.

For example, EMPLOYEE Ahmed works on the PROJECTX,


or
EMPLOYEE ALI manages the Research DEPARTMENT.
Types of Attributes (1)

1-Simple
Each entity has a single atomic value for the attribute.
For example, SSN or Sex.
Types of Attributes (2)

2-Composite

The attribute may be composed of several components.


For example:
Address(Apt#, House#, Street, City, State, ZipCode, Country), or
Name(FirstName, MiddleName, LastName).
Composition may form a hierarchy where some components are themselves
composite.
Types of Attributes (3)

3- Multi-valued
An entity may have multiple values for that attribute.
For example, Color of a CAR or PreviousDegrees of a STUDENT.
Denoted as {Color} or {PreviousDegrees}.
Types of Attributes (3)

4-Derived attribute:-
is an attribute whose value is calculated (derived) from other attributes.The derived attribute
need not be physically stored within the database; instead, it can bederived by using an
algorithm. For example, an employee’s age, EMP_AGE, may be found bycomputing the
integer value of the difference between the current date and the birth date ofthe employee.
Key Attributes (1)

 An attribute of an entity type for which each entity must have a


unique value is called a key attribute of the entity type.
 For example, SSN of EMPLOYEE.
 For example, ID of STUDENT.
 For example, CODE of COURSE.
Key Attributes (1)

 A key attribute may be composite.


 VehicleTagNumber is a key of the CAR entity type with components
(Number, State).
 Office number (OFNumber,BulNumber)

 Each key is underlined


Example
Relationship Types (1)

Relationship instances
In the mini-world represented by figure below employees e1, e2, e3 and e6 work for
department d1, e2 and e4 works for d2 and e5 and e7 work for d3.
Relationship types

 1-Binary Relationship .

for example (EMP _____ DEP).

 2-Ternary Relationship.

for example (suppliers ____ Parts____ projects).

 3-Recursive Relationship.

for example (EMPLOYEE ___ itself ).


Cardinality of relationship Constraints

1- One –to– One .


each entity in the relationship will have exactly one related entity .

2-One –to- Many .


An entity on one side of relationship can have many related entities but an
entity on the other side will have a maximum of one related entity .

3-Many –to- Many.


Entities on both side of relationship have related entities on the other side .
Participation Constraint

 1- Partial
 2- Total

You might also like