Activity: Data Modeling & Database Security

ER diagrams, database models, and security fundamentals

Grade XII • Computer Science ⏱️ ~25 min

Prerequisites

Objectives Learning Goals & Outcomes

By the end of this activity, you will be able to:

Real-World Application: ER modeling is the first step in building any real-world system — from hospital management to e-commerce. Database security is critical for protecting sensitive data like financial records, health information, and personal identities.

Concept Overview ER Model at a Glance

Peter Chen introduced the Entity-Relationship (ER) Model in 1976. An ER diagram is a blueprint of a database that shows entities (things we store data about), their attributes (properties), and the relationships between them.

ER Diagram Notation Reference:

SymbolRepresentsExample
RectangleEntity setStudent, College
Ellipse / OvalAttributeName, Age
DiamondRelationship setStudies_In
Double EllipseMultivalued attributePhone numbers
Dashed EllipseDerived attributeAge (from DOB)
Double RectangleWeak entity setBank Account
Double LineTotal participationEvery College must have a Student
Part 1 ER Model Deep Dive

1.1 — Entities

An entity is an object or concept about which data is stored. It is represented as a rectangle in an ER diagram.

1.2 — Total Participation

Total participation means every entity in an entity set must have at least one relationship in a relationship set. It is shown with a double line in the ER diagram.

Example: In a Student–College relationship, if every College must have at least one Student, then College has total participation.

Activity: If every employee must belong to exactly one department, which entity has total participation? Employee (total participation in the Belongs_To relationship)

1.3 — Attribute Types

Identify the attribute type for each example:

  1. Key attribute — uniquely identifies an entity; represented by an underlined oval. Example: Stu_Id uniquely identifies a student.
  2. Composite attribute — an attribute composed of sub-attributes. Example: Address is made up of Pin Code, State, and Country.
  3. Multivalued attribute — can hold more than one value; represented by a double oval. Example: A person can have multiple Phone Numbers.
  4. Derived attribute — value is calculated from another attribute; represented by a dashed oval. Example: Age is derived from Date of Birth.

Match the Symbols:

1.4 — Relationship Types

Identify the relationship type for each scenario:

  1. One-to-One (1:1): A Person has one Passport, and a Passport belongs to one Person. 1:1
  2. One-to-Many (1:M): A Customer can place many Orders, but an Order belongs to one Customer. 1:M
  3. Many-to-One (M:1): Many Students study in one College, but a Student cannot study in multiple Colleges. M:1
  4. Many-to-Many (M:N): Students can work on many Projects, and a Project can have many Students. M:N

1.5 — ER Diagram Practice

In the ER diagram for Student and College:

Question: What would change if we wanted to show that every student must study in a college? Add a double line from Student to Studies_In (total participation)

Part 2 Hierarchical Database Model

2.1 — Tree Structure

The hierarchical model was one of the earliest database models. It stores data in a tree-like structure where:

Real-World Example (from notes): Windows Registry is a hierarchical database. Directory & file systems also follow this model.

2.2 — Employee-Computer Example

Employee Table (Parent)
Emp_NumberEmp_NameEmp_Salary
1Ram60000
2Shyam15000
3Geeta70000
Computer Table (Child)
Serial_NumberTypeEmp_Number (FK)
A100001PC1
B930002PC2
C101703PC3

The Employee table is the parent; the Computer table is the child. Each computer points to exactly one employee via the foreign key.

2.3 — Disadvantages of Hierarchical Model

Part 3 Network Database Model

3.1 — Improvement Over Hierarchical

The network model was created to address the shortcomings of the hierarchical model. The key improvement: a child can have multiple parents.

3.2 — Advantages

3.3 — Disadvantages

Part 4 Centralized vs. Distributed Database

4.1 — Centralized Database

A centralized database is stored, maintained, and managed at a single location. Users from different locations access it via a network (LAN, WAN, Internet).

AdvantagesDisadvantages
Easier to access and coordinate data (single location)Data traffic is higher (all requests go to one place)
Minimal data redundancySingle point of failure — system failure can destroy all data
Cheaper to set up and maintainHarder to scale as the organization grows

4.2 — Distributed Database

A distributed database consists of multiple databases spread across different physical locations, connected by a computer network. Each location manages its data independently.

AdvantagesDisadvantages
Easy to expand (data already spread across locations)Costly to set up and maintain
Accessible from different networksComplex to manage and administer
More secure (no single point of failure)Difficult to provide a uniform view to all users

4.3 — Quick Comparison

FeatureCentralizedDistributed
LocationSingle siteMultiple sites
CostCheaperMore expensive
SecuritySingle point of failureData spread out, more resilient
ScalabilityHarder to scaleEasier to expand
Data RedundancyMinimalCan exist (but managed)
ComplexitySimpleComplex
Part 5 Database Security

5.1 — Why Data Security Matters

Database security refers to the tools, controls, and measures designed to establish and preserve database confidentiality, integrity, and availability. A data breach can cause:

5.2 — Common Security Threats

ThreatDescription
Insider threatsMalicious insiders (intentional harm), negligent insiders (errors), or infiltrators (outsiders who obtain credentials via phishing).
Human errorAccidents, weak passwords, password sharing. Causes nearly 49% of all reported data breaches.
Software vulnerabilitiesHackers exploit unpatched flaws in DBMS software. Vendors release security patches regularly.
SQL/NoSQL injectionMalicious SQL or NoSQL code inserted into queries served by web applications.
Buffer overflowWriting more data to a memory block than it can hold; excess data in adjacent memory is used to launch attacks.
DoS / DDoS attacksOverwhelming the database server with requests so legitimate users cannot access it. DDoS comes from multiple servers.
MalwareSoftware written to exploit vulnerabilities or cause damage to the database.
Attacks on backupsBackup data that is not protected with the same controls as the live database.

5.3 — Security Solutions (Layered Approach)

Database security extends far beyond the database itself. Consider each layer:

5.4 — Types of Controls

Control TypePurposeExamples
AdministrativeGovern installation, change, and configuration managementPolicies, procedures, role assignments
PreventativeStop unauthorized access before it happensAccess controls, encryption, tokenization, masking
DetectiveMonitor and alert on suspicious activityActivity monitoring, data loss prevention tools
Challenge Quiz: Test Your Knowledge

1. In an ER diagram, a double rectangle represents:

  • Regular entity
  • Weak entity
  • Multivalued attribute
  • Total participation
Show answer
Weak entity — an entity that cannot be uniquely identified by its own attributes and depends on another entity.

2. A Customer can place many Orders, but each Order belongs to one Customer. What type of relationship is this?

  • One-to-One (1:1)
  • One-to-Many (1:M)
  • Many-to-One (M:1)
  • Many-to-Many (M:N)
Show answer
One-to-Many (1:M) — one Customer to many Orders.

3. Which database model allows a child to have multiple parents?

  • Hierarchical model
  • Network model
  • Flat file model
  • Relational model
Show answer
Network model — it was designed to overcome the hierarchical model's limitation of single-parent children.

4. Which is a disadvantage of a centralized database?

  • Harder to expand
  • Higher data redundancy
  • Less secure (single point of failure)
  • More costly than distributed
Show answer
Less secure (single point of failure) — a system failure at the central location can destroy all data.

5. Approximately what percentage of all reported data breaches are caused by human error?

  • 10%
  • 25%
  • 49%
  • 75%
Show answer
49% — accidents, weak passwords, and password sharing are major contributors.
Assessment Prep Ready for the Interactive Assessment

What to Expect in the Assessment:

Key Points to Remember: