Chapter-1-Basic-Concepts-of-Database-Management-System (1)
Chapter-1-Basic-Concepts-of-Database-Management-System (1)
of Databases
Chapter 1: Unlocking the Power of Databases
Introduction
Imagine a world where every decision you make—whether purchasing an item online,
withdrawing cash from an ATM, or booking a flight—relies on an intricate web of systems
working silently behind the scenes. These systems manage vast oceans of data with
precision, ensuring everything happens seamlessly, quickly, and securely. At the heart of
these operations lies a powerful tool: the Database Management System (DBMS).
Databases are everywhere. They power the apps on your phone, support global corporations,
and even help researchers push the boundaries of human knowledge. Yet, they remain a
hidden cornerstone of our digital age. This chapter introduces you to the world of DBMS,
peeling back the curtain to reveal how data is transformed into a vital asset that drives
innovation, efficiency, and progress.
By understanding databases and the systems that manage them, you gain the ability to:
● Build systems that store and retrieve information quickly and reliably.
● Ensure the accuracy, security, and consistency of data.
● Tackle real-world problems in banking, healthcare, logistics, education, and
countless other domains.
Whether you’re an aspiring developer, data analyst, IT professional, or simply a curious
learner, mastering database concepts equips you with tools to excel in a data-driven world.
4. Real-World Applications
Explore how databases solve problems across industries, from enabling seamless
online shopping experiences to managing complex healthcare records.
Inculcating Concepts
Basic Concepts of Database Management System (DBMS)
Data refers to raw facts or figures about objects or entities that, on their own, do not
carry meaningful context or provide identification. Think of data as the individual
building blocks of information—it’s foundational but incomplete when isolated.
When you combine Emp_No, Name, and Salary for an employee into a structured
format, it becomes information. For instance:
● Employee No: 12345
● Name: John Doe
● Salary: $50,000
Together, these data points describe a specific employee and provide meaningful
insight.
A data file is a collection of related pieces of information that are grouped together
for specific purposes or organizational needs. Data files provide a way to store,
access, and manage information systematically.
Applications of DBMS
Databases are indispensable in modern society, as they enable the efficient management
and retrieval of data across various domains. Here’s a closer look at their applications:
1. Banking
Banks rely heavily on DBMS to manage customer information, account balances,
loans, and transactions. For instance:
● Tracking millions of customer records and their banking history.
● Facilitating real-time processing of deposits, withdrawals, and fund
transfers.
● Enabling the seamless operation of ATMs and online banking systems.
2. Airlines
The airline industry depends on DBMS to manage reservations and schedules
efficiently. This includes:
● Handling seat availability and real-time bookings.
● Managing flight schedules, customer itineraries, and frequent flyer programs.
● Ensuring smooth coordination between airports and airlines globally.
3. Universities
Educational institutions use DBMS to manage student, course, and grade
information. This includes:
● Maintaining records of enrolled students, their courses, and academic
performance.
● Handling course registrations, timetables, and faculty assignments.
● Generating transcripts and reports for administrative and academic
purposes.
4. Credit Card Transactions
Credit card companies leverage DBMS to:
● Track customer spending and generate monthly statements.
● Monitor transactions for fraud detection and prevention.
● Analyze spending patterns for personalized offers and credit scoring.
5. Telecommunications
Telecom companies use DBMS to manage massive amounts of data, including:
● Keeping records of calls made and received and generating monthly bills.
● Maintaining balances for prepaid services.
● Storing and managing details about the communication network
infrastructure.
6. Finance
Financial institutions use DBMS to store and manage information about financial
instruments, such as:
● Tracking holdings, sales, and purchases of stocks and bonds.
● Maintaining records for mutual funds and other investment vehicles.
● Generating reports for compliance and decision-making.
7. Manufacturing
DBMS is crucial in manufacturing for:
● Managing supply chains and tracking inventory levels.
● Monitoring the production process in factories.
● Keeping records of orders, deliveries, and raw materials.
8. Human Resources
Organizations rely on DBMS to handle employee-related information, such as:
● Storing employee records, including personal details, salaries, and benefits.
● Calculating payroll taxes and generating payments.
● Managing recruitment, performance evaluations, and training records.
On one hand, DBMS offers significant advantages, such as reducing redundancy, ensuring
data consistency, enabling secure and concurrent access, and providing robust backup and
recovery mechanisms. These benefits make it a powerful tool for decision-making,
operational efficiency, and data security.
On the other hand, the implementation of a DBMS is not without its hurdles. The cost of
hardware, software, and staff training can be substantial. Additionally, the complexity of the
system demands technical expertise, and the risk of data loss in case of system failures must
be carefully managed.
Understanding both the advantages and disadvantages of DBMS is crucial for making
informed decisions about its adoption and maximizing its potential while addressing its
challenges. This balanced perspective ensures organizations can harness the benefits of
DBMS while mitigating its risks.
Advantages of DBMS
The adoption of DBMS offers numerous benefits, enhancing efficiency, accuracy, and
security:
1. Reduction of Redundancy and Inconsistency
By centralizing data, DBMS eliminates unnecessary duplication, ensuring that:
● Storage space is optimized.
● Data remains consistent across all applications. For example, an employee’s
address updated in one system automatically reflects in all other systems.
2. Shared Data
DBMS enables multiple users or applications to access data simultaneously,
ensuring seamless collaboration while maintaining consistency.
3. Data Independence
DBMS abstracts the underlying data storage details from applications, allowing
developers to:
● Modify database structures without altering the application code.
● Adapt to changes in storage systems or data formats effortlessly.
4. Improved Integrity
DBMS enforces rules and constraints to maintain data accuracy and consistency.
For example:
● Ensuring employees’ ages are within a valid range (e.g., 18–58 years).
● Preventing invalid data entries through validation checks.
7. Enhanced Security
With access controls, DBMS ensures that:
● Sensitive data (e.g., employee salaries) is visible only to authorized users.
● User privileges are managed based on roles and responsibilities.
Disadvantages of DBMS
Despite its advantages, DBMS comes with certain challenges:
1. Cost of Hardware and Software
High-performance hardware and sophisticated software are required to run a DBMS.
This involves:
● Purchasing or upgrading servers with ample storage and processing power.
● Paying for licensed DBMS software, which can be expensive.
5. Monitoring Performance
● Overview: The DBA is responsible for ensuring the database performs optimally,
even under high loads or complex queries.
● Tasks:
o Continuously monitoring database queries and transaction times.
o Identifying bottlenecks or inefficient queries and optimizing them.
o Allocating resources, such as memory or storage, to match workload
demands.
o Planning for scalability to accommodate future growth.
● Importance: Monitoring and optimization ensure a smooth user experience,
reduce costs, and prevent disruptions to business operations.
Conceptual Level (Logical Level) – The conceptual level represents the logical
structure of the database. It describes what data is stored and the relationships among
them, without involving physical storage details.
Characteristics:
● Describes the entire database logically in terms of entities, attributes, and
relationships.
● Includes definitions of constraints, such as primary keys, foreign keys, and
data integrity rules.
● Presents a single unified view of the database that is used by the Database
Administrator (DBA) and application developers.
Purpose:
This level bridges the gap between the user view and the physical implementation. It
simplifies database design and management.
Example:
In a database, a "Customer" entity with attributes like Customer_ID, Name, and
Address is logically linked to an "Order" entity through a foreign key relationship,
describing the relationship between customers and their orders.
External Level (View Level) – The external level is the topmost layer, closest to the
users. It presents specific portions of the database relevant to a particular user or
application, hiding all unnecessary details.
Characteristics:
● Provides different views of the database for different users or applications.
● Ensures data abstraction by hiding irrelevant details from the user.
● Tailored to the needs of individual users or groups, focusing only on the data
they need to access.
Purpose:
This level simplifies user interaction with the database and enhances usability by
filtering out complexity.
Example:
● A bank teller views customer balances and account histories.
● A branch manager views overall branch performance metrics.
● Both access the same database but interact with distinct external views
tailored to their roles.
Differences between Three Levels of ANSI-SPARC Architecture
Database schemas and instances form the fundamental building blocks of database
systems. Let's explore these concepts thoroughly to build a solid understanding.
Schema
A database schema serves as the blueprint or architectural plan of your database. Just as
architects design buildings before construction begins, schemas define how your database
will be organized and structured.
Think of a schema as a template that dictates:
• How data will be stored
• How tables will be arranged
• Relationships between different pieces of data
• Rules governing data integrity
Types of Database Schemas
Database schemas exist at different levels of abstraction, forming a hierarchical
structure:
1. Physical Schema
• Describes the actual physical storage of data
• Defines how data is stored on disk
• Specifies storage layouts and memory allocation
• Represents the lowest level of abstraction
2. Logical Schema
• Defines what data exists in the database
• Describes relationships between different data elements
• Specifies data structures and constraints
• Forms the middle layer of abstraction
3. View Schema/Subschema
• Creates customized views of the database
• Allows different perspectives of the same data
• Enables selective presentation of information
• Forms the highest level of abstraction
Instance
An instance represents the actual data stored in your database at a particular point in time.
While schemas remain relatively stable, instances are dynamic and constantly changing as
data is added, modified, or deleted.
Consider this analogy:
• Schema = Building blueprint (unchanging)
• Instance = Actual building contents (constantly changing)
Practical Example
Consider a school database:
Schema Definition:
Teacher Table
- name: String
- date_of_birth: Date
- date_of_joining: Date
Instance Example:
-- Today's Instance
Teacher Table
ID Name DOB DOJ
1 John Smith 1980-01-15 2015-06-01
2 Jane Doe 1985-03-20 2018-09-15
Data Dictionary
A data dictionary is a specialized component of a relational database system that maintains
comprehensive metadata about the database structure and organization. It serves as a
centralized repository containing detailed information about all aspects of the database,
acting as a reference guide for both the database management system and its users. In other
word, a data dictionary is a set of metadata (i.e. data about data) which contains the
definition and representation of data elements.
3. Attribute Domains
Domains define the valid range of values for each attribute:
• Value Constraints: Specifies minimum/maximum values
• Format Rules: Defines acceptable patterns
• Enumerated Values: Lists permitted options
Example:
DOMAIN_NAME: SALARY_RANGE
MIN_VALUE: 30000
MAX_VALUE: 150000
FORMAT: NUMERIC(8,2)
4. Storage Information
Physical storage details are maintained for efficient data retrieval:
• Tablespace Locations: Physical storage areas
• Block Allocation: Space management parameters
• Index Locations: Associated index storage details
Example:
STORAGE_LOCATION: EMPLOYEE_TABLESPACE
BLOCK_SIZE: 8192 bytes
INDEX_FILE: EMPLOYEE_INDEX_01
5. View Definitions
Views are virtual tables defined over existing relations:
• View Names: Unique identifiers for each view
• Base Relations: Source tables used in view definition
• Query Definitions: SQL statements defining the view
Example:
VIEW_NAME: ACTIVE_EMPLOYEES
BASE_RELATIONS: EMPLOYEE, DEPARTMENT
DEFINITION: SELECT * FROM EMPLOYEE WHERE STATUS = 'ACTIVE';
6. Table Constraints
Constraints ensure data integrity:
• Primary Keys: Uniquely identifies each record
• Foreign Keys: Maintains referential integrity
• Unique Constraints: Ensures attribute uniqueness
• Check Constraints: Validates data conditions
Example:
CONSTRAINT_NAME: PK_EMPLOYEE_ID
TYPE: PRIMARY KEY
ON: EMPLOYEE(EMPLOYEE_ID)
Database User
There are different types of database system users differentiated by the way they expect
to interact with the system.
Naive Users: These are end users who interact with the system by invoking permanent
application program that have been written previously. They need not be aware about the
application program they only use it. Ex:- ATM users
Application Programmer: They are computer professionals who develop the application
program. The application programs could be written in a general-purpose programming
language such as PASCAL, COBOL, C, C++.
Sophisticated User: These users interact with the system without writing the program.
They form the request by writing queries in database query language. Analysts who submit
queries to explore data in the database fall in this category.
Specialized User: Users who are responsible for writing specialized database applications
that do not fit into the conventional data processing system. For ex. Computer Aided
Design (CAD), Artificial Intelligence System etc.