Entity Relationship Model: Bikash Chhetri
Entity Relationship Model: Bikash Chhetri
BIKASH CHHETRI
DATA MODEL
• Data models are collection of concepts for describing data, data relationship, data schematics and the
consistency constraints.
TYPES OF DATA MODEL
• Relational model
• Network model
• Hierarchical model
OBJECT BASED LOGICAL MODEL
1. ER Model describes data as entities relationship attributes and represents the logical structure of the
database.
2. An ER model is a design or blueprint of a database that can later be implemented as a database.
3. The main components of E-R model are: entity set and relationship set.
AS SHOWN IN THE ABOVE DIAGRAM, AN ER
DIAGRAM HAS THREE MAIN COMPONENTS:
1. Entity
2. Attribute
3. Relationship
ATTRIBUTES
1. Key attribute
2. Composite attribute
3. Multivalued attribute
4. Derived attribute
KEY ATTRIBUTE
• A derived attribute is one whose value is dynamic and derived from another attribute.
• It is represented by dashed oval in an ER Diagram.
• For example – Person age is a derived attribute as it changes over time and can be derived from
another attribute (Date of birth).
1. Integer
2. Character
3. Float
4. Date
5. BLOB
INTEGER
• Integer – is a whole number that can have a positive, negative or zero value. It cannot be a fraction nor
can have decimal places. It is commonly used in programming especially for increasing values.
CHARACTER
• Character – refers to any number, letter, space or symbol that can be entered in a computer. Each
character occupies one byte of space.
FLOAT
• Floating Point Number – is a number that contains decimals. Numbers that contain fractions are also
considered as floating point numbers.
DATE
• BLOB stands for binary large Object and this attribute type is used for storing information such as image,
multimedia or bits of code in a filed.
Entity
• An entity can be a person, place, event, or object that is relevant to a given system.
• For example, a school system may include students, teachers, major courses, subjects, fees, and other
items.
• Entities are represented in ER diagrams by a rectangle.
Weak Entity
• A weak entity is an entity that depends on the existence of another entity.
1. Super key
2. Candidate key
3. Primary key
SUPER KEY
1. A super key is a group of single or multiple keys which identifies rows in a table.
2. A Super key may have additional attributes that are not needed for unique identification.
Example:-
• PRIMARY KEY is a column or group of columns in a table that uniquely identify every row in that table.
The Primary Key can't be a duplicate meaning the same value can't appear more than once in the table.
A table cannot have more than one primary key.
Example:
In the following example, <code>StudID</code> is a Primary Key.
• One-to-one − When only one instance of an entity is associated with the relationship, it is
marked as '1:1
One-to-many − When more than one instance of an
entity is associated with a relationship, it is marked as
'1:N'.