UNIT-1 - Part-II Updated Introduction To DBMS - CSE3001
UNIT-1 - Part-II Updated Introduction To DBMS - CSE3001
• Data Model gives us an idea that how the final system will look like
after its complete implementation.
• It defines the data elements and the relationships between the data
elements. Data Models are used to show how data is stored,
connected, accessed and updated in the database management
system.
• Here, we use a set of symbols and text to represent the information
so that members of the organization can communicate and
understand it.
• Though there are many data models being used nowadays but the
Relational model is the most widely used model.
Types of Data Models
1. Hierarchical Model
2. Network Model
3. Entity-Relationship Model
4. Relational Model
5. Object-Oriented Data Model
6. Object-Relational Data Model
7. Flat Data Model
8. Semi-Structured Data Model
9. Associative Data Model
10.Context Data Model
Hierarchical Model
• Hierarchical Model was the first DBMS model.
• This model organizes the data in the hierarchical tree
structure.
• The hierarchy starts from the root which has root data
and then it expands in the form of a tree adding child
node to the parent node.
• Example: We can represent the relationship between
the shoes present on a shopping website in the
following way:
Example
Features of a Hierarchical
Model
1. One-to-many relationship: The data here is organized in a tree-like
structure where the one-to-many relationship is between the
datatypes. Also, there can be only one path from parent to any node.
2. Parent-Child Relationship: Each child node has a parent node but a
parent node can have more than one child node. Multiple parents are
not allowed.
3. Deletion Problem: If a parent node is deleted then the child node is
automatically deleted.
4. Pointers: Pointers are used to link the parent node with the child
node and are used to navigate between the stored data.
Advantages of Hierarchical
Model
• It is very simple and fast to traverse through a
tree-like structure.
• Any change in the parent node is automatically
reflected in the child node so, the integrity of
data is maintained.
Disadvantages of
Hierarchical Model
• Complex relationships are not supported.
• As it does not support more than one parent of the
child node so if we have some complex relationship
where a child node needs to have two parent node
then that can't be represented using this model.
• If a parent node is deleted then the child node is
automatically deleted.
Network Model
• This model is an extension of the hierarchical
model. It was the most popular model before the
relational model.
• This model is the same as the hierarchical model,
the only difference is that a record can have more
than one parent.
• It replaces the hierarchical tree with a graph.
Example
• In the example below we can see that node student has two
parents i.e. CSE Department and Library.
• This was earlier not possible in the hierarchical model.
Features of a Network
Model
1. Ability to Merge more Relationships: In this model, as there are more
relationships so data is more related. This model has the ability to manage
one-to-one relationships as well as many-to-many relationships.
2. Many paths: As there are more relationships so there can be more than
one path to the same record. This makes data access fast and simple.
3. Circular Linked List: The operations on the network model are done with
the help of the circular linked list. The current position is maintained with
the help of a program and this position navigates through the records
according to the relationship.
Advantages of Network
Model
• The data can be accessed faster as compared to the
hierarchical model.
• This is because the data is more related in the network
model and there can be more than one path to reach a
particular node.
• So the data can be accessed in many ways.
• As there is a parent-child relationship so data integrity is
present.
• Any change in parent record is reflected in the child
record.
Disadvantages of Network
Model
• As more and more relationships need to be
handled the system might get complex.
• So, a user must be having detailed knowledge of
the model to work with the model.
• Any change like updation, deletion, insertion is
very complex.
Entity-Relationship Model
In the above diagram, the entities are Teacher and Department. The attributes
of Teacher entity are Teacher_Name, Teacher_id, Age, Salary, Mobile_Number. The
attributes of entity Department entity are Dept_id, Dept_name. The two entities are
connected using the relationship. Here, each teacher works for a department.
Features of ER Model
• Tuples: Each row in the table is called tuple. A row contains all
the information about any instance of the object. In the above
example, each row has all the information about any specific
individual like the first row has information about John.
• Attribute or field: Attributes are the property which defines the
table or relation. The values of the attribute should be from the
same domain. In the above example, we have different attributes
of the employee like Salary, Mobile_no, etc.
Advantages of Relational
Model
• Simple: This model is more simple as compared to the
network and hierarchical model.
• Scalable: This model can be easily scaled as we can add as
many rows and columns we want.
• Structural Independence: We can make changes in
database structure without changing the way to access the
data. When we can make changes to the database
structure without affecting the capability to DBMS to
access the data we can say that structural independence
has been achieved.
Disadvantages of Relational
Model
• Hardware Overheads: For hiding the complexities and
making things easier for the user this model requires more
powerful hardware computers and data storage devices.
• Bad Design: As the relational model is very easy to design
and use. So the users don't need to know how the data is
stored in order to access it. This ease of design can lead to the
development of a poor database which would slow down if
the database grows.
Object-Oriented Data Model
• The real-world problems are more closely represented
through the object-oriented data model.
• In this model, both the data and relationship are present
in a single structure known as an object.
• We can store audio, video, images, etc in the database
which was not possible in the relational model(although
you can store audio and video in relational database, it is
advised not to store in the relational database).
• In this model, two are more objects are connected through
links. We use this link to relate one object to other objects.
Example
In the above example, we have two objects Employee and Department. All the data
and relationships of each object are contained as a single unit. The attributes like
Name, Job_title of the employee and the methods which will be performed by that
object are stored as a single object. The two objects are connected through a
common attribute i.e the Department_id and the communication between these two
will be done with the help of this common id.
Object-Relational Model
• As the name suggests it is a combination of both the
relational model and the object-oriented model. This
model was built to fill the gap between object-oriented
model and the relational model. We can have many
advanced features like we can make complex data types
according to our requirements using the existing data
types. The problem with this model is that this can get
complex and difficult to handle. So, proper understanding
of this model is required.
Flat Data Model
• In DBMS, constraints are the set of rules that ensures that when
an authorized user modifies the database they do not disturb the
data consistency and the constraints are specified within the DDL
commands like “alter” and “create” command.
• There are several types of constraints available in DBMS and they
are:
• Domain constraints
• Entity Integrity constraints
• Referential Integrity constraints
• Key constraints
Domain Constraints are user-defined columns that help the user to enter
the value according to the data type.
And if it encounters a wrong input it gives the message to the user that
the column is not fulfilled properly.
Or in other words, it is an attribute that specifies all the possible values
that the attribute can hold like integer, character, date, time, string, etc.
It defines the domain or the set of values for an attribute and ensures that
the value taken by the attribute must be an atomic value(Can’t be divided)
from its domain.
Type of domain constraints:
Domain Constraints – Not Null: Null values are the values that are
unassigned or we can also say that which are unknown or the missing
attribute values and by default, a column can hold the null values.
Domain Constraints – Check: It defines a condition that each row must
satisfy which means it restricts the value of a column between ranges or we
can say that it is just like a condition or filter checking before saving data
into a column.
DBMS Architecture
• Data abstraction is the idea that a database design begins with a high
level view and as it approaches implementation level, the level of detail
increases.
• The benefit to using levels of abstraction is the ability to work with
and integrate multiple views into a cohesive set.
• In 1970, the American National Standards Institute (ANSI) Standards
Planning and Requirements Committee (SPARC) established a
framework for database design based on the degrees of abstraction.
• The ANSI/SPARC architecture is composed of four levels of data
abstraction; these levels are external, conceptual, internal, and physical.
Summary
• Presentation are designed specially for the beginners or
learners of Database System, its help students to defines
various Data models and their uses in application with
examples.
• Presentation are designed to the Introduction to ER MODEL, Types
of Attribute, Entity Sets, Composite Attributes, Mapping Cardinalities,
ER diagram, Entity with Composite, Derived and Multi value
Attributes, ER Relationship 1-1, 1-M, M-1 and M-M.
Thank You!!!