SQL MCQs

SQL multiple choice questions covering SELECT queries, joins, aggregations, subqueries, and indexing.

28 MCQs2 subtopicsProgrammingAll Levels
Key Concept Overview & Exam Context

Review core principles of SQL before answering questions. These questions simulate placement technical assessments (TCS, Infosys, Amazon), university exams (CS/IT), and technical certifications.

Target Readiness
Placements & Job Interviews
Question Format
Multiple-Choice with Explanations
Verified Solutions
Step-by-step Output Traces

Browse by Subtopic

SQL MCQ Questions

Page 1 of 2 (28 total)
Q1

What is the difference between DELETE and TRUNCATE in SQL?

medium
Correct Answer: DELETE removes rows one at a time and can be rolled back, while TRUNCATE removes all rows at once and is generally faster
Explanation:
DELETE is a logged, row by row operation that supports a WHERE clause and can be undone within a transaction, while TRUNCATE deallocates the data pages directly and typically cannot target specific rows.
Q2

What does the UNION operator do in SQL?

medium
Q3

What is the difference between UNION and UNION ALL?

medium
Q4

What does the SQL EXISTS operator check for?

medium
Q5

What is the purpose of a composite primary key in a table?

medium
Q6

What does the SQL constraint UNIQUE ensure?

easy
Q7

What is a subquery in SQL?

easy
Q8

What is the purpose of the SQL ALTER TABLE statement?

easy
Q9

What does a RIGHT JOIN return?

medium
Q10

What is the purpose of the SQL DISTINCT keyword?

easy
Q11

What is a trigger in SQL?

hard
Q12

What is the difference between the WHERE clause and the HAVING clause in SQL?

medium
Q13

What does the SQL LIKE operator allow you to do?

easy
Q14

What is the purpose of the SQL COALESCE function?

medium
Q15

What is the effect of adding a NOT NULL constraint to a column?

easy
Q16

What does the SQL BETWEEN operator do?

easy
Q17

What is a natural join in SQL?

hard
Q18

What is the purpose of the SQL CASE expression?

medium
Q19

What does an outer join guarantee that an inner join does not?

medium
Q20

What is the purpose of the SQL AS keyword?

easy
Showing 1 to 20 of 28 questions