Unit 2 of 4 · B.Sc IT Sem 4

Unit 2: Data models

Database Management Systems notes · PTU syllabus (BSIT402/BSBC404)

3 min read7 topics10 exam questions
On this page
  1. Unit summary
  2. Data models: an overview
  3. The entity–relationship model
  4. Weak entity sets and extended ER features
  5. The hierarchical model
  6. The network model
  7. The relational model
  8. Comparison of network, hierarchical and relational models
  9. Key terms
  10. Quick revision
  11. Important questions

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
ComparisonData models compared
Structure
Relationships

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

1

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.

ComparisonData models
Structure
Example use

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.

2

Topic 2

The entity–relationship model

The ER model (Peter Chen, 1976) describes data as entities, their attributes and the relationships between them.

ER symbolRepresents
RectangleEntity set
Double rectangleWeak entity set
EllipseAttribute
Underlined ellipseKey attribute
Double ellipseMultivalued attribute
Dashed ellipseDerived attribute
DiamondRelationship
Double diamondIdentifying 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.

3

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.

ClassificationExtended ER (EER) features
EER
  • 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.

4

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.
ClassificationHierarchical model: college
College
  • 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.
5

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.
ProcessNetwork model example
  1. 1Owner record SUPPLIER
  2. 2Set SUPPLIES links to member SHIPMENT
  3. 3Owner record PART
  4. 4Set PART-OF also links to SHIPMENT
  5. 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.
6

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.
Key termsRelational model terms
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).
7

Topic 7

Comparison of network, hierarchical and relational models

FeatureHierarchicalNetworkRelational
StructureTreeGraph (owner–member sets)Tables
Relationships1:N only1:N and M:NAny, through keys
Data accessNavigational from the rootNavigational through pointersDeclarative (SQL)
Data independenceLowLowHigh
Ease of useModerateComplexSimple
Flexibility for queriesPoorModerateExcellent
ExamplesIBM IMSIDMSOracle, 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

  1. Q1.What is a weak entity set?
  2. Q2.Distinguish total and partial participation.
  3. Q3.State one limitation of the hierarchical model.
  4. Q4.How does the network model represent M:N relationships?
  5. Q5.Define degree and cardinality of a relation.
  6. Q6.Why is the relational model the most popular?

Long-answer questions

  1. Q1.Draw an ER diagram for a college and explain its components.
  2. Q2.Explain the hierarchical and network data models with examples.
  3. Q3.Explain the relational model and its integrity rules.
  4. 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.

WhatsApp us