Databases and SQL
Keys, normalisation, joins, transactions and ACID, indexes. 20 questions with model answers.
1. What is a DBMS? Why use one instead of files? Basic
A database management system is software that stores data and lets many users add, read, change and delete it safely. Compared with plain files it avoids duplicate and inconsistent data, lets many people work at once without clashing, enforces rules such as unique IDs, controls who can see what, recovers after a crash and lets you query data with a language like SQL instead of writing code for every search.
What the interviewer listens for
- Software to store and manage data
- Less duplication and inconsistency than files
- Concurrent access, security and recovery
- Querying with SQL
They may ask next: What is the difference between a DBMS and an RDBMS?
2. What is the difference between a primary key, a unique key and a foreign key? Basic
A primary key uniquely identifies each row and cannot be null; a table has one primary key, which may span several columns. A unique key also forbids duplicates, but a table can have several and they usually allow null. A foreign key is a column in one table that points to the primary key of another table, such as order.customer_id pointing to customer.id, so you cannot have an order for a customer that does not exist.
What the interviewer listens for
- Primary: unique, not null, one per table
- Unique: no duplicates, can be several, null allowed
- Foreign: links to another table's key
- Referential integrity
They may ask next: What happens to orders when the customer they point to is deleted?
3. What are candidate keys, super keys and composite keys? Basic
A super key is any set of columns that uniquely identifies a row, even with extra columns. A candidate key is a minimal super key: remove any column and it stops being unique. One candidate key is chosen as the primary key; the others are alternate keys. A composite key is a key made of more than one column, such as student_id plus course_id in an enrolment table.
What the interviewer listens for
- Super key: any unique set of columns
- Candidate key: minimal super key
- Primary chosen from candidates, rest are alternate
- Composite: more than one column
They may ask next: In a student table, which columns could be candidate keys?
These are 3 of the 20 questions. The rest, and practice rounds with Ari, come with Campus Ready.
Sign up free to take the placement tests and see your readiness
It takes a minute with your email. AiTeky Pass (₹999/month or ₹9,999/year) is free for your first 30 days.

