DATA MODELS - ER Model
DATA MODELS - ER Model
• Relational Model is not suitable for huge database but suitable for small database.
Object database can handle different types of data while relational data
base handles a single data.
• A weak entity set is an entity set that does not contain sufficient
attributes to uniquely identify its entities.
• In other words, a primary key does not exist for a weak entity set.
• However, it contains a partial key called as a discriminator.
• Example
• All the attributes are simple attributes as they
can not be divided further.
• Example
• The attributes “Name” and “Address” are
composite attributes as they are composed of
many other simple attributes.
• Example
• All the attributes are single valued attributes
as they can take only one specific value for
each entity.
• Example
• The attributes “Mob_no” and “Email_id” are
multi valued attributes as they can take more
than one values for a given entity.
• Example
• The attribute “Age” is a derived attribute as it
can be derived from the attribute “DOB”.
• Example
• The attribute “Roll_no” is a key attribute as it
can identify any student uniquely.
• Example :
• In a university there may be thousands of students,
which have enrolled in a few subjects each year.
Database Management Systems 67
EXAMPLE
• EXAMPLE:
• A teacher teaches a subject here 2 entities are teacher
and subject for the relationship teacher teaches
subject
Database Management Systems 74
EXAMPLE
• EXAMPLE:
• A patient goes to a doctor and doctor prescribes the medicine to the
patient, three entities Doctor, patient and medicine are involved in the
relationship “prescribes”
• EXAMPLE:
• A patient goes to a doctor and doctor prescribes the medicine and
diagnosis to the patient, four entities Doctor, patient and medicine,
diagnostics are involved in the relationship “prescribes”
• EXAMPLE:
• Student can be a class monitor and handle other students but a person
who is working as a class leader is itself a student of the class and hence
a class monitor has a recursive relationship of entity student
• EXAMPLE:
• Many students can study in a single college but the
student cannot apply to more than one college at the
same time
• EXAMPLE:
• One course can be taken by any number of
students but only one course can be allotted to
one student
Database Management Systems 92
EXAMPLE
• EXAMPLE:
• A student can take more than one course and the
single course can be taken by any number of
students this relationship will be many to many
relationship
• In a Relationship, Participation
constraint specifies the presence of an entity
when it is related to another entity in a
relationship type.
• EXAMPLE
• The university forces, you to necessarily enrol in atleast 1
course, in that case it will be called total participation that
student end.
• EXAMPLE
• In university there might be some courses where enrollments
are not made
• EXAMPLE:
• In a bank there are two different types of accounts – Current and Savings,
combine to form a super entity Account.
• It may also be possible that the higher level entity may also combine with
further entity to form a one more higher level entity.
• EXAMPLE
• Employee may be decomposed to further as current employee entity and ex employee
entity.
• EXAMPLE
• University offering course can be considered a same entity, when viewed
from a student entity perspective.
• EXAMPLE
• If students visit a coaching institute then he
shows interest not only to inquire about the
course alone or not only just coaching centre,
he will definitely enquire the details about
both the coaching institute and the details of
the concerned course
Relational Schema
Student(student_id, stu_name, gender)
Relational Schema
Student(student_id, FirstName, LastName, Street,City)