IT 231: IT and Applications (BBA)
By the end of this session, you will be able to:
A Database Management System (DBMS) is a software program that enables users to create, maintain, and control access to a database.
Think of it like a librarian for a huge library:
| Spreadsheet (Excel) | DBMS (e.g. MySQL) | |
|---|---|---|
| Size | Max 1,048,576 rows per sheet | Billions of rows |
| Many users at once | Edit conflicts, "file is locked" | Thousands at the same time, safely |
| Rules on data | Easy to type "twenty" in an Age column | Data types and constraints reject bad data |
| Security | Whole file: open or not | Permissions per table, even per column |
| Recovery | Hope you saved a copy | Automatic backups and logs |
Excel is great for analysis. A DBMS is built for shared, reliable storage.
It acts as an interface between users/applications and the physical database.
e.g., Website, Mobile App, Analyst
(The Manager)
e.g., Tables, Records, Files
The DBMS ensures data is consistently organized and easily accessible, preventing chaos.
A DBMS handles several critical tasks to manage the database effectively:
The DBMS uses a Data Definition Language (DDL) to build the database's structure.
This is how an administrator defines the "rules" for the data.
CREATE TABLE Students (
StudentID INT PRIMARY KEY,
FirstName VARCHAR(50),
LastName VARCHAR(50),
EnrollmentDate DATE
);
DDL is used to create tables, define fields, and set constraints.
CREATE TABLE Orders (
OrderID INT PRIMARY KEY,
Phone CHAR(10) NOT NULL,
Amount DECIMAL(10,2) CHECK (Amount > 0),
OrderDate DATE NOT NULL
);
Which of these inserts will the DBMS reject?
1. (1, '9841000000', 850.00, '2026-10-15') ✅ Accepted
2. (1, '9851000000', 500.00, '2026-10-15') ❌ OrderID 1 already exists (primary key)
3. (2, '9861000000', -200.00, '2026-10-15') ❌ The amount must be greater than 0 (CHECK)
4. (3, NULL, 300.00, '2026-10-15') ❌ The phone number can't be empty (NOT NULL)
A Data Manipulation Language (DML) allows users to work with the data.
For relational databases, the standard DML is SQL (Structured Query Language).
-- Retrieve data
SELECT * FROM Students;
-- Insert a new record
INSERT INTO Students VALUES (...);
-- Delete a record
DELETE FROM Students WHERE StudentID=101;
Table Products(ProductID, Name, Price, Stock)
1. Show all products cheaper than Rs 1,000.SELECT * FROM Products WHERE Price < 1000;
2. Add a new product: ID 5, "Dhaka Topi", Rs 1,200, 30 in stock.INSERT INTO Products VALUES (5, 'Dhaka Topi', 1200, 30);
3. Change the price of product 2 to Rs 950.UPDATE Products SET Price = 950 WHERE ProductID = 2;
4. Remove every product that is out of stock.DELETE FROM Products WHERE Stock = 0;
⚠️ If you forget the WHERE in #3 or #4, the change applies to every row!
The DBMS acts as a security guard.
Ensures smooth operation in multi-user environments.
Hari's balance is Rs 10,000. At the same moment, two transactions run:
Reads 10,000
Writes 8,000
Reads 10,000
Writes 15,000 (overwrites A!)
Final balance: Rs 15,000. The correct answer is Rs 13,000, so the bank just lost Rs 2,000. A DBMS prevents this with locking: B must wait until A finishes.
Sending Rs 5,000 from Sita to Ram takes two steps: subtract from Sita, then add to Ram. What if the power fails in between?
A: Atomicity. Both steps happen, or neither does.
C: Consistency. The rules still hold, so the total money stays the same.
I: Isolation. Transactions running at the same time don't interfere (no lost updates).
D: Durability. Once confirmed, it survives a crash.
Every eSewa transfer or bank payment you make is a transaction.
Protects data from loss due to system failures, errors, or disasters.
The DBMS provides tools to create periodic copies (backups) of the database.
If the system crashes, the DBMS can use the backups and transaction logs to restore the database to a consistent state.
This function is absolutely critical for business continuity.
Lesson: A backup you've never tested isn't a backup. Follow the 3-2-1 rule: keep 3 copies, on 2 types of media, with 1 off-site.
The DBMS is the gatekeeper software. The DBA is the person who runs it.
Install and upgrade the DBMS, and design tables with the developers.
Create user accounts and permissions, and run and test backups.
Monitor performance, speed up slow queries, and plan storage growth.
Every Nepali bank, telecom and wallet company employs DBAs. It's a well-paid IT career.
Different systems are chosen based on cost, scale, and features.
1. A small Pokhara homestay wants a cheap booking website. → MySQL or PostgreSQL (free, open-source)
2. A large bank wants its core system with 24/7 vendor support. → Oracle or SQL Server (commercial, supported)
3. A company that already runs everything on Microsoft products. → SQL Server
4. A mobile app that must keep data on the phone while offline. → SQLite, a tiny database built into every Android and iPhone
How does a DBMS (like PostgreSQL or MySQL) power these services?
CREATE TABLE DDL
SELECT DML
ALTER TABLE DDL
UPDATE DML
DROP TABLE DDL
DELETE DML
Bonus: GRANT and REVOKE belong to a third group, DCL (Data Control Language), which manages who can access what.
Short answer
Long answer
Revise the answers in the full note linked on the last slide.
Questions before we wrap this hour?
Next: Unit 8 · Session 4 — Architectures, Applications, and Cloud Databases
Read first, then revise with this deck: