Data model:
• A data model is a collection of concepts that
can be used to describe the structure of a
database
• Data modeling in the first step in designing a
database refers to the process of creating a
specific data model for a problem
Data Model basic building blocks:
• The basic building blocks of data models are entities, attributes,
relationships and constraints. An entity represents a real world object
person (or) place.
• For e.g.
• a customer entity have different of customers.
• An attribute is a characteristic of an entity.
• For e.g. customer entity have attributes customer_no, customer_name,
customer_address etc.
• . A relationship describes an association between entities.
• Data models use three types of associations.
• One-to-many
• many-to-many
• one-to-one
One-to-many (1:M, 1…..*):
• A painter paints many different paintings.
• Therefore, the database designer label the
relationship PAINTER PAINTS PAINTINGS as
one-tomany.
Many-to-many (M:N, *…….*)
• An employee may learn many job skills and
each job skill may be learned by many
employees.
• Therefore, the database designer label the
relationship Employee learns skills as many-to-
many (M:N).
One-to-one (1:1, 1…….1):
• Each store manager manages only a single
store.
• Therefore, the data designer label the
relationship employee manages stores as
oneto-one (1:1).
• Data Model gives us an idea that how the final
system will look like after its complete
implementation
1. Hierarchical Model
2. Network Model
3. Entity-Relationship Model
4. Relational Model
Hierarchical Model
• Hierarchical Model was the first DBMS model. This model organises
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.
• This model easily represents some of the real-world relationships
like food recipes, sitemap of a website etc.
•
• The hierarchical data model consists of a set of nested relationships
one-to-many and one-to-one association
• This means that many-to-one association is not permitted
• Example: We can represent the relationship between the shoes
present on a shopping website in the following way:
• Features of a Hierarchical Model
• One-to-many relationship: The data here is organised 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.
• Example: In the above example, if we want to go to the
node sneakers we only have one path to reach there i.e through
men's shoes node.
• 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.
• Deletion Problem: If a parent node is deleted then the child node is
automatically deleted.
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.
• 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
• Ability to Merge more Relationships: This model has
the ability to manage one-to-one relationships as well
as many-to-many relationships.
• 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.
• Circular Linked List: The operations on the network
model are done with the help of the circular linked list.
• Advantages of Network Model
• The data can be accessed faster as compared to the hierarchical
model.
• 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.
RELATIONAL DATA MODEL:
• Relational Model is the most widely used model.
• In this model, the data is maintained in the form of a
two-dimensional table.
• All the information is stored in the form of row and
columns.
• The basic structure of a relational model is tables. So, the
tables are also called relations in the relational model.
• Features of Relational Model
• Tuples : Each row in the table is called tuple. A
row contains all the information about any
instance of the object.
• Attribute or field: Attributes are the property
which defines the table or relation.
Advnatages 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 Relatinal 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.
• But all these disadvantages are minor as compared to the advantages of the relational model. These
problems can be avoided with the help of proper implementation and organisation.