Real questions from top companies in SQL
Write a query to find employees in the same department as 'John'.
Write a query to find minimum age.
Write a query to find the 5th highest salary in an employee table and calculate the number of employees whose salary is greater than that of their manager.
Write a query to find the first number repeating consecutively three times in a sequence.
Write a query to find the median salary of employees in a table.
Write a query to find the top 5 most-sold Adidas products in the last month.
Write a query to find the top three customers by total revenue within each region.
Write a query to find the total number of rides per driver in the last 30 days.
Write a query to generate the specified output using advanced SQL skills with joins, aggregations, and window functions.
Write a query to get the latest rule_id and rule_status.
Write a query to get the names of all employees who are managers with five or more direct reports.
Write a query to identify duplicate customer entries based on email and phone number.
Write a query to identify unique user sessions.
Write a query to remove duplicate records from a table while retaining the earliest entry.
Write a query to retain only the latest record and delete others in case of duplicates.
Write a query to select the latest record based on a time_of_insertion column.
Write a query to switch values in the Gender column (M to F and F to M).
Write a self join query to get the manager's name for each employee.
Write an SQL query to find the top 3 performing products in each category
Write code to find the third-highest salary in a dataset using Pandas.
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.