0% found this document useful (0 votes)
3 views5 pages

Understanding Entity-Relationship Models

The document explains the Entity-Relationship (E-R) model, which represents the real world through entities, attributes, and relationships. It details the types of attributes (simple, composite, single, multivalued) and relationships (one-to-one, one-to-many, many-to-many) along with their graphical representation in an Entity-Relationship Diagram (ERD). Additionally, it outlines various attribute types and their notations in the context of database modeling.

Uploaded by

seallemla41
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

Understanding Entity-Relationship Models

The document explains the Entity-Relationship (E-R) model, which represents the real world through entities, attributes, and relationships. It details the types of attributes (simple, composite, single, multivalued) and relationships (one-to-one, one-to-many, many-to-many) along with their graphical representation in an Entity-Relationship Diagram (ERD). Additionally, it outlines various attribute types and their notations in the context of database modeling.

Uploaded by

seallemla41
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ENTITY-RELATION MODEL

The conceptual model can be represented using Entity-Relationship model (E-R


model). The E-R model views the real world as a set of basic objects (known as
entities), their characteristics (known as attributes) and associations among these
objects (known as relationships).

Entity, Attributes and relationship

1) An entity is any object in the system that we want to model and store
information about. Entities are usually recognizable concepts, either concrete or
abstract, such as person, places, things, or events which have relevance to the
database.
2) An attribute is an item of information which is stored about an entity. There
exist different types of entity

(a) Simple and composite attributes. A simple attribute is the smallest semantic
unit of data, which are atomic (no internal structure). A composite attribute can
be subdivided into parts, e.g., address (street, city, state, zip).
(b) Single and multivalued attributes. Single attributes have a single value for a
particular entity. Multivalued attributes have multiple values of an attribute for a
particular entity; e.g., degrees or courses that a student can have or take.

3) Relationship is an association, dependency or link between two or more tables

Example. In a business enterprise, entity may be Product, Representative and Customer. The
attributes of product can be Name and Price. The attribute of representative is Name, Region
and Phone. The attributes of Customer are Name, City and Age. The relationship between
customer and product is represented by “Buys”, and the relationship between
Representative and product is represented by “Sells”

Figure 9: Entity, attribute and relationship


Entity-Relationship diagram (ERD)
An entity-relationship diagram (ERD) is a graphical representation of entities and their

relationships.

• Rectangles represent entity types


• Ellipses represent attributes
• Diamonds represent relationship types
• Lines link attributes to entity types and entity types to relationship types
• Primary key attributes are underlined
Types of Relationship
Even though a relationship may involve more than two entities, the most commonly
encountered relationships are binary, involving exactly two entities. Generally, such binary
relationships are of three types and called cardinality: one-to-one, one-to-many and
many- to-many.

1. One-to-one Relationship (1:1)

One-to-one relationships occur when each entry in the first table has one, and only one,
counterpart in the second table. One-to-one relationships are rarely used because it is often
more efficient to simply put all of the information in a single table.
eg if a man only marries one woman and a woman only marries one man, it is a one-to-one
(1:1) relationship.

Fig 5 : One-to-One
2. One-to-many Relationship (1:M)
One-to-many relationships are the most common type of database relationship. They
occur when each record in the first table corresponds to one or more records in the second
table but each record in the second table corresponds to only one record in the first table. For
example, the relationship between a Teachers table and a Students table in an elementary
school database would likely be a one-to-many relationship, because each student has
only one teacher, but each teacher may have multiple students.

Fig 6: One-to-Many
The crowbar represents the Many occurrences.

3. Many-to-many Relationship (M:M)


Many-to-many relationships occur when each record in the first table corresponds to one or
more records in the second table and each record in the second table corresponds to one
or more records in the first table. For example, One teacher teaches many students and a
student is taught by many teachers.

Fig 7 Many-to-Many relationship

Summary
1. Simple Attribute Cannot be divided into smaller parts. Example: Age, Gender, Salary.

2. Composite Attribute Can be split into smaller meaningful parts. Example: Address → Street,
City, Country.

3. Single-Valued Attribute Has only one value for each entity. Example: One ID card number

4. Multi-Valued Attribute Has many values for the same entity. Example: Many phone
numbers, many skills.

5. Derived Attribute Value is calculated from another attribute. Example: Age (calculated from
Date of Birth).

6. Key Attribute A special attribute that uniquely identifies something. Example: StudentID,
EmployeeID.

7. Composite Key Attribute Two or more attributes combined to uniquely identify something.
Example: StudentID + CourseID (together identify a registration).

Attribute Type ER Notation


Simple Single oval
Composite Oval with smaller connecting ovals
Single-Valued Single oval
Multi-Valued Double oval
Derived Dashed oval
Key Oval with underlined name
Composite Key Two or more underlined ovals

Assignment: Types of Entities

You might also like