1 DATABASE MANAGEMENT SYSTEM
UNIT-2
E R MODEL
ENTITY :
• An entity is an real-word object, either animate or in animate, that be easily
identifiable.
Ex: In school database, Students, Teachers, Classes and Courses offered can be
considered as entities.
• Kinds of entity:
1. Tangiable entity: it is an entity in DBMS, which is a physical object that we can
touch or see.
Ex: mobile, watches.
2. Untangiable entity: it is an entity in DBMS, which is a non-physical object that we
cannot see or touch.
Ex: a bank account.
• An entity set is a collection of similar type of entites
• An entity set may contain entities with attributes sharing similar values.
• Types of entity sets are:
Strong entity
Weak entity
ATTRIBUTES:
• It defines the properties of an entity.
For example: Emp_id, Ename, Salary, Job are the properties/attributes of employee table.
• An entity set may contain any number of attributes.
• Attributes are represented in an elliptical shape.
• TYPES OF ATTRIBUTES :
PSSSHE DAVANGERE
,2 DATABASE MANAGEMENT SYSTEM
1. SIMPLE OR ATOMIC ATTRIBUTES:
• It is defined as an attribute that is composed of a single component with an
independent existence.
• Simple attribute cannot be further sub divided.
Example: Age, Salary, person_id.
2. COMPOSITE ATTRIBUTE:
• A composite attribute is defined as an attribute composed of multiple
components each with an independent existence.
• Some attributes can be further divided into smaller components with the
independent existence of their own.
For Example: Attribute Name can further be sub divided into First_name,
middle_name, Last_name.
3. SINGLE-VALUED ATTRIBUTE:
• It is defined as an attribute that holds single value for a single entity.
• The majority of an attribute are single valued for a particular entity.
For Example: Roll_no.
4. MULTI-VALUED ATTRIBUTE:
• It is defined as an attribute that holds multiple values for a single entity.
• A multi valued attribute may have a set of numbers with upper and lower
limits
For Example: For a student entity, if one attribute is hobby than hobby can have
multiple values like reading, dancing, gardening and so on.
5. DERIVED ATTRIBUTE:
• It is derived as an attribute that represents a value of related attribute or a set
of attributes, not essentially in the same entity.
For Example: the value of age can derive from date-of-birth attribute.
6. PRIMARY KEY ATTRIBUTE:
• Primary key is a unique identifier for each record in the table.
• It ensures data integrity and provides a way to uniquely identify and access
individual records.
CHARACTERISTICS:
➤ Uniqueness, Not null constraint, Single-valued.
RELATIONSHIP:
• Relationship refers to association between the two entity sets.
• TYPES OF RELATIONSHIP:
MAPPING CARDINALITIES:
• Mapping cardinalities or cardinality ratio, express the number of entities to which
another entity can be associated via a relationship set.
• The mapping cardinalities must be one of the following:
1. ONE-TO-ONE:
• An entity in entity E1 is associated with at most one entity in E2.
• An entity in entity E2 is associated with at most one entity in E1.
PSSSHE DAVANGERE
, 3 DATABASE MANAGEMENT SYSTEM
2. ONE-TO-MANY:
• An entity in entity E1 is associated with any number of entities in E2.
• An entity in entity E2 is associated with at most one entity in E1.
3. MANY-TO-ONE:
• An entity in entity E1 is associated with at most one entity in E2.
• An entity in entity E2 can be associated with any number of entities in E1.
PSSSHE DAVANGERE
UNIT-2
E R MODEL
ENTITY :
• An entity is an real-word object, either animate or in animate, that be easily
identifiable.
Ex: In school database, Students, Teachers, Classes and Courses offered can be
considered as entities.
• Kinds of entity:
1. Tangiable entity: it is an entity in DBMS, which is a physical object that we can
touch or see.
Ex: mobile, watches.
2. Untangiable entity: it is an entity in DBMS, which is a non-physical object that we
cannot see or touch.
Ex: a bank account.
• An entity set is a collection of similar type of entites
• An entity set may contain entities with attributes sharing similar values.
• Types of entity sets are:
Strong entity
Weak entity
ATTRIBUTES:
• It defines the properties of an entity.
For example: Emp_id, Ename, Salary, Job are the properties/attributes of employee table.
• An entity set may contain any number of attributes.
• Attributes are represented in an elliptical shape.
• TYPES OF ATTRIBUTES :
PSSSHE DAVANGERE
,2 DATABASE MANAGEMENT SYSTEM
1. SIMPLE OR ATOMIC ATTRIBUTES:
• It is defined as an attribute that is composed of a single component with an
independent existence.
• Simple attribute cannot be further sub divided.
Example: Age, Salary, person_id.
2. COMPOSITE ATTRIBUTE:
• A composite attribute is defined as an attribute composed of multiple
components each with an independent existence.
• Some attributes can be further divided into smaller components with the
independent existence of their own.
For Example: Attribute Name can further be sub divided into First_name,
middle_name, Last_name.
3. SINGLE-VALUED ATTRIBUTE:
• It is defined as an attribute that holds single value for a single entity.
• The majority of an attribute are single valued for a particular entity.
For Example: Roll_no.
4. MULTI-VALUED ATTRIBUTE:
• It is defined as an attribute that holds multiple values for a single entity.
• A multi valued attribute may have a set of numbers with upper and lower
limits
For Example: For a student entity, if one attribute is hobby than hobby can have
multiple values like reading, dancing, gardening and so on.
5. DERIVED ATTRIBUTE:
• It is derived as an attribute that represents a value of related attribute or a set
of attributes, not essentially in the same entity.
For Example: the value of age can derive from date-of-birth attribute.
6. PRIMARY KEY ATTRIBUTE:
• Primary key is a unique identifier for each record in the table.
• It ensures data integrity and provides a way to uniquely identify and access
individual records.
CHARACTERISTICS:
➤ Uniqueness, Not null constraint, Single-valued.
RELATIONSHIP:
• Relationship refers to association between the two entity sets.
• TYPES OF RELATIONSHIP:
MAPPING CARDINALITIES:
• Mapping cardinalities or cardinality ratio, express the number of entities to which
another entity can be associated via a relationship set.
• The mapping cardinalities must be one of the following:
1. ONE-TO-ONE:
• An entity in entity E1 is associated with at most one entity in E2.
• An entity in entity E2 is associated with at most one entity in E1.
PSSSHE DAVANGERE
, 3 DATABASE MANAGEMENT SYSTEM
2. ONE-TO-MANY:
• An entity in entity E1 is associated with any number of entities in E2.
• An entity in entity E2 is associated with at most one entity in E1.
3. MANY-TO-ONE:
• An entity in entity E1 is associated with at most one entity in E2.
• An entity in entity E2 can be associated with any number of entities in E1.
PSSSHE DAVANGERE