Faculty of Engineering and Technology
Parul Institute of Technology
Department of Computer Science & Engineering
Course: B.Tech – CSE
Subject: Database Management System
Unit 3
Data Models
:Overview:
• Introduction to E-R Diagram
• Notations used in E-R Diagram
• Entity and Entity Set
• Attribute and Types of Attribute
• Relationship
• Specialization
• Generalization
• Aggregation
• Definition of Data Model
• Hierarchical Model
• Network Model
• Object Oriented Model
:Introduction to E-R Diagram:
• The entity-relationship (E-R) data model uses a collection of basic objects, called
entities, and relationships among these objects.
• Components of E-R Diagram:
1. Entities
2. Attributes
3. Relationship
• Extended E-R Diagram can consists:
1. Specialization
2. Generalization
3. Aggregation
:Notations used in E-R Diagram:
Description Symbol
Entity Set
Attribute/Single valued Attribute
Weak Entity Set
Multi valued Attribute
Relationship
Derived Attribute
Relationship for Weak Entity Set
:Notations used in E-R Diagram:
Description Notation
Many to Many Relationship
Many to One Relationship
One to One Relationship
ISA (Generalization or Specialization)
Discriminator
Primary Key
:Entity & Entity Set:
• Entity: An entity is a thing or an object in the real world that is
distinguishable from all other objects.
• Entity Set: It groups together a set of objects characterized by the
same feature.
• Example: The set of all the departments is an entity set. Different
departments are entities.
:Strong Entity Set:
• An entity set having sufficient attributes to retrieve or derive the
information uniquely, is known as “Strong Entity Set”.
:Weak Entity Set:
• An entity set may not have sufficient attributes to retrieve or derive
the information uniquely, is known as “Weak Entity Set”.
• For a weak entity set to be meaningful, it must be associated with
another entity set, known as “Identifier Entity Set” or “Owner Entity
Set”.
• The discriminator of weak entity set is a set of attributes that allows
distinction to be made to retrieve the meaningful and unique
information.
:Attribute:
• An attribute is a piece of information about entities.
• For each attribute, there is a permitted set of values called domain of
that attribute.
• Example: Enrollment Number is used to uniquely identify the
students.
:Types of Attribute:
Types of Attributes
Simple/Atomic
Composite
Multi-Valued
Single-Valued
Stored
Retrieved
• Attributes that are not divisible into subparts are known as “Simple or
Atomic Attributes.”
• Example:
Enrollment Number, Customer ID
:Simple/Atomic Attribute:
• Attributes that can be divisible into subparts are known as
“Composite Attributes.”
• Example:
Address – House Number, Street Name, City, State, Postal Code.
Full Name – First Name, Middle Name, Last Name
:Composite Attribute:
• Attributes that can have a single value for each entity, are known as
“Single Valued Attributes.”
• Example:
A car has only one model
A student has only one enrollement number
A student has only one date of birth
An employee has only one date of birth
:Single Valued Attribute:
:Multi Valued Attribute:
• Attributes that can have more than one values for each entity, are
known as “Multi Valued Attributes.”
• Example:
A doctor may have more than one speciality
A student may have more than one mobile number
• Attributes that can be calculated using the value of another attribute,
are known as “Derived Attributes.”
• The attribute that is used to derive the attribute, is known as “Stored
Attribute.”
• Example:
Date of Birth is a stored attribute.
Age is a derived attribute.
:Derived and Stored Attribute:
• Relationship is defined as an association among several entities.
• Relationship may be of four different types:
• One to One : Enrollment Number – Student
• One to Many : University – Cell
• Many to Many : Employee – Project
• Many to One : Employee - University
:Relationship:
• An entity set may include subgrouping of entities that are distinct in
some way from other entities in the set.
• The process of subgrouping within an entity set is known as
“Specialization”.
• Example: An entity set “Account” may be further classified as “Savings
Account” and “Current Account”.
• It is a Top to Bottom approach.
:Specialization:
• The process of forming containment relationship between a higher
level entity set and one or more lower level entity sets, is known as
“Generalization”.
• We can express the similarities between the entity sets using
generalization.
• It is a Bottom to Top approach.
:Generalization:
• When the E-R model can not express relationships among
relationships, Aggregation comes into the picture.
• A relationship with its corresponding entities is aggregated into a
higher level entity.
:Aggregation:
• A collection of conceptual tools for describing data, data
relationships, data semantics, and consistency constraints is known as
“Data Model”.
:Definition of Data Model:
• This model uses a hierarchical tree structure to organize the data.
• The hierarchy begins at the root, which contains root data, and then
grows into a tree as child nodes are added to the parent node.
• This model accurately shows several real-world relationships such as
website sitemaps.
:Hierarchical Model:
:Pros & Cons of Hierarchical Model:
• Pros of Hierarchical Model
• A tree-like structure is incredibly straightforward and quick to navigate.
• Any modification to the parent node is reflected automatically in the child node,
ensuring data integrity.
• Cons of Hierarchical Model
• Relationships that are complex are not supported.
• Because it only supports one parent per child node, if we have a complex
relationship in which a child node needs to have two parents, we won’t be able to
describe it using this model.
• When a parent node is removed, the child node is removed as well.
:Network Model:
• The hierarchical model is extended in the network model.
• To increase database performance and standards, the network model
was devised to express complicated data relationships more
effectively than hierarchical models.
:Pros & Cons of Network Model:
• Pros of Network Model
• Data can be retrieved faster. This is because the data in the network model is more
related, and there may be more than one path to a given node.
• Data integrity is present since there is a parent-child relationship. Any changes to the
parent record are mirrored in the child record.
• Cons of Network Model
• As the number of relationships to be managed grows, the system may get increasingly
complicated. To operate with the model, a user must have a thorough understanding of it.
• Any alteration, such as an update, deletion, or insertion, is difficult.
• Today the concept of objects is well integrated into relational databases. This can be seen as
extending the relational model with notions of encapsulation, methods, and object identity.
• Three approaches are used in practice for integrating object orientation with database systems:
1. Build an object-relational database system, which adds object-oriented features to a relational
database system.
2. Automatically convert data from the native object-oriented type system of the programming
language to a relational representation for storage, and vice versa for retrieval. Data conversion is
specified using an object-relational mapping.
3. Build an object-oriented database system, that is, a database system that natively supports an
object-oriented type system and allows direct access to data from an object-oriented programming
language using the native type system of the language.
:Object Oriented Model:
:Short Questions:
1. What is Hierarchical data model? What are the advantages and limitations of Hierarchical data model?
2. What is Network data model? What are the advantages and limitations of Network data model?
3. Explain Object Oriented data model briefly.
4. Define the following:
1. Data Model
2. E-R Diagram
3. Aggregation
4. Specialization
5. Generalization
6. Entity
7. Strong Entity
8. Weak Entity
9. Relationship
10. Attribute
11. Single/Atomic Attribute
12. Composite Attribute
13. Stored Attribute
14. Derived Attribute
15. Single Valued Attribute
16. Multi Valued Attribute
:Long Questions:
1. Explain Generalization and Specialization with a suitable example.
2. Define Attribute. Give Classification of Attribute. Explain each type
with a suitable example.
3. Define E-R diagram. Enlist different notations used in E-R diagram.

