Basics of DBMS
DBMS Fundamentals
[Link]
Data
• The Basic Concept: Data is any collection of facts and figures related to an entity.
• A Technical Definition: From a scientific perspective, data is a set of values consisting of qualitative (descriptive) or
quantitative (numerical) variables.
• The Singular vs. Plural:
○ Datum: A single value of a single variable (e.g., a person's age).
○ Data: The collective set of those values (e.g., the ages of everyone in a classroom).
• Collection & Observation: Data is typically gathered through observation, measurement, or research to be used as a
basis for reasoning or calculation.
[Link]
Information
● While "data" and "information" are often used interchangeably, they represent different stages of processing.
● Distinct Meanings: Data and information have distinct meanings in the context of analysis.
● The Transformation: Data is transformed into information when it is viewed in context or in post-analysis.
● Key Definition: Processed Data is called information.
○ Example: A list of temperatures (Data) becomes a weather forecast (Information) once it is analyzed to
predict the weekend's conditions.
[Link]
Data Base
● Introduction: A database provides a structured way to manage the data we have collected, moving it from
simple raw facts into a system where it can be efficiently stored and retrieved.
○ Core Definition: A database is an organized collection of data.
○ Storage and Access: These collections are generally stored and accessed electronically from a computer
system.
○ Purpose: The primary goal of a database is to maintain large amounts of information in a way that remains
easy to find, update, and manage.
[Link]
Data Base Management System
The DBMS is the software "manager" that handles the database for us.
● The Definition: It is the software that interacts with users and applications to capture and analyze data.
● The History: Before DBMS, we used "Flat Files" (like simple text files). This was messy because data was duplicated, and
different people couldn't edit the same file easily.
● The Need: We need a DBMS to handle Concurrency (multiple users), Security (protecting data), and Integrity
(preventing errors).
● Modern Examples:
1. MySQL: Used by companies like Facebook and Twitter to store user profiles.
2. Oracle: Used by banks to manage millions of financial transactions safely.
[Link]
Problem With Traditional File Systems
• Data Redundancy and Inconsistency: The same information is stored in multiple places, leading to conflicting
data. Example: A student changes their phone number in the "Attendance File," but the "Fees File" still has the
old number.
• Difficulty in Accessing Data: There is no easy way to search for specific records quickly. Example: To find all
students from "Delhi" who scored over 90%, a programmer must write a completely new program from scratch
just to get that list.
• Data Isolation: Data is trapped in different formats and locations. Example: Trying to link a "Student Bio" text
file with a "Grade" spreadsheet is nearly impossible because they "don't speak the same language".
• Integrity Problems: It is difficult to enforce data rules. Example: The system allows a "Marks" field to be filled
with -50 because there is no built-in check to ensure scores are only between 0 and 100.
• Atomicity Problems: Partial updates occur if the system crashes. Example: During a bank transfer, $500 is
deducted from Account A, but the power goes out before it reaches Account B—the money simply disappears.
• Concurrent Access Anomalies: Multiple users editing at once cause errors. Example: Two clerks open the same
"Library Book" file at the same time; one marks it as "Returned" and the other as "Lost," resulting in the last
person to hit "Save" overwriting the other's work.
[Link]
Advantages of DBMS
● A Database Management System (DBMS) is specialized software that solves the critical flaws of old file systems by providing a
secure, centralized way to manage data.
● Data Independence: Changes made to the database structure do not require changes to the application programs. Example: You
can change how a "Phone Number" is stored in the database without having to rewrite the entire mobile app.
● Multi-User Access & Concurrency Control: Multiple users can access and edit the same data at once without conflicts. Example:
Two people can book the last seat on a flight at the exact same time; the DBMS ensures only the first person to click "Pay" gets
the seat.
● Data Security & Authorization: Access is strictly controlled through user roles and passwords. Example: A bank teller can view
your balance, but only a branch manager has the "Authorization" to approve a large loan increase.
● Reduced Data Redundancy: Data is stored centrally in one place, ensuring it remains consistent and reliable. Example: When you
update your address once on a website, it automatically reflects in your "Orders," "Profile," and "Shipping" sections.
● Database Design Support: DBMS helps architects plan data storage using professional methods like Top-Down and Bottom-Up
design. Example: Designing a school system by first looking at the "Big Picture" (all students) and then breaking it down into
smaller details (classes, subjects).
● Front-End Connectivity: The system can easily connect to modern software tools like Visual Basic, C++, or web apps to display
data to users. Example: An e-commerce app on your phone acts as the "Front-End" that connects to a powerful DBMS "Back-
End" to show you products.
[Link]
Disadvantages of DBMS
While a DBMS offers powerful solutions for data management, it also introduces specific challenges and costs that organizations must consider.
● High Initial Cost: Setting up a professional system requires significant investment in high-end hardware, expensive software licenses, and
ongoing maintenance. Example: A small startup may find the $50,000+ price tag for a high-performance database server and licensing too
expensive to start with.
● Technical Complexity: Because these systems are sophisticated, they require highly skilled Database Administrators (DBAs) to manage,
design, and keep them running. Example: You cannot just "install and forget" a DBMS; you need a professional to tune it so it doesn't
become slow as your data grows.
● Performance Overhead: For very simple, single-user tasks, a DBMS can actually be slower than a basic file because of the "checks" it
performs. Example: Opening a small list of 10 names in a text file is instant, but doing it through a DBMS requires login, security checks, and
query processing.
● Impact of a System Failure: Since all data is centralized in one place, a single failure can stop the entire organization from working. Example:
If the central database of a hospital goes down, every department—from pharmacy to the ER—loses access to patient records at once.
● Security Vulnerability: Centralizing all "eggs in one basket" makes the database a high-value target for cyber-attacks. Example: A hacker
only needs to breach one central system to steal all customer credit card numbers instead of hunting through hundreds of separate files.
● Training Requirements: Both developers and end-users need specific technical training to use the system correctly and safely. Example: An
untrained employee might accidentally delete a vital table or write a "bad query" that freezes the system for everyone else.
[Link]
View of Data (Levels of Abstraction)
A database system should provide a clear, simplified view of data while hiding the
complex technical details. This is achieved through three distinct levels of
abstraction, often called the Three-Schema Architecture.
● Physical Level (The Bottom Level): This describes how the data is actually
stored in the hardware (hard disks, servers). It is the lowest level of abstraction
and involves complex data structures. Example: Only the Database
Administrator (DBA) works at this level to decide which physical disk stores the
customer records.
● Logical Level / Conceptual Level (The Middle Level): This level describes what
data is stored and the relationships between that data. It defines the database
structure using entities and data types. Example: A table design that shows
"Student Name" is a string and "Roll Number" is an integer—the system knows
they are related but doesn't care exactly where on the disk they sit.
● View Level (The Top Level): This is the highest level of abstraction and is what
the user actually sees. It shows only the parts of the database that the specific
user is interested in. Example: A student can see their own "Grade Report" but
cannot see the "Financial Records" or "Salaries" of the teachers.
[Link]
Instance and Schemas
To understand a database, we must distinguish between its permanent structure and its ever-changing content. We can
compare this to a variable in a computer program.
● Database Schema: This is the overall design or "skeleton" of the database. It is defined during the initial setup and
remains fixed.
○ Variable Example: Declaring a variable like int studentCount; is the Schema. You have defined that the
name is "studentCount" and it can only hold integers. The structure is now set.
● Database Instance: This is the actual data stored in the database at a specific moment in time.
○ Variable Example: If studentCount = 50; at 9:00 AM, that is the Instance. If five more students join and the
value becomes 60 at 10:00 AM, the schema (the integer variable) stays the same, but you have a new Instance.
[Link]