Almost every app you use today is built on top of a database. When you book a train ticket on IRCTC, pay through UPI, check your semester marks on the university portal or order food online, some software is quietly storing, searching and updating huge amounts of data for you.
The software that manages all this data is called a Database Management System, or DBMS. In this chapter we will understand what data, a database and a DBMS are, what a DBMS actually does for us, who uses it, and why it is one of the most important subjects for placements, university exams and GATE.
Data, Information and Database
Before talking about a DBMS, let us get three basic words clear.
Data
Data is a collection of raw facts that can be recorded. On its own, data may not mean much.
Aarav Sharma, 10, 150000, 2018-04-12, Bengaluru
Looking at this line, you cannot be sure what 10 or 150000 means.
Information
Information is data that has been processed or organised so that it has meaning.
Aarav Sharma works in department 10 (Engineering),
earns Rs 1,50,000 per month, joined on 12 April 2018
and is based in Bengaluru.
Same facts, but now they are useful. We can make decisions with them.
Database
A database is an organised collection of logically related data, stored so that it can be easily accessed, managed and updated.
The important words are organised and logically related. A random folder of files is not really a database. A college database, for example, keeps related data together: students, courses, teachers, which student is enrolled in which course, marks, fees, and so on.
What Is a DBMS?
A Database Management System (DBMS) is a software system that lets users define, create, store, query, update and control access to a database, while keeping the data correct, secure and available.
In simple words, the database is the data, and the DBMS is the software that manages it. Together, the database and the DBMS software are often called a database system.
Users / Applications
(website, mobile app, admin, analyst)
|
| requests (usually SQL)
v
+------------------------+
| DBMS | e.g. MySQL, PostgreSQL, Oracle
+------------------------+
|
v
+------------------------+
| Database (on disk) | tables, indexes, logs
+------------------------+
Applications never read the raw database files directly. They ask the DBMS, and the DBMS does the hard work.
Popular DBMS Software
DBMS | Type | Where you will see it |
|---|---|---|
MySQL | Relational (open source) | Web applications, startups, college projects |
PostgreSQL | Relational (open source) | Production web apps, analytics, GIS |
Oracle Database | Relational (commercial) | Banks, telecom, large enterprises |
Microsoft SQL Server | Relational (commercial) | Enterprise and Windows-based systems |
SQLite | Relational (embedded library) | Inside Android/iOS apps and browsers |
MongoDB | NoSQL (document) | Apps storing JSON-like documents |
Redis | NoSQL (key-value, in-memory) | Caching, sessions, leaderboards |
Most of this tutorial focuses on relational DBMSs (RDBMS), where data is stored in tables. We will meet other kinds in the chapters Data Models and NoSQL Databases.
A First Look: Talking to a DBMS
Suppose a company stores its employees in a table. Here is a small part of it:
emp_id | name | dept_id | salary | city
-------+---------------+---------+-----------+-----------
1 | Aarav Sharma | 10 | 150000.00 | Bengaluru
2 | Priya Iyer | 10 | 95000.00 | Chennai
3 | Rohan Mehta | 10 | 95000.00 | Bengaluru
4 | Sneha Kapoor | 20 | 110000.00 | Mumbai
...
To get the employees of department 10, we do not write code to open a file, read it line by line and split each line. We simply describe what we want in SQL:
SELECT name, salary
FROM employees
WHERE dept_id = 10;
MySQL 8 returns:
+--------------+-----------+
| name | salary |
+--------------+-----------+
| Aarav Sharma | 150000.00 |
| Priya Iyer | 95000.00 |
| Rohan Mehta | 95000.00 |
+--------------+-----------+
We never told the DBMS how to find these rows. It decided which file to read, whether to use an index, and how to filter. This "say what, not how" style is called a declarative query, and it is one of the biggest reasons DBMSs are so popular.
A slightly bigger question, "how many employees and what average salary in each department?", is still just a few lines:
SELECT d.dept_name,
COUNT(e.emp_id) AS employees,
AVG(e.salary) AS avg_salary
FROM departments d
LEFT JOIN employees e ON e.dept_id = d.dept_id
GROUP BY d.dept_name
ORDER BY d.dept_name;
+-------------+-----------+---------------+
| dept_name | employees | avg_salary |
+-------------+-----------+---------------+
| Engineering | 3 | 113333.333333 |
| HR | 2 | 59000.000000 |
| Marketing | 1 | 82000.000000 |
| Research | 0 | NULL |
| Sales | 3 | 76666.666667 |
+-------------+-----------+---------------+
Do not worry about the syntax yet; the SQL tutorial covers it step by step. The point here is that the DBMS takes care of combining two tables, grouping and calculating, while we only describe the result we want.
What Does a DBMS Do for Us?
A DBMS is much more than "a place to keep tables". Its main jobs are:
1. Data Definition
We describe the structure of the data: tables, columns, data types and rules. For example, "every employee must have a salary" or "an email must be unique". This description is called the schema.
2. Data Storage and Retrieval
The DBMS decides how data is laid out on disk, keeps indexes for fast search, and fetches only what is needed. A table with crores of rows can still answer a lookup in milliseconds.
3. Data Manipulation
Users insert, update, delete and query data using a query language such as SQL.
4. Integrity (Correctness)
The DBMS enforces rules so that wrong data cannot enter. When we tried to insert an employee into department 99, which does not exist, MySQL refused:
INSERT INTO employees
VALUES (11, 'Test User', 'test@company.com', 99, 1, 50000, '2025-01-01', 'Pune');
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`company_db`.`employees`, CONSTRAINT `employees_ibfk_1` FOREIGN KEY (`dept_id`) REFERENCES `departments` (`dept_id`))
The rule is written once in the schema and checked for every program that touches the data.
5. Concurrency Control
Thousands of users may book tickets on the same train at the same moment. The DBMS makes sure two people do not get the same seat, even though their requests run at the same time.
6. Transactions and Recovery
A money transfer must either happen completely or not at all. If the server crashes halfway, the DBMS uses its logs to undo or finish the work after restart. These are the famous ACID properties, covered in the chapter Transactions & ACID Properties.
7. Security and Authorization
Different users get different permissions. A student can view their own marks; only the exam cell can change them.
8. Data Abstraction
Users see a simple, logical view (tables and rows) and are hidden from complex storage details (pages, blocks, B+ trees). We will study this in Three-Schema Architecture & Data Independence.
Components of a Database System
A complete database system is made of five parts:
Component | What it means |
|---|---|
Data | The actual stored data plus metadata (data about data, such as table names, column types and constraints) |
Hardware | Servers, disks/SSDs, memory and network on which the database runs |
Software | The DBMS itself, the operating system, and application programs |
Users | People who interact with the database in different roles |
Procedures | Rules and instructions for using the system: backup schedules, how to add users, what to do after a failure |
The metadata is stored in a special place called the data dictionary or system catalog. The DBMS reads it all the time, for example to check that a column you mentioned actually exists.
Who Uses a Database?
Database Administrator (DBA)
The DBA is in charge of the database system as a whole: creating users and granting permissions, monitoring performance, planning backups and recovery, tuning storage and upgrading the DBMS.
Database Designers
They decide what data to store and how to structure it: which tables, which columns, which keys and constraints. Good design (covered in the ER model and normalization chapters) avoids many problems later.
Application Programmers
Developers who write programs in Java, Python, Node.js and so on that talk to the database, for example the backend of a shopping app.
End Users
Naive (parametric) users use the database through ready-made screens without knowing it exists, such as a bank cashier or you using a UPI app.
Casual / sophisticated users write their own queries, such as data analysts running SQL reports.
Where Are DBMSs Used?
Domain | Example data |
|---|---|
Banking and payments | Accounts, balances, transactions, UPI payments |
Railways and airlines | Trains, seats, bookings, PNR status |
Universities | Students, courses, attendance, results |
E-commerce | Products, carts, orders, payments, reviews |
Hospitals | Patients, doctors, appointments, prescriptions |
Telecom | Subscribers, call records, recharges |
Social media | Users, posts, likes, followers |
Advantages and Disadvantages of a DBMS
Advantages
Less redundancy: data is stored in one controlled place instead of many copies.
Consistency: with fewer copies there are fewer chances of conflicting values.
Easy data access: ad hoc questions can be answered with a query instead of writing a new program.
Integrity constraints are enforced centrally.
Safe concurrent access by many users.
Backup and recovery from crashes.
Security through users, roles and permissions.
Data independence: storage can change without rewriting applications.
Disadvantages
Cost and complexity: licences (for commercial systems), hardware and trained staff.
Overhead: logging, locking and constraint checks make a DBMS slower than a plain file for very simple, single-user tasks.
Single point of failure: if the central database is down, every application that depends on it is affected (which is why replication is used).
The next chapter, File System vs DBMS, explains exactly which problems a DBMS solves compared to storing data in ordinary files.
A Very Short History
Period | Milestone |
|---|---|
1950s to early 1960s | Data kept in files on tapes and disks, each program managing its own files |
1960s | Navigational databases: Charles Bachman's IDS (network style) and IBM's IMS (hierarchical) |
1970 | E. F. Codd at IBM publishes the relational model |
1970s | IBM System R and UC Berkeley's Ingres prove relational databases can be practical; SQL is born (as SEQUEL) |
1980s | Commercial relational DBMSs (Oracle, DB2 and others) spread; SQL is standardised (ANSI 1986) |
1990s | Open-source MySQL and PostgreSQL; databases power the early web |
2000s onward | NoSQL systems for web-scale data; later "NewSQL" and cloud-managed databases |
Even today, relational databases with SQL remain the default choice for most business applications.
Common Mistakes Students Make
Calling MySQL a database. Strictly, MySQL is a DBMS;
company_dbcreated inside it is a database. In daily talk people mix them, but in exams be precise.Thinking DBMS = SQL. SQL is a language used to talk to relational DBMSs. The DBMS is the software that runs it.
Thinking a DBMS is only storage. Its real value is in integrity, concurrency, recovery and security.
Confusing data and information. Data is raw; information is processed, meaningful data.
Interview Questions
1. What is the difference between a database and a DBMS?
A database is the organised collection of related data. A DBMS is the software used to define, store, query, update and protect that data. Example: MySQL is a DBMS; company_db is a database inside it.
2. What is metadata? Where is it stored?
Metadata is data about data, such as table names, column types, constraints and users. It is stored in the data dictionary (system catalog). In MySQL you can read it from information_schema.
3. Name some functions of a DBMS.
Data definition, storage and retrieval, manipulation, integrity enforcement, concurrency control, transaction management and recovery, security, and data abstraction.
4. What is an RDBMS?
A relational DBMS stores data as relations (tables) of rows and columns, connects tables through keys, and is usually queried with SQL. MySQL, PostgreSQL, Oracle and SQL Server are RDBMSs.
5. Who is a DBA and what does a DBA do?
The Database Administrator manages the database system: user accounts and permissions, backups and recovery, performance tuning, storage planning and upgrades.
6. When might you NOT use a DBMS?
For tiny, single-user, simple data where the overhead is not worth it, for example a small configuration file or a log that is only appended and read sequentially.
Summary
Data is raw facts; information is meaningful, processed data.
A database is an organised collection of related data; a DBMS is the software that manages it.
A DBMS handles definition, storage, querying, integrity, concurrency, recovery, security and abstraction.
A database system has five components: data, hardware, software, users and procedures.
Users include the DBA, designers, application programmers and end users.
Relational DBMSs with SQL dominate business applications; NoSQL systems serve special needs.
Next, we will see why we need a DBMS at all by comparing it with the traditional file system approach.