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 2 of 2 (28 total)
Q1

What does it mean for a SQL query to use a window function?

hard
Correct Answer: It performs a calculation across a set of rows related to the current row without collapsing them into a single result, unlike GROUP BY
Explanation:
Window functions such as ROW_NUMBER or RANK let you compute running totals or rankings while still returning one row per original row, which is different from GROUP BY, which reduces multiple rows into one summary row per group.
Q2

Which SQL clause is used to filter rows AFTER aggregating with GROUP BY?

easy
Q3

Which JOIN returns all rows from the left table and matching rows from the right table, filling with NULL where there is no match?

easy
Q4

Which SQL clause is used to filter group results created by the GROUP BY clause?

easy
Q5

Which join returns all rows from the left table, and matching rows from the right table, filling nulls if no match exists?

easy
Q6

Which SQL operator returns true if a subquery returns at least one row?

medium
Q7

Which SQL constraint uniquely identifies each record in a database table and disallows NULL values?

easy
Q8

What is the Cartesian product join of two tables with M and N rows respectively?

medium
Showing 21 to 28 of 28 questions