Data models
• A data model is a collection of conceptual tools for describing data, data
relationships, data semantics, and consistency constraints.
• Data models provide a way to describe the design of a database at the logical level.
• The entity–relationship (E-R) model is a high-level data model. It is based on a
perception of a real world that consists of a collection of basic objects, called
entities, and of relationships among these objects.
• The relational model is a lower-level model. It uses a collection of tables to
represent both data and the relationships among those data.
• Today a vast majority of database products are based on the relational model.
• Designers often formulate database schema design by first modeling data at a high
level, using the E-R model, and then translating it into the relational model.
DBMS Database Models
• A Database model defines the logical design and structure of a database and
defines how data will be stored, accessed and updated in a database
management system.
• While the Relational Model is the most widely used database model, there are
other models too:
• Hierarchical Model
• Network Model
• Entity-relationship Model
• Relational Model
Hierarchical Model
• This database model organizes data into a tree-like-structure, with a single root, to
which all the other data is linked.
• The hierarchy starts from the Root data, and expands like a tree, adding child nodes to
the parent nodes.
• In this model, a child node will only have a single parent node.
• This model efficiently describes many real-world relationships like index of a book,
recipes etc.
• In hierarchical model, data is organized into tree-like structure with one one-to-many
relationship between two different types of data, for example, one department can
have many courses, many professors and of-course many students.
Hierarchical Model
Network Model
• This is an extension of the Hierarchical model. In this model data is organized
more like a graph, and are allowed to have more than one parent node.
• In this database model data is more related as more relationships are established
in this database model. Also, as the data is more related, hence accessing the data
is also easier and fast.
• This database model was used to map many-to-many data relationships.
• This was the most widely used database model, before Relational Model was
introduced.
Network Model
Relational Model
• The relational model uses a collection of tables to represent both
data and the relationships among those data.
• Each table has multiple columns, and each column has a unique
name.
Relational Model
• In this model, data is organised in two-dimensional tables and the relationship is
maintained by storing a common field.
• This model was introduced by E.F Codd in 1970, and since then it has been the most
widely used database model, infact, we can say the only database model used around the
world.
• The basic structure of data in the relational model is tables. All the information related to a
particular type is stored in rows of that table.
• Hence, tables are also known as relations in relational model.
Relational Model
• presents a sample relational database comprising three tables:
• One shows details of bank customers, the second shows accounts,
and the third shows which accounts belong to which customers.
• Each table contains records of a particular type.
• Each record type defines a fixed number of fields, or attributes.
• The columns of the table correspond to the attributes of the record
type
Relational Model
• The relational model is at a lower level of abstraction than the E-R
model.
• Database designs are often carried out in the E-R model, and then
translated to the relational model.
Relational Database
The Entity-Relationship Model
• The entity-relationship (E-R) data model is based on a perception of
a real world that consists of a collection of basic objects, called
entities, and of relationships among these objects.
• An entity is a “thing” or “object” in the real world that is
distinguishable from other objects.
• For example, each person is an entity, and bank accounts can be
considered as entities.
The Entity-Relationship Model
• Entities are described in a database by a set of attributes.
• For example, the attributes account-number and balance may
describe one particular account in a bank, and they form
attributes of the account entity set.
• Similarly, attributes customer-name, customer-street address
and customer-city may describe a customer entity.
Purpose of E/R Model
• The E-R model allows us to sketch database schema designs.
– Includes some constraints, but not operations.
• Designs are pictures called entity relationship diagrams.
• Later: convert E/R designs to relational DB designs.
Definition : The E-R data model views the real world as a set of basic
objects(entities) and relationship among those objects.
• Entity
• Entity Set
• Attributes
• Relationship
Entity Sets
• Entity = “thing” or object.
• Entity set = collection of similar entities.
– Similar to a class in object-oriented languages.
• Attribute = property of (the entities of) an entity set.
– Attributes are simple values, e.g. integers or character strings,
not structs, sets, etc.
Relationships
• A relationship connects two or more entity sets.
• It is represented by a diamond, with lines to each of the entity sets
involved.
Entity-relationship Model
• The overall logical structure (schema) of a database can be
expressed graphically by an E-R diagram, which is built up from the
following components
• Rectangles, which represent entity
• Ellipses, which represent attributes
• Diamonds, which represent relationships among entity sets
• Lines, which link attributes to entity sets and entity sets to
relationships
Entity-relationship Model
• Each component is labeled with the entity or relationship
that it represents
• consider part of a database banking system consisting of
customers and of the accounts that these customers have
The diagram also shows a relationship depositor between customer
and account
Component of ER Diagram
Draw the ER diagram for Banking Systems
ACTIVITY
Extended (or) Enhanced E-R Model
• The E-R Model that is supported with the additional semantic
concepts is called extended entity relationship model or EER model.
• The EER model includes concepts of the original E-R model together
with the following additional concepts.
• Specialization
• Generalization
• Aggregation
Generalization
• Generalization is the process of defining a more general entity type
from a set more specialized entity types.
• Generalization is a bottom-up approach. This approach results in the
identification of a generalization superclass from the original
subclasses. OR
• Generalization is a bottom-up approach in which two lower level
entities combine to form a higher level entity. In generalization, the
higher level entity can also combine with other lower level entity to
make further higher level entity
Specialization
• Specialization is the process of designing, subgrouping within an entity set.
• Specialization is a top-down process.
• Consider an entity set. Person, with attributes Name, Street, and City.
• A person may be further classified as one of the following.
•Customer
• Employee
OR
• Specialization is opposite to Generalization.
It is a top-down approach in which one higher level entity can
be broken down into two lower level entity. In specialization,
some higher level entities may not have lower level entity sets at all.
Aggregation
• Aggregation is a process when relation between two entity is treated
as a single entity. Here the relation between Center and Course, is
acting as an Entity in relation with Visitor
EXAMPLES

