Data Models in DBMS

Subject: Computer Science Fundamentals · Language: DBMS · Level: beginner · 10 min read

Understand data models, why they are used, hierarchical model, network model, relational model, object model, and document model with beginner examples.

A data model defines how data is organized, connected, stored, and represented in a database. It gives a structure for designing a database before actual data is inserted. A beginner can think of a data model as a blueprint. Before building a house, a blueprint shows rooms, doors, and connections. In the same way, before building a database, a data model shows what kind of data will exist and how different parts of that data are connected.

Data models are important because real-world information is not random. Students belong to departments, customers place orders, employees work on projects, and books are issued by library members. A data model helps represent these facts in an organized way.

Why Data Models Are Needed

Data models are needed to convert real-world requirements into database structure. Without a model, tables or records may be created randomly, causing duplicate data and confusing relationships later. A good data model helps database designers, developers, and users understand the system clearly. Everyone can discuss what data is stored, what each item means, and how one item connects with another.

Data models also improve maintenance. If the database is designed logically, future changes become easier. If the design is weak, even simple changes can create problems.

Main Types of Data Models

Different data models exist because data can be organized in different ways. Some models are older and useful for understanding history. Some are widely used in current systems. Some are suitable for special kinds of applications.

The most important models for beginners are hierarchical model, network model, relational model, object-oriented model, and document model. Among these, the relational model is the most important for SQL and placement preparation.

Data Model Overview Diagram

This diagram gives a quick mental picture of how the main data models differ. It is not meant to replace definitions; it helps students remember the basic structure of each model.

```text

Hierarchical Model : Parent -> Child -> Sub-child

Network Model : Records connected with many links

Relational Model : Tables connected using keys

Object Model : Objects containing data and behavior

Document Model : Flexible JSON-like documents

```

For DBMS fundamentals, the relational model should be studied deeply first. Other models are useful because they show that databases can organize data in more than one way.

| Data Model | Basic Structure | Simple Example |

| --- | --- | --- |

| Hierarchical model | Tree structure | Department has many students |

| Network model | Graph-like links | Student can connect to many courses |

| Relational model | Tables with rows and columns | Students, Courses, Marks tables |

| Object-oriented model | Objects with data and behavior | Student object with fields and methods |

| Document model | Flexible documents | JSON-like student profile document |

Hierarchical Data Model

The hierarchical model organizes data in a tree-like structure. In this model, records are connected using parent-child relationships. One parent can have many children, but each child usually has only one parent. For example, a college may have departments, each department may have students, and each student may have marks. This can be represented like a tree where College is at the top, Departments are below it, and Students are below Departments.

This model is simple when data naturally follows a hierarchy. However, it becomes difficult when the same child needs to connect to multiple parents. For example, a student may enroll in many courses, and a course may have many students. This many-to-many relationship is not easy in a strict tree structure.

Network Data Model

The network model is more flexible than the hierarchical model. It allows a record to have multiple parent and child relationships. This means it can represent more complex connections. For example, a student can enroll in many courses, and a course can contain many students. A network model can represent this kind of connection better than a simple hierarchy.

The limitation is complexity. Users may need to understand paths and links between records. Because of this, it can be harder to design and use compared with the relational model.

Relational Data Model

The relational model stores data in tables. Each table has rows and columns. Rows represent records, and columns represent attributes. Relationships between tables are handled using keys.

For example, a Students table can store student details, a Courses table can store course details, and an Enrollment table can connect students with courses. This design is clean and avoids unnecessary repetition. The relational model is very popular because it is easy to understand and works well with SQL. Most beginner DBMS topics such as keys, normalization, joins, and transactions are based on relational databases.

Object-Oriented Data Model

The object-oriented data model stores data as objects, similar to object-oriented programming. An object can contain data and behavior together. For example, a Student object may contain name, roll number, marks, and methods related to student operations. This model can be useful when data is complex and naturally object-based.

However, for normal business applications and beginner DBMS learning, the relational model is usually studied first because it is more common in SQL databases and interviews.

Document Data Model

The document model stores data in documents, often in a JSON-like format. A document can contain nested data, lists, and flexible fields. For example, a student document may contain name, roll number, address, course list, and contact details inside one document. This can be useful when data structure is flexible and not always the same for every record.

MongoDB is a popular example of a document database. It is not an RDBMS because it does not primarily store data in fixed relational tables.

Relational Model vs Document Model

The relational model is better when data is highly structured and relationships need strong consistency. It is commonly used in banking, college systems, inventory, billing, and applications where SQL queries and transactions are important. The document model is useful when data is flexible, nested, and changes often. It can be suitable for content systems, product catalogs, logs, and applications where document-like records are natural.

Both models are useful. The correct choice depends on the application requirement, data structure, query needs, and consistency requirements.

Logical and Physical Data Models

A logical data model describes what data is stored and how it is related, without focusing on exact storage details. It is close to the conceptual understanding of the database. A physical data model describes how data will actually be stored in a specific DBMS. It includes table structures, data types, indexes, storage choices, and performance-related details.

Students should understand this difference because database design usually moves from requirement understanding to logical design and then to physical implementation.

Choosing a Data Model

A data model should be chosen according to the nature of the data and the application. If the data is structured and relationship-heavy, the relational model is often a strong choice. If the data is flexible and document-like, a document model may be suitable. For exams and interviews, students should understand the basic meaning, advantages, and limitations of each model. But they should give extra focus to the relational model because it is the base for SQL, keys, normalization, joins, and transactions.

Important Points to Remember

A data model is a way to organize and represent data. Hierarchical model uses a tree structure. Network model uses flexible links. Relational model uses tables. Object-oriented model uses objects. Document model uses flexible documents.

For beginners, the relational model is the most important because it is widely used in SQL databases and placement questions. Other models are still useful because they show that databases can organize data in different ways depending on the problem.

More DBMS Lessons

Browse all PrepCampus study materials