Data & Analytics
SQL & Database Querying Interview Questions & Answers
Prepare for your SQL & Database Querying interview with 28+ curated questions and answers, organised into 4 topics from beginner to advanced. Each topic also has tutorials and MCQ practice.
Advanced SQL
All 7 questions- What are window functions in SQL? Beginner
Functions calculating across related rows without grouping.
- What is a CTE in SQL? Beginner
Common table expression creating temporary result sets.
- What is a subquery? Beginner
Query inside another query.
- What is ROW_NUMBER? Intermediate
Assigns numbers to rows.
- What is a CASE statement? Intermediate
Conditional logic in SQL.
SQL Aggregations & Grouping
All 7 questions- What are SQL aggregate functions? Beginner
Functions summarizing data like SUM, COUNT, and AVG.
- What does GROUP BY do? Beginner
Groups rows for aggregation.
- What is HAVING in SQL? Beginner
Filters grouped results.
- What is COUNT DISTINCT? Intermediate
Counts unique values.
- What is the difference between WHERE and HAVING? Intermediate
WHERE filters rows, HAVING filters groups.
SQL Basics
All 7 questions- What is SQL? Beginner
SQL, Structured Query Language, is used to retrieve and manage data in relational databases.
- Why should data analysts learn SQL? Beginner
Most business data is stored in databases.
- What are basic SQL commands? Beginner
SELECT, FROM, WHERE, GROUP BY, ORDER BY, and JOIN.
- What does SELECT do in SQL? Intermediate
Retrieves columns from tables.
- What does WHERE do in SQL? Intermediate
Filters rows.
SQL Joins
All 7 questions- What are SQL joins? Beginner
Combining data from multiple tables.
- What is an inner join? Beginner
Returns matching rows from both tables.
- What is a left join? Beginner
Returns all rows from left table and matches from right.
- What is a right join? Intermediate
Returns all rows from right table.
- What is a full outer join? Intermediate
Returns all rows from both tables.