The document contains a comprehensive list of SQL technical interview questions categorized into five sections: Query Logic & Joins, Filtering, Aggregation & Grouping, Subqueries & CTEs, Indexing & Performance Tuning, and Data Integrity & Transactions. Each section includes questions that assess understanding of SQL concepts, functions, and performance optimization techniques. The questions range from basic definitions to advanced SQL functionalities, aiming to evaluate a candidate's depth of knowledge in SQL.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
4 views2 pages
SQL Technical Interview Questions
The document contains a comprehensive list of SQL technical interview questions categorized into five sections: Query Logic & Joins, Filtering, Aggregation & Grouping, Subqueries & CTEs, Indexing & Performance Tuning, and Data Integrity & Transactions. Each section includes questions that assess understanding of SQL concepts, functions, and performance optimization techniques. The questions range from basic definitions to advanced SQL functionalities, aiming to evaluate a candidate's depth of knowledge in SQL.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
SQL Technical Interview Questions
Query Logic & Joins
1. Explain how JOIN works internally. 2. What is the difference between LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN, and CROSS JOIN? 3. How would you join three or more tables in a single SQL query? 4. Write a SQL query to return employees with the same salary from the same department. 5. Explain self-joins with an example use case.
Filtering, Aggregation & Grouping
1. What's the difference between WHERE and HAVING? 2. Why can't you use HAVING without GROUP BY? 3. How do window functions differ from aggregate functions? 4. How can you find the cumulative sum of a column using SQL? 5. Write a query to return each department's top 2 highest-paid employees.
Subqueries & CTEs
1. What is a correlated subquery and how does it work? 2. What are common table expressions (CTEs) and when should they be used? 3. Difference between a subquery and a CTE? 4. How do you use a recursive CTE? Give an example. 5. What's the performance impact of using subqueries in SELECT vs WHERE?
Indexing & Performance Tuning
1. What is indexing and how does it improve performance? 2. Difference between clustered and non-clustered index? 3. How would you identify slow-running queries in a large database? 4. How do you optimize a SQL query? 5. What's the cost of using SELECT * and how can you avoid it?
Data Integrity & Transactions
1. What are transactions in SQL? 2. Explain ACID properties. 3. What is a deadlock and how can you prevent it? 4. What are isolation levels in SQL? 5. How do you handle dirty reads?
Advanced Functions & Logic
1. What is the CASE statement in SQL? 2. How would you pivot rows into columns? 3. What's the difference between RANK(), DENSE_RANK(), and ROW_NUMBER()? 4. What is COALESCE() vs ISNULL()? 5. What is the difference between EXISTS, IN, and ANY?