CSC265 Database Management System

Database Management SystemUnit 18 min read

Unit 1: Database & Database Users – Core Concepts & Roles

Unit 1 of Database Management System: introduces fundamental concepts of data, databases, DBMS, data abstraction, schemas, and the various user roles that interact with a database system.

Key points

  • A database is a structured collection of data managed by a DBMS, which separates data from applications.
  • Data abstraction layers (conceptual, logical, physical) enable independent evolution of data models and storage.
  • Database users include application users, developers, DBAs, data architects, and administrators, each with distinct responsibilities.
  • DBMSs are classified by data model: hierarchical, network, relational, object‑oriented, and NoSQL, each suited to different application needs.
  • Normalization (1NF, 2NF, 3NF) eliminates redundancy and ensures data integrity, while ACID properties guarantee reliable transaction processing.

1.1 What Is a Database?

A database is a logically organized, persistent collection of data that supports efficient retrieval, insertion, update, and deletion. It is not a file; it is a structured repository that can be queried, indexed, and secured.

1.1.1 Key Terminology

Term Definition
Data Raw facts and figures, unprocessed.
Database A set of related data stored in a structured form.
DBMS (Database Management System) Software that creates, manages, and interacts with databases.
Database System The DBMS together with the database it manages.
Database Catalog Metadata repository that stores information about database objects (tables, indexes, users, privileges).

1.2 Data Abstraction and Data Models

Data abstraction is the process of hiding lower‑level details from higher‑level users. It is achieved through three layers:

Layer Purpose Example
Conceptual Global view of the entire database. ER diagram of a university.
Logical View of data for a particular application. Relational schema for a banking system.
Physical How data is stored on disk. B‑tree index on CustomerID.

A data model is a formal representation of data and its relationships. Common models:

Model Primary Structure Typical Use
Hierarchical Tree File systems, early main‑frame applications
Network Graph (nodes & edges) Complex many‑to‑many relationships
Relational Tables (rows & columns) OLTP systems, ERP
Object‑oriented Objects & classes CAD, scientific computing
NoSQL Key‑value, document, column, graph Big data, real‑time analytics

1.2.1 Classification of DBMSs by Data Model

DBMS Type Data Model Strengths Weaknesses
Hierarchical Tree Fast traversal, simple queries Rigid structure, limited flexibility
Network Graph Handles many‑to‑many, flexible Complex programming, less common
Relational Tables Mature, SQL, ACID Not ideal for unstructured data
Object‑oriented Objects Natural mapping to OO code Limited standardization
NoSQL Various Scales horizontally, schema‑free Weak consistency, limited transactions

1.3 Schemas, Instances, and Database State

  • Schema: The definition of the database structure (tables, columns, constraints).
  • Instance: A snapshot of the database at a particular time, i.e., the actual data stored.
  • Database State: The current instance; changes over time as transactions occur.

1.3.1 Example

Consider a simple banking database:

Customer (CustomerID, CustomerName, Address, Phone, Email)
Borrow (CustomerID, LoanNumber)
Loan (LoanNumber, LoanType, Amount)
  • Schema: The three table definitions above.
  • Instance: A specific set of rows, e.g., CustomerID=101 with name "Ramesh".
  • State: The entire set of rows at a given moment.

1.4 Database Users and Their Roles

User Type Primary Responsibilities Typical Tools
Application Users Interact with applications that read/write data. Web portals, mobile apps
DBAs (Database Administrators) Install, configure, backup, tune, and secure DBMS. Oracle Enterprise Manager, pgAdmin
Developers Design schemas, write queries, build applications. IDEs, SQL editors
Data Architects Model data, enforce standards, design data warehouses. ER modeling tools
Data Scientists Extract, transform, analyze data for insights. Python, R, Spark
System Administrators Manage underlying OS, network, and hardware. Linux, Windows Server

1.4.1 Interaction Flow

  1. Developers design the schema and write application code.
  2. DBAs deploy the schema, set up security, and monitor performance.
  3. Application users access data through the application layer.
  4. Data scientists query the database for analytics.

