Unit-2-DAY 5 - 20 - 09
Unit-2-DAY 5 - 20 - 09
E R MODEL
Unit 2 Day 5
This document contains valuable confidential and proprietary information of ABESEC. Such confidential and
proprietary information includes, amongst others, proprietary intellectual property which can be legally protected and
commercialized. Such information is furnished herein for training purposes only. Except with the express prior
written permission of ABESEC, this document and the information contained herein may not be published,
disclosed, or used for any other purpose.
2
Copyright © 2021, ABES Engineering College
Topics Covered
3
Copyright © 2021, ABES Engineering College
Session Plan - Day 5
Database Schema
Conceptual schema
Logical schema
Physical schema
External level schema/View level schema/Subschema
ER Modelling
Entities
Relationship
Attributes
4
Copyright © 2021, ABES Engineering College
Module Objective
Describe use and apply data analysis and Modelling Techniques i.e. data modelling
Software applications are created to manage data and to help transform data into information.
Database designing is a necessary step in the process of creating any complex software.
7
Copyright © 2021, ABES Engineering College
Database Schema
Database schemas are the blueprints that help developers visualize how databases should be built.
8
Copyright © 2021, ABES Engineering College
Data Abstraction
Data Abstraction refers to the process of hiding irrelevant details from the user.
Example: When we send mail through Gmail , we need not to know the details of the server located.
This detail is irrelevant for the mail sender.
9
Copyright © 2021, ABES Engineering College
Schema at different levels
Conceptual schema
Logical schema
Physical schema
External level schema/View level schema/Subschema
10
Copyright © 2021, ABES Engineering College
Conceptual Schema
The conceptual schema design provides:
It describes:
1. the things of significance to an organization (entity types),
2. its characteristics (attributes),
3. the associations between pairs of those things of significance (relationships).
Ex: ER Model
11
Copyright © 2021, ABES Engineering College
Logical Schema
It is a database design at conceptual level of the data abstraction
Steps:
1. Select Data Model ; ex: Relational , Object , Network , Hierarchical etc.
2. Transform Conceptual Model into selected Data Model ex: ER to Relational
3. Implement all constraints as per selected data model.
12
Copyright © 2021, ABES Engineering College
Physical Schema
Physical Schema is the database design at the physical level of data abstraction.
It describes how the data is organized in files, internal storage structure, and access paths.
The logical schema is mapped to the physical schema using DBMS tools selected as per selection of
data models in logical schema phase.
For Example : For RDMBS tools like Microsoft SQL Server, Oracle SQL, or IBM's DB2 etc.
13
Copyright © 2021, ABES Engineering College
View Schema or External Schema
It defines the design of the database at the view level of the data abstraction.
Example: For Car seller , only selling details are available at view level
For HR , only employee information is available at view level
14
Copyright © 2021, ABES Engineering College
Data Modelling Process
15
Copyright © 2021, ABES Engineering College
Can you answer ?
Q. ____________ means to hide certain details of how data is stored and maintain.
A. Data Isolation
B. Data Integrity
C. Data Abstraction
D. None of these
16
Copyright © 2021, ABES Engineering College
Can you answer ?
A. Physical Level
B. Conceptual Level
C. View Level
D. None of these
17
Copyright © 2021, ABES Engineering College
Can you answer ?
Q. ______ of abstraction explains how data is actually stored and describes the Data
Structure and Access methods used by database.
A. Conceptual Level
B. Physical Level
C. View Level
18
Copyright © 2021, ABES Engineering College
Can you answer ?
A. 2
B. 3
C. 4
D. 1
19
Copyright © 2021, ABES Engineering College
Can you answer ?
Q. Which one is correct statement?
20
Copyright © 2021, ABES Engineering College
ER Modelling Introduction
The entity-relationship (ER) data model describes data as entities, attributes and
relationships
21
Copyright © 2021, ABES Engineering College
ER Modelling Introduction
Example of a ER Diagram showing Entity , Attribute and Relationship
22
Copyright © 2021, ABES Engineering College
Entities
An entity is a real-world object which can be a person, place, or thing that can be uniquely
identified and distinguished from other objects.
Student Car
23
Copyright © 2021, ABES Engineering College
Entity Type
An entity type defines the set of entities having a common set of attributes.
Example: All the students in a college or university will have the same set of attributes, then
STUDENT becomes entity type.
24
Copyright © 2021, ABES Engineering College
Entity Set
The collection of entities of a particular entity type in the database is called an entity set at any
point in time.
Example:
Entity Type: STUDENT
Entity Set:
25
Copyright © 2021, ABES Engineering College
Entity Instance
26
Copyright © 2021, ABES Engineering College
Attributes
27
Copyright © 2021, ABES Engineering College
Types of Attributes
28
Copyright © 2021, ABES Engineering College
Types of Attributes (Cont.)
Key Attributes -
29
Copyright © 2021, ABES Engineering College
Types of Attributes (Cont.)
Multivalued attribute –
30
Copyright © 2021, ABES Engineering College
Types of Attributes (Cont.)
Composite Attribute –
Use rounded brackets to represent such attributes inside the oval shape.
31
Copyright © 2021, ABES Engineering College
Types of Attributes (Cont.)
Derived Attribute –
32
Copyright © 2021, ABES Engineering College
Can you answer ?
A. Database Programming
B. Organizing Databases
C. Designing Databases
D. None of the above
33
Copyright © 2021, ABES Engineering College
Can you answer ?
Q. Entity is a _________
A. Object of relation
B. Present working model
C. Thing in real world
D. Model of relation
34
Copyright © 2021, ABES Engineering College
Can you answer ?
Q. An Entity Set is
A. a set of entities of the same type that share the same properties
B. a set of entities of different type that share the same properties
C. a set of entities of different type that share the different properties
D. None of the above
35
Copyright © 2021, ABES Engineering College
Can you answer ?
Q. An attribute which can have many values for a single entity is called as
A. Composite Attribute
B. Descriptive Attribute
C. Derived Attribute
D. Multivalued Attribute
36
Copyright © 2021, ABES Engineering College
Can you answer ?
A. Phone_number
B. Name
C. Date_of_birth
D. All of the mentioned
37
Copyright © 2021, ABES Engineering College
Can you answer ?
A. Simple attribute
B. Composite attribute
C. Multivalued attribute
D. Derived attribute
38
Copyright © 2021, ABES Engineering College
Can you answer ?
39
Copyright © 2021, ABES Engineering College
Type of Entity Types
40
Copyright © 2021, ABES Engineering College
Strong Entity Type
41
Copyright © 2021, ABES Engineering College
Weak Entity Type
An entity type may not have a key attribute(s) to uniquely identify each entity
instance. Such an entity type is termed as a weak entity type.
Example : Section (As section does not have its own key attribute) , so section is a weak entity set.
Weak Entity must be associated with another entity type, called the identifying or owner entity
type.
A weak entity type has a partial key, which is the attribute that can uniquely identify weak
entities that are related to the same owner entity.
Example: Section_name is the partial key of the Section weak entity as a section name uniquely identifies
one single section for that department.
42
Copyright © 2021, ABES Engineering College
Weak Entity Type (Cont.)
43
Copyright © 2021, ABES Engineering College
Can you answer ?
A. Strong
B. Weak
C. Dependent
D. Variant
44
Copyright © 2021, ABES Engineering College
Can you answer ?
A. Underline
B. Double line
C. Double diamond
D. Double rectangle
45
Copyright © 2021, ABES Engineering College
Can you answer ?
A. Identifying set
B. Owner set
C. Neighbour set
D. Strong entity set
46
Copyright © 2021, ABES Engineering College
Relationship
When two or more entity types are linked together to manage the related information, such
linkage is called relationship.
Example: Every STUDENT belongs to a DEPARTMENT. These two entities have a relationship.
Use a diamond symbol to create the relationship between the entity types.
47
Copyright © 2021, ABES Engineering College
Relationship (Cont.)
48
Copyright © 2021, ABES Engineering College
Relationship Type
When two or more entity types are linked together to manage the related information, then such
linkage is called a relationship type.
Example: Every STUDENT belongs to a DEPARTMENT. These two entities have a relationship
type – "BELONGS TO“
Use the diamond symbol to create the relationship type between the entity types.
49
Copyright © 2021, ABES Engineering College
Relationship instance and a Relationship Set
A relationship instance is an instance that associates an entity instance from an entity type to
another entity instance of another entity type to establish a relationship among various
participating entity types.
A relationship set is the set of all relationship instances that participates in any relationship type
to define a relationship between various participating entity types.
50
Copyright © 2021, ABES Engineering College
Relationship Degree
The degree of a relationship type is the number of participating entity types. Hence, the
BELONGS TO relationship is of degree two has only two participating entity types, i.e.,
STUDENT and DEPARTMENT.
A relationship of degree two is called binary. A relationship type with degree three is called a
ternary relationship.
51
Copyright © 2021, ABES Engineering College
Role Names and Recursive Relationships
The role name signifies the role that a participating entity from the entity type plays in each
relationship instance and helps to explain what the relationship means.
Example- In the BELONGS TO relationship type, STUDENT plays the role of a student, and
DEPARTMENT plays the role of an academic department.
The role name becomes essential when the same entity type participates more than once in a relationship
type in different roles.
Such relationship types are called recursive relationships.
52
Copyright © 2021, ABES Engineering College
Role Names and Recursive Relationships (Cont.)
Example:
The WORKS FOR relationship type is a recursive relationship type.
It relates HOD and faculty entity type.
HOD and faculty entities are members of the same FACULTY entity set.
The faculty entity type participates twice in WORKS FOR, once in the role of a FACULTY and other in the
role of a HOD.
53
Copyright © 2021, ABES Engineering College
Attribute attached to a relationship type
A relationship type can also have attributes attached with it which are called descriptive
attributes.
54
Copyright © 2021, ABES Engineering College
Can you answer ?
55
Copyright © 2021, ABES Engineering College
Can you answer ?
Q. The function that an entity plays in a relationship is called that entity’s _________
A. Participation
B. Position
C. Role
D. Instance
56
Copyright © 2021, ABES Engineering College
Can you answer ?
A. Diamond , diamond
B. Rectangle, diamond
C. Rectangle, rectangle
D. Diamond, rectangle
57
Copyright © 2021, ABES Engineering College
Thank You
58
Copyright © 2021, ABES Engineering College