Data Models

A data model defines how data is structured, stored, related, and manipulated in a DBMS.

The six models to know: Relational · Entity-Relationship (ER) · Hierarchical · Network · Object-Oriented · Semi-Structured (XML/JSON).

1 · Relational Data Model

Data is represented as tables (relations) with rows (tuples) and columns (attributes). This is the model the rest of the chapter builds on.
StudentIDNameDepartmentYearEmail
S001Rahim AhmedCSE2rahim@uni.edu
S002Karim HasanEEE3karim@uni.edu
S003Nusrat JahanCSE1nusrat@uni.edu
3 tuples · 5 attributes
CourseIDCourseNameCreditDepartment
C101Database Systems3CSE
C102Data Structures3CSE
E201Circuit Theory3EEE
3 tuples · 4 attributes

2 · Entity-Relationship (ER) Model

A conceptual model representing data as entities, attributes, and relationships — e.g. Student — enrolls — Course. Purpose: design the database structure before implementation.

3 · Hierarchical Model

Data is organised in a tree with parent–child links; each child has only one parent. Examples: University → Department → Student, a file system.

Limitation: cannot represent many-to-many relationships.

4 · Network Model

An extension of the hierarchical model where a child can have multiple parents, forming a graph. Example: a student enrolls in many courses, and a course has many students.

Advantage: supports many-to-many relationships.
Limitation: complex structure, hard to maintain.

5 · Object-Oriented Model

Data is stored as objects (like OOP), combining data (attributes) and behaviour (methods). E.g. a Person superclass with Student, Doctor, Engineer subclasses (inheritance).

6 · Semi-Structured Model

Data has no fixed schema; structure is flexible. Two common formats:

XML — markup language using customizable tags to store and transport data.
<employee id="34594">
  <firstName>Heather</firstName>
  <lastName>Banks</lastName>
  <salary>72000</salary>
</employee>
JSON — key-value pairs, nested objects and arrays.
{
  "emp_name": "Shubham",
  "email": "shubh@gmail.com",
  "job_profile": "intern"
}

Quick comparison

ModelStructureM:N?Note
RelationalTables✅ (via keys)Most widely used
EREntities + relationshipsDesign-time only
HierarchicalTree (1 parent)Simple, rigid
NetworkGraph (many parents)Complex to maintain
Object-OrientedObjects (data+methods)OOP-style
Semi-StructuredXML / JSONFlexible, no fixed schema