Database Administration and Management Lecture 2
Database Administration and Management Lecture 2
and Management
Components, Architecture, Language and
Functions of DBMS
Lecture # 2
Objectives of the Lecture
By the end of this lecture, students will:
1. Components of DBMS
2. Database Architecture
3. Three-Level ANSI-SPARC Architecture
4. Database Languages
5. Functions of a DBMS
Components of DBMS:
1.Logical Components
Data:
The actual information stored in the database.
Organized into tables, with each table consisting of rows (records) and
columns (attributes).
Example: A table for students may have columns like Name, Roll Number,
and Course.
Schema:
The blueprint or design of the database.
Data is organized, including tables, relationships, and constraints.
Example: A schema might describe which tables are linked by primary and
foreign keys.
Metadata:
Information about the database itself.
Describes data types, table structures, and relationships.
Example: Metadata tells us a column is of type VARCHAR(50).
2.Functional Components
Query Processor:
Interprets and executes SQL commands.
Example: When you write SELECT * FROM students, the query processor
ensures the correct rows are retrieved.
Transaction Manager:
Manages database transactions and ensures ACID properties:
Atomicity: All parts of a transaction are completed or none are.
Consistency: Ensures the database remains valid after a transaction.
Isolation: Transactions don’t interfere with each other.
Durability: Changes persist even if the system crashes.
Example: Transferring money between bank accounts.
Storage Manager:
Handles storing and retrieving data on disk.
Manages files, indexes, and backups.
3.Physical Components
Database:
The physical files where all data is stored.
DBMS Software:
Software like Oracle, MySQL, or PostgreSQL used to manage the database.
Users:
End Users: People who query or interact with the database.
Application Developers: Developers building software that uses the database.
Database Administrators (DBAs): Responsible for managing and maintaining
the database.
Database Architecture
Two-Tier Architecture:
The client directly connects to the server (DBMS).
Example: Desktop applications like MS Access.
Three-Tier Architecture:
Adds an application layer between the client and server.
Example: Web applications where users interact through a browser, the server
processes the request, and then accesses the database.
Types of Database Architectures
Centralized:
One database instance for the entire system.
Example: A single database for a small company.
Distributed:
Data is stored across multiple locations but behaves as a single database.
Example: Multinational companies with databases in different regions.
Cloud-Based Databases:
Hosted on cloud platforms like AWS or Azure.
Provides scalability and reduces hardware dependency.
Key Concepts
Logical vs. Physical Data Independence:
Logical Independence: The schema can be changed without altering
applications.
Physical Independence: The data storage method can change without
affecting the schema.
Database Engine and Query Optimizer:
The database engine executes SQL queries.
The query optimizer finds the most efficient way to execute a query.
Three-Level ANSI-SPARC
Architecture
Three-Level ANSI-SPARC Architecture
1. External Level :
The external level is the user view of the database. It describes how data is
presented to the users and how they interact with it. Multiple external views of the
same data can exist, depending on user requirements.
Key Points:
User-Specific Views: Each user or group may see different data based on their
access rights. For example, a sales department might see customer orders, while
an HR department sees employee records.
Purpose: It provides data abstraction—users don't need to know how data is
stored or organized, just how to query and interact with it.
Example:
A reporting user might see data from multiple tables (sales, customers, products)
aggregated in a specific format, while a customer service user sees only basic
customer information.
Why It’s Important:
Security: By giving different users access to different views, sensitive
information can be hidden.
Flexibility: New views can be created for new users without altering the
2.Conceptual Level
The conceptual level is the logical view of the entire database. It defines all the data
elements, their relationships, and constraints, but it does not define how they are
stored. This level focuses on what data is stored and how different pieces of data
relate to each other.
Key Points:
It ensures data independence by isolating users from the physical aspects of data
storage.
The conceptual schema provides a unified, abstract representation of the entire
database, offering a blueprint of how data is structured.
Example:
The conceptual schema defines the relationships between Customers, Orders, and
Products. However, it does not concern itself with whether the data is stored in a
flat file, relational tables, or a distributed system.
Key Points:
Physical Storage: This level is concerned with the efficiency of storing data and how
the database management system (DBMS) optimizes access to that data.
Indexing: The internal level describes the indexes, file structures, and data storage
methods used to improve the efficiency of data retrieval.
Example:
The internal schema specifies how a Customer table is stored on disk, which file
stores it, how records are indexed, and how the data is retrieved (e.g., via a B-tree
index).
DDL is a set of SQL commands used to define the structure of the database. It allows
for the creation, modification, and deletion of database objects like tables, views, and
indexes.
Key DDL Commands:
CREATE: Defines a new table, schema, or index in the database.
ALTER: Changes an existing database object (e.g., adding a column to a table).
DROP: Deletes an existing object from the database (e.g., dropping a table).
DDL ensures that database objects are correctly defined and structured, laying the
foundation for storing data.
2. Data Manipulation Language (DML)
DML is a set of SQL commands used for retrieving, updating, inserting, and deleting
data in a database. Unlike DDL, DML works on the data stored in tables.
DML allows users and applications to manipulate the data within the database. It
provides the ability to interact with data stored in the system.
3. Fourth-Generation Languages (4GLs)
4GLs are high-level programming languages that provide a more abstract way to
interact with databases. They typically allow for the creation of user interfaces,
report generation, and querying without writing complex SQL code.
Key Features:
Ease of Use: 4GLs often use a graphical interface, reducing the need to write
SQL code directly.
Automation: Some 4GLs can automatically generate SQL queries based on
user inputs or interface actions.
Examples:
Oracle Forms: A graphical tool to create database forms and reports.
Microsoft Access: A desktop DBMS with a built-in 4GL for easy database
management and querying.
Key Functions:
Data Files: Stores data in files that are organized in a structured way for quick
access.
Indexes: Helps to quickly locate rows in a table without scanning the entire
table.
Buffer Management: Manages memory for caching frequently accessed data.
Key Functions:
Integrity Constraints: Enforces rules like PRIMARY KEY, FOREIGN KEY, NOT
NULL, and CHECK to ensure data quality.
User Authentication: Only authorized users can access the database.
Access Control: Grants and restricts access based on user roles.
Key Concepts:
Atomicity: A transaction is all-or-nothing.
Consistency: Transactions must leave the database in a consistent state.
Isolation: Transactions do not interfere with each other.
Durability: Changes made by a transaction are permanent, even if the system
crashes.
Example:
In a bank transfer, if you withdraw money from one account but fail to deposit into
another, the system should roll back the transaction to prevent inconsistencies.
Why It’s Important:
Guarantees data consistency and ensures that multiple transactions can occur
concurrently without corrupting the data.