DATA MODELS.pptx

  • 1.
    Data models • Adata model is a collection of conceptual tools for describing data, data relationships, data semantics, and consistency constraints. • Data models provide a way to describe the design of a database at the logical level. • The entity–relationship (E-R) model is a high-level data model. It is based on a perception of a real world that consists of a collection of basic objects, called entities, and of relationships among these objects. • The relational model is a lower-level model. It uses a collection of tables to represent both data and the relationships among those data. • Today a vast majority of database products are based on the relational model. • Designers often formulate database schema design by first modeling data at a high level, using the E-R model, and then translating it into the relational model.
  • 2.
    DBMS Database Models •A Database model defines the logical design and structure of a database and defines how data will be stored, accessed and updated in a database management system. • While the Relational Model is the most widely used database model, there are other models too: • Hierarchical Model • Network Model • Entity-relationship Model • Relational Model
  • 3.
    Hierarchical Model • Thisdatabase model organizes data into a tree-like-structure, with a single root, to which all the other data is linked. • The hierarchy starts from the Root data, and expands like a tree, adding child nodes to the parent nodes. • In this model, a child node will only have a single parent node. • This model efficiently describes many real-world relationships like index of a book, recipes etc. • In hierarchical model, data is organized into tree-like structure with one one-to-many relationship between two different types of data, for example, one department can have many courses, many professors and of-course many students.
  • 4.
  • 5.
    Network Model • Thisis an extension of the Hierarchical model. In this model data is organized more like a graph, and are allowed to have more than one parent node. • In this database model data is more related as more relationships are established in this database model. Also, as the data is more related, hence accessing the data is also easier and fast. • This database model was used to map many-to-many data relationships. • This was the most widely used database model, before Relational Model was introduced.
  • 6.
  • 7.
    Relational Model • Therelational model uses a collection of tables to represent both data and the relationships among those data. • Each table has multiple columns, and each column has a unique name.
  • 8.
    Relational Model • Inthis model, data is organised in two-dimensional tables and the relationship is maintained by storing a common field. • This model was introduced by E.F Codd in 1970, and since then it has been the most widely used database model, infact, we can say the only database model used around the world. • The basic structure of data in the relational model is tables. All the information related to a particular type is stored in rows of that table. • Hence, tables are also known as relations in relational model.
  • 9.
    Relational Model • presentsa sample relational database comprising three tables: • One shows details of bank customers, the second shows accounts, and the third shows which accounts belong to which customers. • Each table contains records of a particular type. • Each record type defines a fixed number of fields, or attributes. • The columns of the table correspond to the attributes of the record type
  • 10.
    Relational Model • Therelational model is at a lower level of abstraction than the E-R model. • Database designs are often carried out in the E-R model, and then translated to the relational model.
  • 11.
  • 12.
    The Entity-Relationship Model •The entity-relationship (E-R) data model is based on a perception of a real world that consists of a collection of basic objects, called entities, and of relationships among these objects. • An entity is a “thing” or “object” in the real world that is distinguishable from other objects. • For example, each person is an entity, and bank accounts can be considered as entities.
  • 13.
    The Entity-Relationship Model •Entities are described in a database by a set of attributes. • For example, the attributes account-number and balance may describe one particular account in a bank, and they form attributes of the account entity set. • Similarly, attributes customer-name, customer-street address and customer-city may describe a customer entity.
  • 14.
    Purpose of E/RModel • The E-R model allows us to sketch database schema designs. – Includes some constraints, but not operations. • Designs are pictures called entity relationship diagrams. • Later: convert E/R designs to relational DB designs. Definition : The E-R data model views the real world as a set of basic objects(entities) and relationship among those objects. • Entity • Entity Set • Attributes • Relationship
  • 15.
    Entity Sets • Entity= “thing” or object. • Entity set = collection of similar entities. – Similar to a class in object-oriented languages. • Attribute = property of (the entities of) an entity set. – Attributes are simple values, e.g. integers or character strings, not structs, sets, etc.
  • 16.
    Relationships • A relationshipconnects two or more entity sets. • It is represented by a diamond, with lines to each of the entity sets involved.
  • 17.
    Entity-relationship Model • Theoverall logical structure (schema) of a database can be expressed graphically by an E-R diagram, which is built up from the following components • Rectangles, which represent entity • Ellipses, which represent attributes • Diamonds, which represent relationships among entity sets • Lines, which link attributes to entity sets and entity sets to relationships
  • 18.
    Entity-relationship Model • Eachcomponent is labeled with the entity or relationship that it represents • consider part of a database banking system consisting of customers and of the accounts that these customers have
  • 19.
    The diagram alsoshows a relationship depositor between customer and account
  • 20.
  • 21.
    Draw the ERdiagram for Banking Systems
  • 22.
  • 23.
    Extended (or) EnhancedE-R Model • The E-R Model that is supported with the additional semantic concepts is called extended entity relationship model or EER model. • The EER model includes concepts of the original E-R model together with the following additional concepts. • Specialization • Generalization • Aggregation
  • 24.
    Generalization • Generalization isthe process of defining a more general entity type from a set more specialized entity types. • Generalization is a bottom-up approach. This approach results in the identification of a generalization superclass from the original subclasses. OR • Generalization is a bottom-up approach in which two lower level entities combine to form a higher level entity. In generalization, the higher level entity can also combine with other lower level entity to make further higher level entity
  • 25.
    Specialization • Specialization isthe process of designing, subgrouping within an entity set. • Specialization is a top-down process. • Consider an entity set. Person, with attributes Name, Street, and City. • A person may be further classified as one of the following. •Customer • Employee OR • Specialization is opposite to Generalization. It is a top-down approach in which one higher level entity can be broken down into two lower level entity. In specialization, some higher level entities may not have lower level entity sets at all.
  • 26.
    Aggregation • Aggregation isa process when relation between two entity is treated as a single entity. Here the relation between Center and Course, is acting as an Entity in relation with Visitor
  • 27.