Week 5 part-II Data Models.pptx
Week 5 part-II Data Models.pptx
WEEK-05
Data Models
DATA MODELS
▪ Database model shows the logical structure of a database, including the relationships and
constraints that determine how data can be stored and accessed.
▪ Most data models can be represented by an accompanying database diagram.
▪ Therefore, there are following four data models used for understanding the structure of
the database:
DATA MODELS AND
CONCEPTUAL MODELING
• Data Model is higher level of description of schema
• Describes, manipulate, relationship & constraints on data
• Three parts of data Model:
❑ Structural part: Set of rules to construct database
❑ Manipulative part: Set of operations
❑ Set of integrity constraints: Ensures data is accurate
CONCEPTUAL DATA MODELS
▪ Conceptual data models provide a high-level view of data by identifying the key
entities, attributes, and relationships.
▪ For example, a conceptual data model for a library may include entities like 'Book,'
'Author,' and 'Publisher' and their relationships.
▪ These models are often used in the initial planning phase to define the broad data
structure without going into detailed attributes.
LOGICAL DATA MODELS
▪ Logical data models offer a detailed overview of the data without any concern for
how the data will be physically implemented in databases.
▪ They include all entities, attributes, and relationships, along with the addition of
primary and foreign keys.
▪ They also define data types for attributes.
▪ In the library example, a logical data model would specify the data type for 'Book
Title' as a string and 'Publication Date' as a date.
PHYSICAL DATA MODELS
▪ Physical data models are the most detailed and are tailored to a specific database
management system (DBMS).
▪ They include all tables, columns, relationships, indexes, triggers, and stored
procedures.
▪ They specify how data will be stored in a database, considering the performance
requirements and the specific technology used.
▪ In the library example, a physical data model would detail how the 'Book' table is
physically stored in the database.
DATA MODELS
HIERARCHICAL MODEL
• The model data are represented by collection of records
▪ The hierarchical 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.
▪ Data is organized into a tree-like structure with a one-to-many relationship between two
different types of data
▪ IBM's Information Management System (IMS) is based on this model
▪ Example, one department can have many courses, many teachers, and of course
many students.
HIERARCHICAL MODEL
HIERARCHICAL MODEL
HIERARCHICAL MODEL
Advantages –
▪ Simplicity, Data Integrity, Data security, Efficiency, Easy availability of expertise.
Disadvantages –
▪ Complexity, Inflexibility, Lack of Data Independence,
▪ But the Hierarchical model is less flexible and it doesn't support many-to-many
relationships.
NETWORK DATA MODEL
▪ This model data are represented by collection of records
▪ Relationships among the data are represented by links
▪ Graph data structures are used in this model
▪ It permits a record to have more than one parent
▪ This database model uses many-to-many data relationships.
▪ For Example- Social Media sites like Facebook, Instagram etc
▪ Advantages –
Simplicity, Data Integrity, Data Independence, Database standards.
▪ Disadvantages –
System Complexity, Lack of structural Independence.
NETWORK DATA MODEL
▪ All three
departments are
linked with the
director which was
not possible in the
hierarchical data
model.
NETWORK DATA MODEL
Entity-Relationship Data Model
▪ Designed by Peter Chen and published in 1976 papers.
▪ An ER model is the logical representation of data as objects and
relationships among them.
▪ These objects are known as entities, and relationship is an association
among these entities.
▪ A set of attributes describe the entities.
▪ For example, student_name, student_id describes the 'student' entity.
▪ A set of the same type of entities is known as an 'Entity set', and the set of
the same type of relationships is known as 'relationship set'.
▪ It was widely used in database designing.
ENTITY-RELATIONSHIP DATA
MODEL
Two entities that are Employee and
Company, and the relationship among
them.
Both the employee and company have
some attributes and the relationship is
of "works in" type, which means the
employee works in a company.
Object-based Data Model
▪ An extension of the ER model with notions of functions, encapsulation, and object
identity, as well.
▪ This model supports a rich type system that includes structured and collection types.
▪ A multimedia database incorporates media, such as images, that could not be stored in a
relational database.
▪ A hypertext database allows any object to link to any other object.
▪ Thus, in 1980s, various database systems following the object-oriented approach were
developed. Here, the objects are nothing but the data carrying its properties.
▪ A very popular example of an Object Database management system
or ODBMS is MongoDB which is also a NoSQL database.
Semi structured Data Model
▪ This type of data model is different from the other three data models.
▪ The semi structured data model allows the data specifications at places
where the individual data items of the same type may have different
attributes sets.
▪ The Extensible Markup Language, also known as XML, is widely used for
representing the semi structured data.
▪ Although XML was initially designed for including the markup
information to the text document, it gains importance because of its
application in the exchange of data.
Relational Data Model
1 Ajeet 24 B.Tech
2 aryan 20 C.A
3 Mahesh 21 BCA
4 Ratan 22 MCA
5 Vimal 26 BSC
WHAT IS A ROW OR
RECORD?
▪ A row of a table is also called a record or tuple.
▪ It contains the specific information of each entry in the table.
▪ It is a horizontal entity in the table. For example, The above table contains 5 records.
What is a column/attribute?
▪ A column is a vertical entity in the table which contains all information associated
with a specific field in a table.
▪ For example, "name" is a column in the above table which contains all information
about a student's name.
Properties of an Attribute:
Ajeet
Aryan
Mahesh
Ratan
What is data item/Cells?
▪ The smallest unit of data in the table is the individual data item. It is stored at the
intersection of tuples and attributes.
▪ Properties of data items:
▪ Data items are atomic.
▪ The data items for an attribute should be drawn from the same domain.
1 Ajeet 24 B.Tech 1
Degree:
▪ The total number of attributes that comprise a relation is known as the degree of the
table.
For example, the student table has 4 attributes, and its degree is 4.
1 Ajeet 24 B.Tech
2 aryan 20 C.A
3 Mahesh 21 BCA
4 Ratan 22 MCA