dbms ppt parul university dbms course for

  • 1.
    Faculty of Engineeringand Technology Parul Institute of Technology Department of Computer Science & Engineering Course: B.Tech – CSE Subject: Database Management System
  • 2.
  • 3.
    :Overview: • Introduction toE-R Diagram • Notations used in E-R Diagram • Entity and Entity Set • Attribute and Types of Attribute • Relationship • Specialization • Generalization • Aggregation • Definition of Data Model • Hierarchical Model • Network Model • Object Oriented Model
  • 4.
    :Introduction to E-RDiagram: • The entity-relationship (E-R) data model uses a collection of basic objects, called entities, and relationships among these objects. • Components of E-R Diagram: 1. Entities 2. Attributes 3. Relationship • Extended E-R Diagram can consists: 1. Specialization 2. Generalization 3. Aggregation
  • 5.
    :Notations used inE-R Diagram: Description Symbol Entity Set Attribute/Single valued Attribute Weak Entity Set Multi valued Attribute Relationship Derived Attribute Relationship for Weak Entity Set
  • 6.
    :Notations used inE-R Diagram: Description Notation Many to Many Relationship Many to One Relationship One to One Relationship ISA (Generalization or Specialization) Discriminator Primary Key
  • 7.
    :Entity & EntitySet: • Entity: An entity is a thing or an object in the real world that is distinguishable from all other objects. • Entity Set: It groups together a set of objects characterized by the same feature. • Example: The set of all the departments is an entity set. Different departments are entities.
  • 8.
    :Strong Entity Set: •An entity set having sufficient attributes to retrieve or derive the information uniquely, is known as “Strong Entity Set”.
  • 9.
    :Weak Entity Set: •An entity set may not have sufficient attributes to retrieve or derive the information uniquely, is known as “Weak Entity Set”. • For a weak entity set to be meaningful, it must be associated with another entity set, known as “Identifier Entity Set” or “Owner Entity Set”. • The discriminator of weak entity set is a set of attributes that allows distinction to be made to retrieve the meaningful and unique information.
  • 10.
    :Attribute: • An attributeis a piece of information about entities. • For each attribute, there is a permitted set of values called domain of that attribute. • Example: Enrollment Number is used to uniquely identify the students.
  • 11.
    :Types of Attribute: Typesof Attributes Simple/Atomic Composite Multi-Valued Single-Valued Stored Retrieved
  • 12.
    • Attributes thatare not divisible into subparts are known as “Simple or Atomic Attributes.” • Example: Enrollment Number, Customer ID :Simple/Atomic Attribute:
  • 13.
    • Attributes thatcan be divisible into subparts are known as “Composite Attributes.” • Example: Address – House Number, Street Name, City, State, Postal Code. Full Name – First Name, Middle Name, Last Name :Composite Attribute:
  • 14.
    • Attributes thatcan have a single value for each entity, are known as “Single Valued Attributes.” • Example: A car has only one model A student has only one enrollement number A student has only one date of birth An employee has only one date of birth :Single Valued Attribute:
  • 15.
    :Multi Valued Attribute: •Attributes that can have more than one values for each entity, are known as “Multi Valued Attributes.” • Example: A doctor may have more than one speciality A student may have more than one mobile number
  • 16.
    • Attributes thatcan be calculated using the value of another attribute, are known as “Derived Attributes.” • The attribute that is used to derive the attribute, is known as “Stored Attribute.” • Example: Date of Birth is a stored attribute. Age is a derived attribute. :Derived and Stored Attribute:
  • 17.
    • Relationship isdefined as an association among several entities. • Relationship may be of four different types: • One to One : Enrollment Number – Student • One to Many : University – Cell • Many to Many : Employee – Project • Many to One : Employee - University :Relationship:
  • 18.
    • An entityset may include subgrouping of entities that are distinct in some way from other entities in the set. • The process of subgrouping within an entity set is known as “Specialization”. • Example: An entity set “Account” may be further classified as “Savings Account” and “Current Account”. • It is a Top to Bottom approach. :Specialization:
  • 19.
    • The processof forming containment relationship between a higher level entity set and one or more lower level entity sets, is known as “Generalization”. • We can express the similarities between the entity sets using generalization. • It is a Bottom to Top approach. :Generalization:
  • 20.
    • When theE-R model can not express relationships among relationships, Aggregation comes into the picture. • A relationship with its corresponding entities is aggregated into a higher level entity. :Aggregation:
  • 22.
    • A collectionof conceptual tools for describing data, data relationships, data semantics, and consistency constraints is known as “Data Model”. :Definition of Data Model:
  • 23.
    • This modeluses a hierarchical tree structure to organize the data. • The hierarchy begins at the root, which contains root data, and then grows into a tree as child nodes are added to the parent node. • This model accurately shows several real-world relationships such as website sitemaps. :Hierarchical Model:
  • 24.
    :Pros & Consof Hierarchical Model: • Pros of Hierarchical Model • A tree-like structure is incredibly straightforward and quick to navigate. • Any modification to the parent node is reflected automatically in the child node, ensuring data integrity. • Cons of Hierarchical Model • Relationships that are complex are not supported. • Because it only supports one parent per child node, if we have a complex relationship in which a child node needs to have two parents, we won’t be able to describe it using this model. • When a parent node is removed, the child node is removed as well.
  • 25.
    :Network Model: • Thehierarchical model is extended in the network model. • To increase database performance and standards, the network model was devised to express complicated data relationships more effectively than hierarchical models.
  • 26.
    :Pros & Consof Network Model: • Pros of Network Model • Data can be retrieved faster. This is because the data in the network model is more related, and there may be more than one path to a given node. • Data integrity is present since there is a parent-child relationship. Any changes to the parent record are mirrored in the child record. • Cons of Network Model • As the number of relationships to be managed grows, the system may get increasingly complicated. To operate with the model, a user must have a thorough understanding of it. • Any alteration, such as an update, deletion, or insertion, is difficult.
  • 27.
    • Today theconcept of objects is well integrated into relational databases. This can be seen as extending the relational model with notions of encapsulation, methods, and object identity. • Three approaches are used in practice for integrating object orientation with database systems: 1. Build an object-relational database system, which adds object-oriented features to a relational database system. 2. Automatically convert data from the native object-oriented type system of the programming language to a relational representation for storage, and vice versa for retrieval. Data conversion is specified using an object-relational mapping. 3. Build an object-oriented database system, that is, a database system that natively supports an object-oriented type system and allows direct access to data from an object-oriented programming language using the native type system of the language. :Object Oriented Model:
  • 28.
    :Short Questions: 1. Whatis Hierarchical data model? What are the advantages and limitations of Hierarchical data model? 2. What is Network data model? What are the advantages and limitations of Network data model? 3. Explain Object Oriented data model briefly. 4. Define the following: 1. Data Model 2. E-R Diagram 3. Aggregation 4. Specialization 5. Generalization 6. Entity 7. Strong Entity 8. Weak Entity 9. Relationship 10. Attribute 11. Single/Atomic Attribute 12. Composite Attribute 13. Stored Attribute 14. Derived Attribute 15. Single Valued Attribute 16. Multi Valued Attribute
  • 29.
    :Long Questions: 1. ExplainGeneralization and Specialization with a suitable example. 2. Define Attribute. Give Classification of Attribute. Explain each type with a suitable example. 3. Define E-R diagram. Enlist different notations used in E-R diagram.