Data 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:
1. Entity-relationship Model
2. Network Model
3. Relational Model
4. Object-oriented Model
5. Hierarchical Model
Entity-relationship Model
In this database model, relationships are created by dividing object of interest into entity and its
characteristics into attributes.
Different entities are related using relationships.
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.
Let's take an example, if we have to design a university 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, pin code, city etc, and there will be a relationship between
them. Relationships can also be of different types.
E-R 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
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, in fact, 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
Object-oriented Model
The real-world problems are closely represented through the object-oriented data model.
In this type of model, both the data and relationship are represented in a single structure called an
object.
We can store audio, video, images, etc. in this database, but it is advised not to store in the relational
database. In this model, the attributes describe the properties of an object.
Objects that share similar characteristics are grouped in classes. Therefore, a class is a collection of
similar objects with attributes and methods. In this model, two or more objects are connected with the
help of links. We use this link to relate objects. It is explained in the below example.
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.
0 Comments
Post a Comment