Real questions from top companies in SQL Β· medium
How do you handle NULL values in SQL? Mention functions like COALESCE and ISNULL.
How would you handle duplicate records in an SQL table?
Implement a query to find the top 5 customers by total sales amount.
SQL query to find the second highest salary from each department.
What are primary keys and foreign keys? Why are they important?
What is a self-join, and when would you use it?
What is normalization and denormalization? When would you use each?
What is the difference between a view and a materialized view?
Write an SQL query to find duplicate emails in a users table.
Triggers in ADF, especially tumbling window triggers.
What is a window function? Explain with an example.
What is the difference between OLTP and OLAP?
Write a SQL query to find top 3 earners in each department.
Write a query to find the top three highest-paid employees in each department using window functions.
Write complex SQL queries involving multiple joins, subqueries, and data aggregation logic.
Add Row Numbers using window function in PySpark
Add a column to the Employees table that shows the name of the employee with the next higher employee_id.
Add a new column with manager names for each employee using a self-join.
Add a new column with the average salary by department.
Advanced SQL with CTEs and Conditional Joins
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.