topic covered in this video :-
Entity Relationship model unit -2 DATABASE DESIGN for computer science engineering in 4th sem
playlist of dbms subject :-
• Database Management system (DBMS) in ...
join to our telegram channel to download the pdf used in this video:
https://t.me/cseengineeringnotes
DATABASE MANAGEMENT SYSTEMS
unit-2
Entity-Relationship model
2
Course Outline:-
UNIT II DATABASE DESIGN
Entity-Relationship model
DATABASE DESIGN
A well-designed database shall:
Eliminate Data Redundancy:
the same piece of data shall not be stored in more than one place. This is because duplicate data not only
waste storage spaces but also easily lead to inconsistencies.
Ensure Data Integrity and Accuracy
4
Entity-Relationship Data Model
Classical, popular conceptual data model
First introduced(mid70’s)as a(relatively minor)improvement to the relational model:
pictorial diagrams are easier to read than relational database schemas
Then evolved as a popular model for the first conceptual representation of data
structures in the process of database design
5
ER Model: Entity and Entity Set
Considering the example,Student is an entity, Teacher is an entity,similarly,Class,
Subject etc are also entities.
An Entity is generally a real world object which has characteristics and holds
relationships in a DBMS.
If a Student is an Entity,then the complete dataset of all the students will be theEntity
Set.
6
ER Model: Attributes
If a Student is an Entity, then student's roll no., student's name, student's age,
student's gender etc will be its attributes.
An attribute can be of many types , here are different types of attributes defined in ERdatabase model:
-Simple attribute
-Composite attribute
-Derived attribute
-Single-valued attribute
-Multi-valued attribute
7
ER Model: Attributes
1. Simple attribute:
The attributes with values that are atomic and cannot be broken down further are simple attributes. For example, student's age.
2. Composite attribute:
A composite attribute is made up of more than one simple attribute. For example, student's address will contain, house no., street
name, pin code etc.
3. Derived attribute:
These are the attributes which are not present in the whole database management system, but are derived using other attributes. For
example, average age of students in a class.
4. Single-valued attribute:
As the name suggests, they have a single value.
5. Multi-valued attribute:
they can have multiple values.
8
ER Model: Relationships
When an Entity is related to another Entity, they are said to have a relationship. For
example, A Class Entity is related to Student entity, because students study in classes,
hence this is a relationship.
Depending upon the number of entities involved, a degree is assigned to relationships
. For example, if 2 entities are involved , it is said to be Binary relationship , if 3 entities
are involved, it is said to be Ternary relationship, and so on.
9
Working with ER Diagrams
ER Diagram is a visual representation of data that describes how data is related to
each other. In ER Model, we disintegrate data into entities, attributes and setup
relationships between entities, all this can be represented visually using the ER
diagram.
Components of ER Diagram
Entitiy , Attributes, Relationships etc form the components of ER Diagram and there are defined symbols
and shapes to represent each one of them. Let's see how we can represent these in our ER Diagram. Entity
Simple rectangular box represents an Entity.
10
Relationships between Entities - Weak and Strong
Rhombus is used to setup relationships between two or more entities.
Attributes for any Entity Ellipse is used to represent attributes of any entity. It is
connected to the entity.
11
Entity
Weak Entity: A weak Entity is represented using double rectangular boxes. It is
generally connected to another entity.
Key Attribute for any Entity: To represent a Key attribute, the attribute name inside
the Ellipse is underlined.
12
Attribute
Derived Attribute for any Entity: Derived attributes are those which are derived based
on other attributes, for example, age can be derived from date of birth. To represent a
derived attribute, another dotted ellipse is created inside the main ellipse.
Multivalued Attribute for any Entity: Double Ellipse, one inside another, represents the
attribute which can have multiple values.
13
Composite Attribute
Composite Attribute for any Entity : A composite attribute is the attribute, which also
has Attributes.
DATABASE MANAGEMENT SYSTEMS
THANKS FOR WATCHING
E-R Diagrams