All Templates

SQL Query Challenges

Sharpen your SQL skills with questions on joins, subqueries, aggregation, window functions, and query optimization. Covers real-world query patterns.

MEDIUM7 questions12 minDatabase

Question Preview

1.What is the difference between INNER JOIN and LEFT JOIN?
INNER JOIN returns only matching rows; LEFT JOIN returns all left rows with NULLs for unmatched right rows
LEFT JOIN is always faster than INNER JOIN
INNER JOIN works on multiple tables; LEFT JOIN works only on two
They produce identical results in all cases
EASYMultiple Choice
2.What does the HAVING clause do in SQL?
Filters grouped results after GROUP BY, allowing conditions on aggregate functions
Orders the result set in ascending order
Limits the number of rows returned
Creates a temporary table for the query
MEDIUMMultiple Choice
3.What is a window function in SQL?
A function that performs calculations across a set of rows related to the current row without collapsing them
A function that opens a new database connection for each query
A function that only works within stored procedures
A function that creates a view from the query results
HARDMultiple Choice

+ 4 more questions included in the full template