2. FEATURES OF E-R MODEL
• ER Model is a high-level conceptual data model.
• It allows us to describe the data involved in a real-world enterprise in term of objects
and their relationships.
• It is widely used to develop an initial design of a database.
• It provides a set of useful concepts that make it convenient for a developer to move
from a basic set of information to a detailed and precise description of information
that can be easily implemented in a database system.
• It describes data as a collection of entities , relationships and attributes.
3. Example -:
College is a database keeps track of Students ,faculty , departments and courses organized
by various departments. College contains various departments like Department of English,
Department of Hindi , Department of Computer Science etc. Each department assigned a
unique id and name. Some faculty members are also appointed to each department and one
of them works as head of the department.
1. Faculty information contains name , address , department , basic salary etc. A faculty
member is assigned to only one department but can teach various courses of other
department also.
2. Student information contain Roll no (unique) ,name , address etc. A student can opt only
one course.
3. Parent (guardian) information is also kept along with each student. We keep each
guardian’s name ,age ,sex and address.
4. • Entity-:
1. It is an object of concern used to represent the things in the real world, eg.
Car, table , book etc.
2. An entity need not be a physical entity, it can also represent a concept in
real world eg. Project , loan.
3. It represent a class of things , not any one instance, eg. Student entity has
instance of ‘Ramesh’ and ‘Mohan’.
• Strong Entity -: It contain primary key.
• Weak Entity-: It does not contain primary key.
• Entity set – A collection of a entities is called an entity set.
• Attributes: An attributes is a properly used to describe the specific features of the
entity. Eg: A Student entity may be described by the student’s name , age , address
and course etc.
6. • Domains:
Each simple attributes of an entity type contains a possible set of values that can be attached to it.
This is called the domain of attributes. Ex-: for person entity person_id has a specific domain ,
integer values say from 1 to 100.
Types of Attributes
• Simple: The attribute that can not be further divided into smaller parts and represents the basic
meaning is called a simple attribute. For example : first name , last name , age.
• Composite: Attributes that can be further divided into smaller units and each individual unit
contain a specific meaning. For example : Name attributes of employee can be sub divided into
fname , lname and mname.
• Single Valued: Attributes having a single value for a particular entity. For example age is single
valued attribute of a student entity.
• Multivalued: Attributes that have more than one values for a particular entity is called
multivalued attribute. For multivalued attributes we must also specify the minimum and maximum
number of values that can be attached. For ex phone number for a person entity is a multivalued
attributes.
7. • Stored: Attributes that are directly stored in the database. For ex Birth date attributes of a person.
• Derived: Attributes that are not stored directly but can be derived from stored attributes are called
derived attributes. For example: The year of services of a person entity can be determined from the
current date and the date of joining of the person. Another example total salary of the person can
be calculated from the basic salary attributes of a person.
Relationships
• A connection or set of association.
• A rule for communication among entities.
Example : College is the database , the association between student and course entity, ie “Student opts
course” is an example of a relationship.
• Degree: The degree of a relationship type is the number of participating entity types.
• Binary Relationship: The relationship between two entities is called binary relationship.
• Ternary Relationship: A relationship among three entities is called ternary relationship.
• N-ry Relationship: Relationship among n entities.
10. Relationship Cardinality:
Cardinality specifies the number of instances of an entity associated with another entity
participating in a relationship. there are following degree of cardinality:
• One to One: An entity in A is associated with at most one entity in B, and an entity B is
associated with at most one entity in A. ex: Relationship between college and principal.
• One to Many: An entity in A is associated with any number of entities in B. An entity B is
associated with at the most one entity in A. ex: department and faculty relationship.
• Many to One: An entity in A is associated with at most one entity in B. An entity in B is
associated with any number in A. ex: Relationship between course and instructor.
• Many to Many: Entities in A and B are associated with any number of entities from each
other ex: relationship between course and faculty, book writes author.
17. GENERALIZATION
Generalization is the process of extracting common properties from a set of entities and create a
generalized entity from it. It is a bottom-up approach in which two or more entities can be generalized to
a higher level entity if they have some attributes in common. For Example, STUDENT and FACULTY can be
generalized to a higher level entity called PERSON as shown in Figure 1. In this case, common attributes
like P_NAME, P_ADD become part of higher entity (PERSON) and specialized attributes like S_FEE become
part of specialized entity (STUDENT).
18. SPECIALIZATION
In specialization, an entity is divided into sub-entities based on their characteristics. It is a top-down
approach where higher level entity is specialized into two or more lower level entities. For Example,
EMPLOYEE entity in an Employee management system can be specialized into DEVELOPER, TESTER etc.
In this case, common attributes like E_NAME, E_SAL etc. become part of higher entity (EMPLOYEE) and
specialized attributes like TES_TYPE become part of specialized entity (TESTER).
19. AGGREGATION
An ER diagram is not capable of representing relationship between an entity and a relationship which
may be required in some scenarios. In those cases, a relationship with its corresponding entities is
aggregated into a higher level entity. For Example, Employee working for a project may require some
machinery. So, REQUIRE relationship is needed between relationship WORKS_FOR and entity
MACHINERY. Using aggregation, WORKS_FOR relationship with its entities EMPLOYEE and PROJECT is
aggregated into single entity and relationship REQUIRE is created between aggregated entity and
MACHINERY.
20. Inheritance
• We use all the above features of ER-Model in order to create classes of objects in object-
oriented programming. The details of entities are generally hidden from the user; this process
known as abstraction.
• Inheritance is an important feature of Generalization and Specialization. It allows lower-level
entities to inherit the attributes of higher-level entities.