JobPrepAI > SQL Practice

Free SQL Interview Practice Questions

Sharpen your database querying skills with real-world technical interview challenges. Solve questions covering joins, window functions, CTEs, and aggregations with instant evaluation.

Interview Questions Catalog

Find the second highest salary from the Employee table. If there is no second highest salary, return NULL.

#Subqueries#Aggregations#LIMIT#Window Functions

Write a SQL query to find employees who have the highest salary in each department.

#Joins#Subqueries#GROUP BY#Window Functions

Find employees who are high earners, defined as earning one of the top three unique salaries in their department.

#Window Functions#DENSE_RANK#Joins#CTEs

Write a SQL query to report all the duplicate emails in the Person table.

#Aggregations#GROUP BY#HAVING

Find all numbers that appear at least three times consecutively in the Logs table.

#Window Functions#LEAD#LAG#Self Join

Report the first name, last name, city, and state of each person in the Person table.

#Joins#LEFT JOIN