JobNetWork
← All Prep Trek tracks

🗄️ DBMS, in 10 cards

No chapters to read. Each card gives you the one-line answer, a picture, a quick try-it and the trap interviewers hope you fall into. About 15 minutes for all ten.

0 of 10 done

1 of 10 · Basics

What is a DBMS, and why not just use files?

Say this first

A DBMS is software that stores data and lets many users safely read, change and protect it at once.

Picture it

File system

  • • Same data repeated in many files
  • • No safe multi-user editing
  • • You write your own search
  • • A crash can corrupt data

Try it

Two people edit the same file at the same time. What usually goes wrong?

Common trap

Saying a DBMS is just 'a place to store data'. Storage is the easy part. The point is safe sharing, security and querying.

Say it like this

A DBMS gives many users one safe, shared copy of the data, with querying, security and crash recovery built in.

2 of 10 · Keys

Explain primary, candidate and foreign keys.

Say this first

A key is a column (or set of columns) that identifies rows or links tables.

Picture it

Tap each one to see what it means.

Try it

A table has id and email, and both are unique. You choose id as the primary key. What is email?

Common trap

Saying a primary key can be NULL. It can't. Also, a table has only one primary key (which can span several columns).

Say it like this

Candidates are the options, the primary key is the one I chose, and a foreign key links to another table's primary key.

3 of 10 · Keys

Primary key vs unique key?

Say this first

Both prevent duplicates, but a primary key identifies the row and a unique key only blocks repeats.

Picture it

Primary key

  • • One per table
  • • Never NULL
  • • Identifies each row

Try it

You need email to be unique, but some users have no email. Which fits?

Common trap

Saying a unique column can never hold NULL. Most databases allow it; SQL Server allows just one.

Say it like this

A primary key identifies the row: one per table, no NULL. A unique key only prevents duplicates, and a table can have many.

4 of 10 · Normalization

What is normalization, and why do we do it?

Say this first

Splitting data into smaller tables so each fact is stored only once.

Picture it

order_idcustomercustomer_phoneitem
1Asha98xxxPen
2Asha98xxxBook
3Ravi97xxxPen

Asha's phone number is stored twice. Change one row and the data now disagrees with itself.

Try it

Asha changes her phone number. In the table above, what is the risk?

Common trap

Saying normalization is only to save space. The real goal is avoiding update, insert and delete anomalies.

Say it like this

Normalization stores each fact once, so an update can't leave the data contradicting itself.

5 of 10 · Normalization

Explain 1NF, 2NF and 3NF.

Say this first

Each form removes one kind of repetition. Every column should depend on the key, the whole key, and nothing but the key.

Picture it

  1. 11NF One value per cell. No lists like 'Pen, Book' in one column.

Memory line: the key, the whole key, and nothing but the key.

Try it

students(roll_no, name, dept_id, dept_name): dept_name depends on dept_id, not on roll_no. Which form is broken?

Common trap

Mixing up 2NF and 3NF. 2NF is about partial dependency on a composite key. 3NF is about one non-key column depending on another.

Say it like this

1NF means atomic values, 2NF means no partial dependencies, and 3NF means no transitive dependencies.

6 of 10 · Transactions

What is ACID?

Say this first

Four guarantees that keep a transaction safe, even if the system crashes.

Picture it

Tap each one to see what it means.

Try it

Money leaves account A, then the server crashes before B is credited. Which property rolls it back?

Common trap

Mixing up Consistency and Isolation. Consistency is about rules staying valid. Isolation is about concurrent transactions not interfering.

Say it like this

Atomicity rolls back half-done work, and durability keeps committed work.

7 of 10 · SQL

INNER JOIN vs LEFT JOIN?

Say this first

INNER keeps only rows that match in both tables. LEFT keeps every row from the left table.

Picture it

JoinKeepsUnmatched rows
INNER JOINOnly rows that match in bothDropped
LEFT JOINAll rows from the left tableRight side shows NULL
RIGHT JOINAll rows from the right tableLeft side shows NULL
FULL JOINAll rows from both tablesNULL on the missing side

Try it

customers has 5 rows but only 3 have orders. You want all 5 customers, with orders where they exist. Which join?

Common trap

Using INNER JOIN and wondering where the customers with no orders went. INNER drops anything unmatched.

Say it like this

INNER keeps matches only. LEFT keeps everything from the left table and fills NULL where there's no match.

8 of 10 · SQL

DELETE vs TRUNCATE vs DROP?

Say this first

DELETE removes chosen rows, TRUNCATE empties the table, DROP removes the table itself.

Picture it

DELETETRUNCATEDROP
RemovesChosen rowsAll rowsThe whole table
Can use WHEREYesNoNo
Table structureStaysStaysGone
TypeDMLDDLDDL
RollbackYes, in a transactionDepends on the databaseDepends on the database

Try it

You want to empty a table but keep its structure for reuse. What is usually fastest?

Common trap

Calling DROP 'delete everything'. DROP removes the table itself, structure included.

Say it like this

DELETE removes chosen rows, TRUNCATE empties the table, and DROP removes the table itself.

9 of 10 · Indexing

What is an index, and what is the catch?

Say this first

A sorted lookup structure that lets the database find rows without scanning the whole table.

Picture it

With an index

  • • Jumps straight to matching rows
  • • Searches on that column get much faster

Try it

A column is searched in almost every query, and the table has 10 million rows. Good candidate for an index?

Common trap

Saying 'index every column'. Each index slows writes and costs space, so index only what you search, join or sort on.

Say it like this

An index speeds up reads by avoiding a full scan, but it costs storage and makes writes slower.

10 of 10 · Basics

SQL vs NoSQL?

Say this first

SQL stores related data in fixed tables. NoSQL trades that structure for flexibility and easy scaling out.

Picture it

SQL (relational)

  • • Tables with a fixed schema
  • • Strong joins and transactions
  • • Best for structured, related data

Try it

A banking app needs safe transfers between accounts. Which is the classic fit?

Common trap

Saying NoSQL is 'better' or 'faster'. It is a trade-off: flexibility and scale versus joins and strict structure.

Say it like this

I'd pick SQL for structured, related data that needs transactions, and NoSQL when the schema varies or scale-out matters most.

Full DBMS Notes

Want the rest?

The free cards cover the basics. The full notes add 21 more cards in the same style, plus SQL practice and rapid-fire answers:

  • • ER model, cardinality, BCNF and denormalization
  • • Transaction states, isolation levels, deadlocks and MVCC
  • • Clustered indexes, B-trees, views, triggers and NULLs
  • • 8 SQL interview queries with answers
  • • 20 rapid-fire one-line answers
See guides and what's coming →

A prep aid, not a guarantee of a job.