Comprehensive Introduction to Database Management Systems

Traditional File-Oriented Systems and the Academic Context

  • Definition of a Data File: A collection of logically related records. In this environment, every specific application maintains its own dedicated data files containing only the records required for that application's functions.

  • Academic Application Example: Includes files for:

    • Employee data

    • Student data

    • Course data

    • Registration data

    • Used by the Registrar’s office.

  • Accounts Application Example: Includes files for:

    • Account files

    • Employee data

    • Student data

    • Tuition Fees data

    • Financial aid

    • Used by the Accounting department.

  • Departmental Silos: Applications such as Human Resources, Sales and Marketing, and Manufacturing often operate with disjointed derivative files or master files containing data elements labeled AA to ZZ  where redundant copies (e.g., elements AA , BB , DD , EE ) appear across different programs.

Disadvantages of File-Oriented Systems

  • Data Redundancy: Information is frequently duplicated across different files. This results in significant memory wastage because the same data is stored in multiple locations.

  • Data Inconsistency: As a direct consequence of redundancy, updating data in one file without updating it in another leads to a state where the database is no longer consistent.

  • Difficulty in Accessing Data: Retrieving information is neither convenient nor efficient in traditional file processing systems.

  • Limited Data Sharing (Data Isolation): Data is scattered across various files which may be stored in different folders, utilize different formats, or belong to different departments. This isolation makes it difficult to share data across applications.

  • Integrity Problems: Data integrity ensures xdata is both correct and consistent. In file systems, it is difficult to enforce the constraints necessary to ensure that stored data satisfies correctness rules.

  • Atomicity Problems: Operations on a database must be atomic, meaning they must occur in their entirety or not at all. File systems struggle to recover correctly if an operation fails midway.

  • Concurrent Access Anomalies: To improve performance and response times, multiple users are allowed to access data simultaneously. Without proper management, this leads to anomalies where data overrides or conflicting reads occur.

  • Security Problems: Access should be restricted so that users only interact with data concerning their specific requirements. Enforcing such limited access is difficult in individual file systems.

Introduction to Database Management Systems (DBMS)

  • Conceptual Definition: A database is a collection of related data representing some aspect of the real world.

  • Software Definition: A DBMS is a collection of programs enabling users to organize, store, and retrieve data. It is a general-purpose software system facilitating the defining, constructing, manipulating, and sharing of databases among users and applications.

  • Primary Goals:

    • Provide an environment that is convenient and efficient for storing and retrieving information.

    • Provide an abstract view of the database to users by hiding underlying technical complexities.

Historical Perspective of DBMS

  • Initial Development: In 19601960 , Charles W. Bachman designed the Integrated Database System, which is recognized as the first DBMS.

  • IBM’s Entry: IBM developed its own system known as IMS (Information Management System).

  • Relational Model: In the early 1970s1970s , E.F. Codd published a landmark paper proposing the relational database model.

  • ER Modeling: In 19761976 , P. Chen proposed the Entity-Relationship (ER) model.

  • Query Standardization: In 19801980 , Structured Query Language (SQL) became the standard query language for databases.

Transition to the Database Approach

  • Integrated and Shared Environment: Unlike the traditional approach, the database approach uses a centralized DBMS to manage Academic info, Student data, Course data, and Employee data.

  • Components of the Database System:

    • Users/Programmers: Interact via application programs or queries.

    • DBMS Software: Contains software to process queries/programs and software to access stored data.

    • Stored Database Definition (Meta-Data): Known as the Data Dictionary.

    • Stored Database: The actual data repository.

  • Addressing File System Disadvantages:

    • Redundancy and Inconsistency: Solved through a shared and integrated environment.

    • Access Difficulties: Solved through Query Language Support.

    • Data Isolation: Solved through the use of a shared environment and Data Dictionary.

    • Integrity: Managed via integrity constraints stored in the Data Dictionary.

    • Atomicity: Managed by the Recovery Manager through rollback and commit operations.

    • Concurrency: Managed by the Concurrency Manager and Lock Manager.

    • Security: Managed by the Data Base Administrator (DBA) using Grant and Revoke commands recorded in the Data Dictionary.

