SQL Viva Questions: A Must-Read for Tech Students
Estimated study time: 45 minutes. Common viva questions and short, exam-ready answers.
A viva voce exam tests whether you can explain concepts clearly, not just recall syntax. These are the SQL questions examiners ask most often, along with concise answers you can build on.
Q1: What is a primary key?
A column (or set of columns) that uniquely identifies each row in a table. It cannot contain NULL values, and a table can have only one primary key.
Q2: What is the difference between a primary key and a unique key?
Both enforce uniqueness, but a primary key disallows NULL values while a unique key allows one NULL value (in most database systems).
Q3: What is normalization, in simple terms?
The process of organizing a database to reduce redundancy and improve data integrity, typically achieved by splitting data into related tables (1NF, 2NF, 3NF).
Q4: What is a foreign key?
A column that creates a link between two tables by referencing the primary key of another table, enforcing relational integrity.
Q5: What is a transaction, and what are its ACID properties?
A transaction is a sequence of operations executed as a single unit. ACID stands for Atomicity, Consistency, Isolation, and Durability — the properties that guarantee reliable database transactions.
Q6: What is the difference between DELETE and TRUNCATE?
DELETE removes rows one at a time and can be rolled back; it also fires triggers. TRUNCATE removes all rows at once, is faster, but generally cannot be rolled back and doesn't fire row-level triggers.