Real questions from top companies
Why is HAVING clause used only after GROUP BY?
Why not use ROW_NUMBER() instead? Discuss pros and cons.
Why star schema? Compared with snowflake schema and normalized approaches.
Window Functions: ROW_NUMBER(), RANK(), PARTITION BY - produce output using dataset
Write SQL query for sum of marks grouped by student.
Write SQL query to find names starting with 'R' and ending with 't', sorted by first_name descending
Write SQL query to replace specific patterns in a string column.
Write SQL to identify employees whose salary is higher than their manager's.
Write a Merge Statement for SCD Type 2.
Write a PySpark job to find the top 3 employees of each department, where Age < 30 and Salary > department average salary.
Write a SQL query leveraging window functions and timestamps to identify updates over time
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.
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.