ANSI SPARC Three-Level Architecture

  • External Level (View Level):

    • The highest level where end-users interact with the system.

    • Consists of multiple View 1View\,1 , View 2View\,2 , to View nView\,n  representing the part of the database relevant to specific user groups.

    • Hides the remaining database from the user group to simplify interaction.

  • Conceptual Level (Logical Level):

    • Describes the structure of the entire database.

    • Defines what data is stored and the relationships existing among that data.

    • This is the level where programmers and DBAs operate.

  • Internal Level (Physical Level):

    • The lowest level describing how data is actually stored.

    • Covers complex low-level data structures and access methods.

  • Mappings:

    • External/Conceptual Mapping: Transforms requests between the user's view and the logical model.

    • Conceptual/Internal Mapping: Transforms requests between the logical model and the physical storage structure.

Data Independence

  • Definition: The property of a DBMS that allows the modification of a database schema at one level without requiring a change to the schema at the next higher level.

  • Physical Data Independence (PDI):

    • The ability to change the physical/internal level without affecting the conceptual or external levels.

    • Allows providing a logical description of the database without specifying physical structures.

    • Examples of PDI changes:

      • Using new storage devices (e.g., Hard Drive or Cloud migration).

      • Modifying file organization techniques.

      • Switching to different data structures.

      • Changing access methods or modifying indexes.

      • Changing compression techniques or hashing algorithms.

  • Logical Data Independence (LDI):

    • The ability to change the conceptual schema without changing the external views, programs, or APIs.

    • Changes are absorbed by the mapping between external and conceptual levels.

    • LDI is generally more challenging to achieve than PDI.

    • Examples of LDI changes:

      • Adding, modifying, or deleting a new attribute, entity, or relationship.

      • Merging two separate records into one.

      • Breaking one existing record into two or more records.

Database Languages

  • Data Definition Language (DDL): Used to change the structure of tables (e.g., CREATE, DROP, ALTER, TRUNCATE). Interpreted DDL generates the Data Dictionary (or Catalog/Data Directory), which stores Metadata (data about data).

  • Data Manipulation Language (DML): Used to access or modify data (e.g., INSERT, UPDATE, DELETE).

    • Procedural DML: User specifies what data is needed and exactly how to retrieve it.

    • Declarative DML (Nonprocedural): User specifies what data is needed without specifying the retrieval method.

    • DML commands are not auto-committed; they can be rolled back unless explicitly saved.

  • Data Control Language (DCL): Used to manage authority (e.g., GRANT, REVOKE).

  • Transaction Control Language (TCL): Manages transactions within DML (e.g., COMMIT, ROLLBACK, SAVEPOINT). DDL operations like CREATE/DROP are automatically committed.

  • Data Query Language (DQL): Specifically used to fetch data (e.g., SELECT).

  • Data Storage Definition Language (DSDL): Defines the internal schema, including the number of bits per field, the order of fields, and physical record access.

Database User Categories

  • Application Programmers: Developers who interact via DML queries embedded in programs written in languages like C, C++C++ , JAVA, or Pascal. These queries are converted to object code.

  • Sophisticated Users: Database developers who interact directly using query languages like SQL. They do not use pre-written applications.

  • Specialized Users: Sophisticated users who develop complex, specialized database application programs.

  • Naive Users: Individuals who interact with the system solely through existing application interfaces.

Role of the Database Administrator (DBA)

  • The DBA is the custodian of the database, responsible for administration, maintenance, and handling security breaches or performance issues.

  • Key Responsibilities:

    • Installing and upgrading DBMS servers.

    • Defining schemas, storage structures, and access methods.

    • Modifying schemas and physical organization.

    • Performance tuning and capacity planning.

    • ETL (Data Extraction, Transformation, and Loading).

    • Migrating database servers and troubleshooting.

    • Backup, recovery, and security enforcement.

    • Documentation.

Real-World Applications

  • E-commerce: Platforms like Amazon and Flipkart.

  • Online Streaming: Services such as Netflix, Prime Video, and Hotstar.

  • Social Media: Facebook, Twitter, and Instagram.

  • Finance: Banking and Insurance sectors.

  • Travel: Airline, Railway, and Bus reservation systems.

  • Institutional Management: Hospital management and University/Educational institutes.

  • Retail: General retail management systems.