Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

DBMS Modeul-2-ERD

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Entity-Relationship Model

Prof. Suja Jayachandran

Assistant Professor
Computer Engineering Department
Vidyalankar Institute of Technology
Introduction
• Data Model
Data Model gives an idea that how the final system will look like after its complete implementation.
It defines the data elements and the relationships between the data elements. Data Models are
used to show how data is stored, connected, accessed and updated in the database management
system.
• Some of the Data Models in DBMS are:
➢ Hierarchical Model
➢ Network Model
➢ Entity-Relationship Model
➢ Relational Model
➢ Object-Oriented Data Model
➢ Object-Relational Data Model
➢ Flat Data Model
➢ Semi-Structured Data Model
➢ Associative Data Model
➢ Context Data Model
ER Data Model
• The ER data model employs three basic concepts:
• entity sets,
• relationship sets,
• attributes
• Entity : It can be a real-world object with an existence, For example, in
a College database, the entities can be Professor, Students, Courses,
etc.
• Relationship : It is an association among several entities
• Attribute : Entities has attributes, which can be considered as
properties describing it, for example, for Professor entity, the
attributes are Professor_Name, Professor_Address,
Professor_Salary, etc. The attribute value gets stored in the database.
An attribute can also be associated with a relationship set.
Types of DBMS Entities
1.Strong Entity:The strong entity has a primary key. Weak entities are dependent
on strong entity. Its existence is not dependent on any other entity.

Professor Professor_ID

Eg:Professor is a strong entity here, and the primary key is Professor_ID.


2.Weak Entity: The weak entity in DBMS do not have a primary key and are
dependent on the parent entity. It mainly depends on other entities. The Strong
Entity is Professor, whereas
Dependent is a Weak Entity.
ID is the primary key (represented
with a line) and Name in Dependent
entity is called Partial Key (represented
with a dotted line).
Types of Attributes:
Attribute Example Representation in ERD
Simple Attribute Aadharcard_Number,Roll_Number
Roll_number
Composite Attribute: Address,Name(First,middle,lastname)
name
Last
First Middle name
name name
Single-value attributes Aadharcard_Number,Roll_Number

Multi-valued attributes Phone_Number,Email-id


Phone_number

Derived Attribute: can be Age from Date_of_Birth


computed from other Date_of_
attributes Birth

Descriptive Since attribute on works _for Works


Attribute:attribute of a relationship between two entity _for since
relationaship employee and department
• Keys:Keys play an important role in the relational database.
• It is used to uniquely identify any record or row of data from the table. It is also
used to establish and identify relationships between tables.
Type of Key Definition Example
Primary Key It is used to identify one and only one instance of an EMPLOYEE_ID
entity uniquely.
Candidate Key It is an attribute or set of an attribute which can uniquely Aadhar_Number,
identify a tuple. The remaining attributes except for Passport_Number
primary key are considered as a candidate key. The
candidate keys are as strong as the primary key.
Super Key It is a set of an attribute which can uniquely identify a EMPLOYEE-ID, (EMPLOYEE_ID,
tuple. Super key is a superset of a candidate key. EMPLOYEE-NAME),
Foreign Key Foreign keys are the column of the table which is used to In EMPLOYEE table, Department_Id is
point to the primary key of another table. the foreign key, and both the
tables(EMPLOYEE and DEPARTMENT
table) are related.

Surrogate Key An artificial key which aims to uniquely identify each Sr. No.
record is called a surrogate key. These kind of key are
unique because they are created when you don't have
any natural primary key.
• Types of Relationship

Type of Relationship Example

One to One Relationship

One to Many Relationship

Many to One Relationship

Many to Many Relationship


Total and Partial Participation
➢Total participation (indicated by double line): every entity in the entity set
participates in at least one relationship in the relationship set

• participation of student in advisor relation is total


• every student must have an associated instructor
➢Partial participation: some entities may not participate in any relationship
in the relationship set
• Example: participation of instructor in advisor is partial
• Extended ER Diagram(EER)

Generalization : A bottom-up design process –


combine a number of entity sets that share the same
features into a higher-level entity set

Specialization : A Top-down design process; we


designate sub-groupings within an entity set that are
distinctive from other entities in the set.
These sub-groupings become lower-level entity sets
that have attributes or participate in relationships that
do not apply to the higher-level entity set.
Aggregation is a process in which a single entity alone
is not able to make sense in a relationship so the
relationship of two entities acts as one entity
Example:ER Diagram for Hospital Management System

You might also like