Model Database
Model Database
In a hierarchical model database, data is organized in a tree-like structure, where each record has a
parent record and zero or more child records. This structure is similar to an organizational chart, where
the top-level record is the root of the hierarchy, and each subsequent record branches off from its
parent record.
The hierarchical model is useful when the data is naturally organized in a hierarchical structure, such as
a file system or a company organizational chart. The model is simple and easy to understand, making it
suitable for applications that require a straightforward and rigid data structure.
One disadvantage of the hierarchical model is that it can be inflexible when dealing with complex data
relationships.
For example, it can be difficult to represent many-to-many relationships between records. Additionally,
modifying the structure of the hierarchy can be difficult and time-consuming, especially for large
databases.
The hierarchical model was popular in the early days of computer databases, particularly in mainframe
environments, but it has largely been replaced by more flexible models, such as the relational model.
Nonetheless, some specialized applications still use the hierarchical model today.
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.
The network model is useful for handling complex data relationships, where records can be related to
multiple other records. It is also more flexible than the hierarchical model, as it allows for records to be
connected in multiple ways.
One advantage of the network model is that it is relatively efficient for handling complex queries that
involve many-to-many relationships. It also allows for data to be stored more compactly than in the
hierarchical model, as records can be shared between different sets.
However, the network model can be more difficult to understand and maintain than the hierarchical
model, as it introduces more complexity into the data structure. Additionally, modifying the structure of
the database can be difficult and time-consuming, especially for large databases.
The network model was popular in the 1970s and 1980s, particularly in mainframe environments, but it
has largely been replaced by the relational model, which is more flexible and easier to use. Nonetheless,
some specialized applications still use the network model today.
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.
Relational Model
The relational model is a type of database model that is based on the concept of tables, which are also
referred to as relations. In this model, data is organized into one or more tables, with each table
consisting of rows and columns. Each row represents a record, and each column represents a field or
attribute of the record.
The relational model is based on the principles of set theory and relational algebra. It allows for
relationships to be established between tables through the use of keys, which are fields or combinations
of fields that uniquely identify each record in the table. Relationships can be one-to-one, one-to-many,
or many-to-many.
One advantage of the relational model is its flexibility. It can handle a wide variety of data types and
relationships, from simple lists to complex structures. It also allows for data to be easily retrieved,
updated, and deleted, using a variety of standard query languages, such as SQL.
Another advantage of the relational model is its scalability. It can handle large databases with many
tables and millions of records, without sacrificing performance or reliability.
However, one disadvantage of the relational model is that it can be complex and difficult to design and
maintain, especially for large databases. It requires careful planning and normalization to ensure that
the data is stored efficiently and accurately.
Overall, the relational model is the most widely used database model today and is supported by most
modern database management systems. It is a powerful and flexible tool for managing structured data.
Relational Model
In this model, data is organized 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.
In the coming tutorials we will learn how to design tables, normalize them to reduce data redundancy
and how to use Structured Query language to access data from tables.
E-R Models are defined to represent the relationships into pictorial form to make it easier for different
stakeholders to understand.
This model is good to design a database, which can then be turned into tables in relational
model(explained below).
Let's take an example, If we have to design a School Database, then Student will be
an entity with attributes name, age, address etc. As Address is generally complex, it can be
another entity with attributes street name, pincode, city etc, and there will be a relationship between
them.
Relationships can also be of different types. To learn about E-R Diagrams in details, click on the link.