1.5 Traditional File Processing vs Database Approach

Feature File Processing Database Approach
Data Redundancy High Low (normalization)
Data Integrity Manual checks Constraints, triggers
Concurrent Access Poor Controlled via locks, transactions
Security File‑level Role‑based access, encryption
Backup & Recovery Manual Automated, point‑in‑time
Query Flexibility Limited (sequential scans) Powerful query languages (SQL)
Scalability Limited Horizontal/vertical scaling

1.6 Normalization – Eliminating Redundancy

Normalization is a systematic process of decomposing tables to reduce redundancy and avoid update anomalies.

1.6.1 1NF (First Normal Form)

  • Rule: Each column must contain atomic (indivisible) values; no repeating groups.
  • Example: Customer(PhoneNumbers) → split into separate rows or a child table.

1.6.2 2NF (Second Normal Form)

  • Rule: In 1NF, all non‑key attributes must depend on the entire primary key (no partial dependency).
  • Example: Order(OrderID, CustomerID, CustomerName) → move CustomerName to Customer table.

1.6.3 3NF (Third Normal Form)

  • Rule: In 2NF, no transitive dependency (non‑key → non‑key).
  • Example: Employee(EmployeeID, DeptID, DeptName) → separate Department table.

Worked Example – Banking Database

Original table:

Borrow (CustomerID, CustomerName, LoanNumber, LoanType, Amount)
  1. 1NF: Ensure atomic columns – already satisfied.
  2. 2NF: Remove partial dependency on CustomerID:
    • Customer (CustomerID, CustomerName)
    • Loan (LoanNumber, LoanType, Amount)
    • Borrow (CustomerID, LoanNumber)
  3. 3NF: Remove transitive dependency:
    • No further changes needed; each non‑key attribute depends only on its own key.

Resulting schema eliminates redundancy and update anomalies.

1.7 ACID Properties – Foundations of Reliable Transactions

Property Meaning Example
Atomicity All or nothing. A transfer of ₹10,000 from A to B either completes fully or not at all.
Consistency Database remains in a valid state. Foreign key constraints are preserved after a transaction.
Isolation Concurrent transactions do not interfere. Two users updating different rows see no partial updates.
Durability Once committed, changes survive failures. After a power outage, committed data is intact.

1.8 Database Recovery Techniques

When a failure occurs, recovery ensures the database returns to a consistent state.

Technique How It Works Pros Cons
Undo/Redo Logging Log every change; undo on crash, redo on restart. Guarantees durability, supports partial rollbacks. Requires disk I/O for logs.
Checkpoints Periodic snapshots of database state. Reduces recovery time. Adds overhead during normal operation.
Shadow Paging Maintain two copies of pages; switch after commit. Simple to implement. Requires double storage space.
Redo Logs Only redo information; assumes system can replay. Faster writes. Cannot recover uncommitted changes.

1.9 Summary of Advantages and Disadvantages of DBMS

Advantage Disadvantage
Centralized control and security Requires skilled DBAs
Data independence Performance overhead for abstraction
Concurrent access control Complexity of transaction management
Backup & recovery Cost of commercial DBMS licenses
Standard query language (SQL) Limited flexibility for unstructured data in relational DBMS

1.10 Exam Tip

  • Understand the hierarchy: Know the difference between data, database, DBMS, database system, and catalog.
  • Be ready to classify: Given a data model, identify the DBMS type and list its strengths/weaknesses.
  • Normalization drills: Practice converting a denormalized table into 1NF, 2NF, 3NF; be able to explain each step.
  • ACID & recovery: Memorize the four ACID properties and give a concise example of each.
  • User roles: Match responsibilities to user types; be able to explain why each role is essential.
  • Past question patterns: Many questions ask for classification, schema design, or writing simple SQL queries; practice writing clear, concise answers.

Good luck!

Based on the TU BSc CSIT syllabus for Database Management System (CSC265), unit 1.

Discussion

Loading…