Real questions from top companies
Find 3rd Highest Salary
Find Employees with Maximum Salary in Each Department
Find average salary by department, max average salary, and list of employees for the max salary department.
Find average salary for each manager β Assume a table with manager_id and employee_salary
Find each student's previous year's scores using the LAG function.
Find employees who earn the third-highest salary.
Find non-common records in two tables (SQL EXCEPT or NOT IN)
Find the 2nd highest salary for each department using the DENSE_RANK() function.
Find the error in the provided SQL query.
Find the second-highest salary in the employees table using three different methods.
Find the third-highest salary for each department.
Finding nth Highest Salary within each department
Given a CSV file with raw customer transactions, design an ETL pipeline that cleans data, aggregates total sales by region and product, and loads into target table
Given a complex nested query, how would you refactor it for better readability and efficiency?
Given a dataset, perform transformations: Filter rows where sales > 1000, Add a new column calculating a 10% discount on sales, Group data by region and calculate total revenue.
Given a table of sales data, use window functions to calculate a running total.
Given a table with 10 records and another with 4 records, how many records result from a cross join?
Given a table with sales data, write a query to find consecutive days with decreasing revenue.
Given an unoptimized query execution plan, how would you diagnose and improve performance?
Given the data below, explain the results of different types of joins: Inner Join, Left Join, Right Join. Will a schema be created?
Type or paste your answer to any of these questions and our AI Coach scores it, highlights gaps, and rewrites it at FAANG quality. Free to try.