A DBMS is the software that stores data and answers questions about it. Your program never reads the disk directly. It sends SQL to the engine, and the engine works out how to get the answer.
Four parts of a DBMS matter in an interview. The storage engine owns the files and the indexes. The query processor parses your SQL and builds a plan. The transaction manager decides what happens when two programs change the same row. The recovery manager keeps a log so the engine can undo work after a crash.
Your application talks to the engine through a driver. The engine talks to the storage engine underneath. That split is why the same SQL works on a laptop and on a busy server.
The script below builds a tiny database and then asks it a question. Two students take the Database Systems course and one takes Operating Systems. The LEFT JOIN keeps a course even when nobody takes it, and the count shows how many do.
-- Build a small database, then ask it a question.
CREATE TABLE courses (
id INTEGER PRIMARY KEY,
title TEXT NOT NULL
);
CREATE TABLE students (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
course_id INTEGER REFERENCES courses(id)
);
INSERT INTO courses (id, title) VALUES (1, 'Database Systems');
INSERT INTO courses (id, title) VALUES (2, 'Operating Systems');
INSERT INTO students (id, name, course_id) VALUES (1, 'Asha', 1);
INSERT INTO students (id, name, course_id) VALUES (2, 'Bilal', 1);
INSERT INTO students (id, name, course_id) VALUES (3, 'Chen', 2);
SELECT c.title AS course,
COUNT(s.id) AS students
FROM courses c
LEFT JOIN students s ON s.course_id = c.id
GROUP BY c.title
ORDER BY students DESC, c.title;
You can see the split at work. The CREATE TABLE statements describe the structure, which is the schema. The SELECT states the question. The engine picks the join order and the index to use, then hands back two rows, each with a course name and a count.
The result shows Database Systems with 2 students and Operating Systems with 1. Notice that the count comes from COUNT(s.id) and not from COUNT(*). With a left join, COUNT(*) counts the course row too, so a course with no students would show 1 instead of 0.
A DBMS owns the data and describes its shape. A file system only stores bytes and hands the same bytes back.
The first difference is structure. A DBMS keeps a schema, so column names, types and links between tables are known to the engine. A file has no such idea. A file named students.csv cannot tell you that course_id points at the courses table.
The second difference is the access path. You ask a DBMS a question in SQL, and it picks a plan that often uses an index. With files, every answer comes from code you wrote that reads the file and filters it by hand.
The third difference is safety under load. A DBMS handles concurrent writes with locks, keeps a log for recovery, and can take a consistent backup while people keep working. With files, two programs writing the same file at once can corrupt it, and recovery is manual.
The cost sits on the other side. A DBMS needs more memory, more setup and a schema that someone maintains. For one user and one small file, that overhead is hard to justify.
The same data in a file system also has no shared meaning. Two teams can each keep a copy, and the copies drift apart. A DBMS gives one place where the current version lives.
ACID is the name for the four guarantees a transaction gives you.
Atomicity means all or nothing. If any step of the transaction fails, none of it stays.
Consistency means the rules of the schema hold before and after. If a column is NOT NULL, it is still NOT NULL at the end.
Isolation means concurrent transactions do not see half finished work from each other. The engine picks a level for this, from read uncommitted up to serializable.
Durability means a committed transaction survives a crash. The engine writes its log before it confirms the commit.
The script below shows atomicity and durability in SQLite. It moves 300 between two accounts and commits, so the change stays. Then it starts another change and rolls it back, so that one never lands.
-- Transactions: work that either lands fully or not at all.
CREATE TABLE accounts (
id INTEGER PRIMARY KEY,
holder TEXT NOT NULL,
balance INTEGER NOT NULL
);
INSERT INTO accounts (id, holder, balance) VALUES (1, 'Asha', 1000);
INSERT INTO accounts (id, holder, balance) VALUES (2, 'Bilal', 500);
BEGIN;
UPDATE accounts SET balance = balance - 300 WHERE id = 1;
UPDATE accounts SET balance = balance + 300 WHERE id = 2;
COMMIT;
SELECT holder, balance FROM accounts ORDER BY id;
-- Now undo a change before it is committed.
BEGIN;
UPDATE accounts SET balance = balance - 200 WHERE id = 1;
ROLLBACK;
SELECT holder, balance FROM accounts ORDER BY id;
Both listings show 700 and 800. The rollback put the balance back exactly as it was, which is the atomicity part in practice.
Isolation is what people get asked about most. When two transactions touch the same row, the engine can block the second one until the first finishes, or let it read the old value. The level you pick decides between speed and strictness. SQLite allows one writer at a time, so writes behave like the strictest option.
Durability is the quiet one. The engine appends the change to a log before it answers the commit, so a power cut loses at most the work that was never confirmed.