Practice · Data & SQL

SQL problems that make you explain the result.

Do not jump straight to the answer. Read the schema, predict the rows, write your query, then compare your reasoning with the solution and alternatives.

IntermediatePortable SQL with a window-function alternative

Second Highest Salary in SQL

Solve the second-highest-salary problem with duplicate-safe SQL, null handling, alternatives, and performance reasoning.

DISTINCTMAXsubquerieswindow functionsrankingNULL handling
Solve with tutor guidance →