You are on page 1of 12

7/30/2023

Entity Relationship (ER) Model


&
Diagram

Presented by

Md. Zafurul Alam Khan


OCP (DBA)
Senior System Analyst, BCC

What is Data ?

DATA consists of Letters, Numbers, Characters, Alphabets or


combination of Alphabets & Numbers for facts.
Data is the name given to Symbols, Numbers, sounds, patterns etc.
which can be used to represent quantities and value of concepts.

1
7/30/2023

What is Information/Record ?

When defined meaningful related data are arranged in a systematic


way for meaningful purpose, is called INFORMATION. i. e,
Processed data is an Information.

Table/File/Relation
Record/Row/Tuple
Field/Attribute/Column

SL Name Designation Dt of Birth


01 ZAHID PROGRAMMER 301256

02 SAIFUL PROGRAMMER 231162

03 RAFIQ EXECUTIVE 200858

04 AHMED ACCOUNTANT 030554

05 HASAN SALES MANAGER 270967

2
7/30/2023

Field :

Consists of some Characters of the following types : i.e Numeric,


Alphabetic, Alphanumeric, Date etc.

Record :
A combination of related fields.
File / Table :
Collection of Records.

TABLE 1

TABLE 2

TABLE 3
DATABASE
TABLE 4

TABLE 5

TABLE N

3
7/30/2023

What is Database ?

Database is a collection of related information. Database is a


self-describing and organized collection of integrated records.

A database is a single organized collection of structured data


with a minimum of duplication of data items so as to provide a
consistent and controlled pool of data.

TABLE 1

TABLE 2

TABLE 3
DATABASE
TABLE 4

TABLE 5

TABLE N DEFINITION

DATABASE STRUCTURE
MANAGEMENT
MANIPULATION
SYSTEM (DBMS)
8

4
7/30/2023

Design Phases

 The initial phase of database design is to characterize fully the


data needs of the prospective database users.

 Next, the designer chooses a data model and, by applying the


concepts of the chosen data model, translates these
requirements into a conceptual schema of the database.

 A fully developed conceptual schema also indicates the


functional requirements of the enterprise. In a “specification of
functional requirements”, users describe the kinds of
operations (or transactions) that will be performed on the data.

Design Phases

The process of moving from an abstract data model to the


implementation of the database proceeds in two final design
phases.

 Logical Design – Deciding on the database schema. Database


design requires that we find a “good” collection of relation
schemas.

 Physical Design – Deciding on the physical layout of the database

10

5
7/30/2023

Design Approaches

Entity Relationship Model


 Models an enterprise as a collection of entities and relationships

 Entity: a “thing” or “object” in the enterprise that is


distinguishable from other objects
Described by a set of attributes
 Relationship: an association among several entities

 Represented diagrammatically by an entity-relationship diagram:

11

ER model -- Database Modeling

 The ER data model employs three basic concepts:


– entity sets,
– relationship sets,
– attributes.

 The ER model also has an associated diagrammatic


representation, the ER diagram, which can express the overall
logical structure of a database graphically.

12

6
7/30/2023

Entity Sets

An entity is an object that exists and is distinguishable from other 0bjects.


– Example: specific person, company, event, plant

An entity is a set of entities of the same type that share the same properties.
– Example: set of all persons, companies, trees, holidays

An entity is represented by a set of attributes; i.e., descriptive properties


possessed by all members of an entity set.
– Example:
instructor = (ID, name, street, city, salary )
course= (course_id, title, credits)

A subset of the attributes form a of the entity set; i.e., uniquely identifiying
each member of the set.

13

Entity Sets -- instructor and student

instructor_ID instructor_name student-ID student_name

Instructor
Student

14

7
7/30/2023

Degree of a Relationship Set

binary relationship
– involve two entity sets (or degree two).
– most relationship sets in a database system are binary.

Relationships between more than two entity sets are rare.


Most relationships are binary.

 Example: students work on research projects under the


guidance of an instructor.

15

Mapping Cardinality Constraints

Express the number of entities to which another entity can


be associated via a relationship set.

Most useful in describing binary relationship sets.


For a binary relationship set the mapping cardinality must
be one of the following types:
– One to one
– One to many
– Many to one
– Many to many

16

8
7/30/2023

Mapping Cardinalities

One to one
One to Many

17

Mapping Cardinalities

Many to one

Many to one Many to many

18

9
7/30/2023

One to one

19

One to many example

20

10
7/30/2023

Many to Many Relasionship

21

Draw ER diagram using following entity/table

EmployeeInfo SalaryCode Designation

EmployeeID PK SalaryCode PK DesigID PK


Name SalAmount DesigName
SalaryCode FK
DesigID Fk
DoB
Address AcademicInfo

EmployeeID PK
LastEducation

11
7/30/2023

Thank you

23

12

You might also like