Real questions from top companies in SQL
Write a SQL query to calculate the highest salary in each department using a window function
Write a SQL query to calculate the running total of sales per region, partitioned by year.
Write a SQL query to detect customers who have not placed a second order in 90 days.
Write a SQL query to find departments with more than 10 employees.
Write a SQL query to find distinct IDs from a table where the count is more than 1 and greater than 200.
Write a SQL query to find employees earning the second-highest salary.
Write a SQL query to find house with Avg(score) > 70.
Write a SQL query to find the second highest salary in each department.
Write a SQL query to find the top 3 selling products per region in the last month.
Write a SQL query to find the top 5 most ordered dishes in the last 30 days.
Write a SQL query to find the top 5 products by sales per region.
Write a SQL query to find users to recommend specific artists
Write a SQL query to rank shows by daily viewership across different regions
Write a SQL query to remove duplicates from a table.
Write a query for second-highest salary using LIMIT, OFFSET, or ROW_NUMBER()
Write a query that identifies numbers appearing at least three times consecutively without interruption
Write a query that ranks users by their total order amount within each region.
Write a query to calculate Monthly Active Users (MAUs) for July 2022
Write a query to calculate the day's difference between the 1st and 3rd sales of the CustomerName = 'Alice Johnson'.
Write a query to calculate the total revenue generated by each product category.
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.