Unit 2: Data models
Database Management Systems notes · PTU syllabus (BSIT402/BSBC404)
On this page
Unit summary
A data model decides how data and its relationships are described. This unit covers the entity–relationship model, the hierarchical, network and relational models, and a comparison of the network, hierarchical and relational models.
After this unit you can
- Draw ER diagrams with entities, attributes and relationships
- Explain the hierarchical and network models
- Explain the relational model
- Compare the three record-based models
PTU syllabus topics
- Entity-Relationship model
- hierarchical model
- network model
- relational model
- comparison of network/hierarchical/relational models
Hierarchical
Tree of parent and child records
One-to-many only
Network
Graph of records and sets
Many-to-many
Relational
Tables of rows and columns
Through keys
ER model
Entities, attributes, relationships
Design tool for databases
Topic 1
Data models: an overview
A data model is a set of concepts for describing the structure of a database, its relationships and its constraints.
Hierarchical
Tree: one parent, many children
IBM IMS, file folders
Network
Graph: records linked by many-to-many sets
IDMS
Relational
Tables of rows and columns linked by keys
MySQL, Oracle
Object-oriented
Objects with data and methods
Multimedia, CAD databases
The relational model (E. F. Codd, 1970) is the most widely used because of its simplicity and the power of SQL.
Exam tip
Also mention the three-level architecture (external, conceptual, internal) and data independence if asked about DBMS architecture.
Topic 2
The entity–relationship model
The ER model (Peter Chen, 1976) describes data as entities, their attributes and the relationships between them.
| ER symbol | Represents |
|---|---|
| Rectangle | Entity set |
| Double rectangle | Weak entity set |
| Ellipse | Attribute |
| Underlined ellipse | Key attribute |
| Double ellipse | Multivalued attribute |
| Dashed ellipse | Derived attribute |
| Diamond | Relationship |
| Double diamond | Identifying relationship |
Types of attributes: simple and composite (name → first, last), single-valued and multivalued (phone numbers), stored and derived (age from date of birth). Cardinality of relationships: one-to-one (1:1), one-to-many (1:N), many-to-one (N:1) and many-to-many (M:N). Participation: total (every entity participates — double line) or partial.
Topic 3
Weak entity sets and extended ER features
A weak entity set has no primary key of its own; it depends on a strong (owner) entity and is identified by a partial key plus the owner's key. Example: DEPENDENT of an EMPLOYEE.
Specialisation
Top-down: EMPLOYEE into MANAGER and CLERK
Generalisation
Bottom-up: CAR and BIKE into VEHICLE
Aggregation
Treating a relationship as an entity
Inheritance
Lower-level entities inherit attributes of higher ones
Example
College ER diagram: STUDENT (Roll, Name, Phone multivalued) — ENROLS (M:N) — COURSE (Code, Title); COURSE — TAUGHT_BY (N:1) — FACULTY (EmpID, Name). ENROLS has the attribute Grade.
Topic 4
The hierarchical model
- Data is organised as a tree: each child record has exactly one parent; relationships are one-to-many; access starts at the root and follows parent–child links.
Department
Computer Science
Course
B.Sc IT, BCA
Student
Records under each course
- Strengths: simple, fast for one-to-many queries, good integrity (a child cannot exist without its parent).
- Weaknesses: many-to-many relationships need duplicate records; inserting or deleting is rigid; queries depend on the access path. Example system: IBM IMS.
Topic 5
The network model
- Data is a graph of records connected by sets (owner–member links), standardised by CODASYL/DBTG; a member may have several owners, so many-to-many relationships are possible.
- 1Owner record SUPPLIER
- 2Set SUPPLIES links to member SHIPMENT
- 3Owner record PART
- 4Set PART-OF also links to SHIPMENT
- 5A shipment belongs to one supplier and one part, giving M:N between suppliers and parts
- Strengths: handles M:N relationships, efficient navigation.
- Weaknesses: complex structure, programs must navigate pointers, poor data independence. Example system: IDMS.
Topic 6
The relational model
- Data is held in relations (tables) of tuples (rows) and attributes (columns); each attribute takes values from a domain; relationships are expressed by matching values of keys.
- Relation
- Table
- Tuple
- Row
- Attribute
- Column
- Degree
- Number of attributes
- Cardinality
- Number of tuples
- Primary key
- Attribute(s) identifying each tuple
- Foreign key
- Attribute referring to the primary key of another relation
- Integrity rules: entity integrity (primary key cannot be null) and referential integrity (a foreign key must match an existing primary key or be null).
Topic 7
Comparison of network, hierarchical and relational models
| Feature | Hierarchical | Network | Relational |
|---|---|---|---|
| Structure | Tree | Graph (owner–member sets) | Tables |
| Relationships | 1:N only | 1:N and M:N | Any, through keys |
| Data access | Navigational from the root | Navigational through pointers | Declarative (SQL) |
| Data independence | Low | Low | High |
| Ease of use | Moderate | Complex | Simple |
| Flexibility for queries | Poor | Moderate | Excellent |
| Examples | IBM IMS | IDMS | Oracle, MySQL, PostgreSQL |
Key terms
- Entity
- Real-world object with independent existence
- Cardinality ratio
- Number of entities related on each side of a relationship
- Hierarchical model
- Tree-structured data model
- Network model
- Graph-structured data model with owner–member sets
- Referential integrity
- Foreign key values must match existing primary keys
Quick revision
- ER symbols; attribute types; cardinality; participation.
- Weak entity; specialisation, generalisation, aggregation.
- Hierarchical: tree, 1:N, IMS.
- Network: graph, sets, M:N, IDMS.
- Relational: tables, keys, integrity rules; comparison table.
Important exam questions
Practice questions written to the PTU exam pattern for this unit's syllabus: short answers (Section A style) and long answers (Sections B and C style).
Short-answer questions
- Q1.What is a weak entity set?
- Q2.Distinguish total and partial participation.
- Q3.State one limitation of the hierarchical model.
- Q4.How does the network model represent M:N relationships?
- Q5.Define degree and cardinality of a relation.
- Q6.Why is the relational model the most popular?
Long-answer questions
- Q1.Draw an ER diagram for a college and explain its components.
- Q2.Explain the hierarchical and network data models with examples.
- Q3.Explain the relational model and its integrity rules.
- Q4.Compare the hierarchical, network and relational models.
Stuck on this unit?
Message SBS on WhatsApp for help with Database Management Systems, or to ask about studying B.Sc IT at Synetic.
