Most data analyst interviews do not start with machine learning.
They start with SQL and Excel.
That may sound basic, but this is where many candidates lose the interview. Not because they do not know the tools, but because they cannot explain how they use them to solve real business problems.
A recruiter does not want to hear only, “I know VLOOKUP” or “I can write SQL queries.”
They want to know if you can clean messy data, join tables correctly, find patterns, create reports, explain numbers and make decisions easier for the team.
That is why SQL and Excel interview questions are so important for aspiring analysts. These two tools test your technical skills, business thinking and practical problem-solving ability.
This blog covers the most important SQL and Excel interview questions for analysts, with simple answers, practical examples, mistakes to avoid, salary expectations, job roles, career growth and preparation tips.
If you are preparing for a data analyst, business analyst, MIS analyst, reporting analyst, BI analyst or operations analyst interview, this guide will help you prepare with more confidence.
Why SQL and Excel Are Important for Analyst Interviews
SQL and Excel are still the foundation of analytics work.
Excel helps analysts clean, organize, summarize and present data quickly. SQL helps analysts extract and analyze data from databases.
In real companies, analysts often use both together.
For example, you may use SQL to pull customer transaction data from a database. Then you may use Excel to clean it, build pivot tables, create charts and prepare a quick report for your manager.
That is why interviewers test both skills.
They want to see whether you can handle raw data and turn it into useful insights.
Top Skills Interviewers Test in SQL and Excel
Interviewers usually test four things.
1. Can You Clean Data?
They may ask how you remove duplicates, handle missing values or fix incorrect formats.
2. Can You Summarize Data?
They may ask about pivot tables, GROUP BY, COUNT, SUM, AVG and other aggregation methods.
3. Can You Combine Data?
They may ask about Excel lookup formulas or SQL JOINs.
4. Can You Explain Insights?
They may ask what you found from the data and what action you would recommend.
A good analyst is not just a tool user. A good analyst explains what the numbers mean.
SQL Interview Questions for Data Analysts
SQL interview questions usually start simple and then become scenario-based.
Freshers may get basic queries. Intermediate candidates may get JOINs, subqueries, window functions and business case questions.
Let’s go step by step.
Basic SQL Interview Questions
1. What is SQL?
SQL stands for Structured Query Language.
It is used to store, retrieve, update and analyze data from relational databases.
SQL is a language used to work with structured data stored in tables. Data analysts use SQL to filter data, join tables, calculate metrics and answer business questions.
2. What is the difference between SQL and MySQL?
SQL is the language.
MySQL is a database management system that uses SQL.
SQL is used to write queries. MySQL is a software system where databases are stored and managed. Other database systems include PostgreSQL, SQL Server, Oracle and SQLite.
3. What is a database?
A database is an organized collection of data.
For example, an e-commerce company may have a database containing customers, orders, products, payments and returns.
4. What is a table in SQL?
A table stores data in rows and columns.
Rows represent individual records. Columns represent fields or attributes.
Example:
In a customer table, each row may represent one customer. Columns may include customer_id, name, city, email and signup_date.
5. What is a primary key?
A primary key is a column that uniquely identifies each row in a table.
Example:
customer_id can be the primary key in a customers table because each customer has a unique ID.
6. What is a foreign key?
A foreign key is a column that connects one table to another table.
Example:
customer_id in the orders table can be a foreign key because it connects each order to a customer in the customers table.
7. What is the difference between WHERE and HAVING?
WHERE filters rows before aggregation.
HAVING filters grouped data after aggregation.
Example:
Use WHERE to filter orders from 2025.
Use HAVING to find customers whose total orders are greater than 5.
8. What is the difference between DELETE, TRUNCATE and DROP?
DELETE removes selected rows from a table.
TRUNCATE removes all rows from a table quickly.
DROP deletes the entire table structure.
DELETE is used when we want to remove specific records. TRUNCATE clears all data but keeps the table. DROP removes the complete table from the database.
9. What is NULL in SQL?
NULL means missing or unknown value.
It is not the same as zero or blank text.
Example:
If a customer has no phone number available, the phone column may contain NULL.
10. How do you handle NULL values in SQL?
You can use functions like COALESCE or IFNULL depending on the database.
Example:
SELECT COALESCE(phone_number, 'Not Available') AS phone
FROM customers;
This replaces missing phone numbers with “Not Available.”
SQL JOIN Interview Questions
JOIN questions are very common in data analyst interviews.
11. What is a JOIN in SQL?
A JOIN is used to combine rows from two or more tables based on a related column.
Example:
You can join customers and orders using customer_id.
12. What is an INNER JOIN?
INNER JOIN returns only matching records from both tables.
Example:
If a customer has placed an order, they will appear in the result. If a customer has not placed any order, they will not appear.
13. What is a LEFT JOIN?
LEFT JOIN returns all records from the left table and matching records from the right table.
If there is no match, the right table columns show NULL.
Example:
Use LEFT JOIN when you want all customers, including those who have not placed any order.
14. What is the difference between INNER JOIN and LEFT JOIN?
INNER JOIN gives only matching records.
LEFT JOIN gives all records from the first table and matching records from the second table.
Simple example:
If you want only customers who placed orders, use INNER JOIN.
If you want all customers and their order details if available, use LEFT JOIN.
15. What is a FULL OUTER JOIN?
FULL OUTER JOIN returns all records from both tables.
If there is no match, missing columns show NULL.
Not every database supports FULL OUTER JOIN directly.
16. What is a SELF JOIN?
A SELF JOIN is when a table is joined with itself.
Example:
In an employees table, you can use SELF JOIN to match employees with their managers.
17. What is a CROSS JOIN?
CROSS JOIN returns every possible combination of rows from two tables.
It is not used often in daily analysis, but it can be useful for generating combinations.
SQL Aggregation Interview Questions
18. What is GROUP BY?
GROUP BY is used to group rows based on one or more columns.
Example:
SELECT city, COUNT(*) AS total_customers
FROM customers
GROUP BY city;
This shows the number of customers in each city.
19. What is COUNT?
COUNT is used to count rows.
COUNT(*) counts all rows.
COUNT(column_name) counts non-null values in that column.
20. What is the difference between COUNT(*) and COUNT(column_name)?
COUNT(*) counts all rows, including rows with NULL values.
COUNT(column_name) counts only rows where that column is not NULL.
21. How do you calculate total revenue using SQL?
Example:
SELECT SUM(quantity * price) AS total_revenue
FROM orders;
This multiplies quantity and price, then adds the total.
22. How do you find duplicate records in SQL?
Example:
SELECT email, COUNT()
FROM customers
GROUP BY email
HAVING COUNT() > 1;
This finds duplicate emails.
23. How do you remove duplicates in SQL?
You can use DISTINCT to show unique records.
Example:
SELECT DISTINCT email
FROM customers;
To permanently delete duplicates, you may need ROW_NUMBER with a CTE, depending on the database.
Intermediate SQL Interview Questions
24. What is a subquery?
A subquery is a query inside another query.
Example:
SELECT customer_name
FROM customers
WHERE customer_id IN (
SELECT customer_id
FROM orders
);
This finds customers who placed orders.
25. What is a CTE?
CTE stands for Common Table Expression.
It creates a temporary result that can be used inside a query.
Example:
WITH monthly_sales AS (
SELECT MONTH(order_date) AS month, SUM(amount) AS revenue
FROM orders
GROUP BY MONTH(order_date)
)
SELECT *
FROM monthly_sales;
CTEs make complex queries easier to read.
26. What is a window function?
A window function performs calculations across a group of rows without collapsing them into one row.
Examples include:
- ROW_NUMBER
- RANK
- DENSE_RANK
- LAG
- LEAD
- SUM OVER
- AVG OVER
Window functions are important for ranking, running totals and trend analysis.
27. What is the difference between RANK and DENSE_RANK?
RANK skips numbers after a tie.
DENSE_RANK does not skip numbers.
Example:
If two students share rank 1, RANK gives the next student rank 3. DENSE_RANK gives the next student rank 2.
28. How do you find the second-highest salary in SQL?
Example:
SELECT MAX(salary) AS second_highest_salary
FROM employees
WHERE salary < (
SELECT MAX(salary)
FROM employees
);
Another method is using DENSE_RANK.
29. How do you find top 3 products by sales in each category?
Use window functions.
Example:
WITH ranked_products AS (
SELECT
category,
product_name,
SUM(sales) AS total_sales,
RANK() OVER(PARTITION BY category ORDER BY SUM(sales) DESC) AS rank_no
FROM orders
GROUP BY category, product_name
)
SELECT *
FROM ranked_products
WHERE rank_no <= 3;
This is a strong interview-level query.
30. What is the difference between UNION and UNION ALL?
- UNION combines results and removes duplicates.
- UNION ALL combines results but keeps duplicates.
UNION ALL is usually faster because it does not remove duplicates.
Scenario-Based SQL Interview Questions
31. How would you find customers who purchased more than once?
SELECT customer_id, COUNT(order_id) AS total_orders
FROM orders
GROUP BY customer_id
HAVING COUNT(order_id) > 1;
This helps identify repeat customers.
32. How would you calculate monthly revenue?
SELECT
YEAR(order_date) AS year,
MONTH(order_date) AS month,
SUM(amount) AS monthly_revenue
FROM orders
GROUP BY YEAR(order_date), MONTH(order_date)
ORDER BY year, month;
This helps track revenue trends.
33. How would you identify inactive customers?
SELECT customer_id, MAX(order_date) AS last_order_date
FROM orders
GROUP BY customer_id
HAVING MAX(order_date) < CURRENT_DATE - INTERVAL '90 days';
This finds customers who have not ordered in the last 90 days.
34. How would you calculate customer retention?
A simple approach:
Count customers who purchased in one month and again in the next month.
Retention questions are usually asked in product, e-commerce and subscription business interviews.
35. How would you detect unusual transactions?
You can look for:
- Very high transaction amounts
- Too many transactions in a short time
- Transactions from unusual locations
- Multiple failed payments
- Sudden increase in spending
SQL can help flag such patterns using CASE statements, averages and window functions.
Excel Interview Questions for Analysts
Excel is still heavily used in analyst roles because it is fast, flexible and easy for business teams to understand.
Interviewers usually test formulas, pivot tables, charts, data cleaning and reporting logic.
Basic Excel Interview Questions
36. What is Microsoft Excel used for in data analysis?
Excel is used to store, clean, analyze and present data.
Analysts use Excel for reports, dashboards, pivot tables, charts, formulas, financial analysis and quick business calculations.
37. What is a cell in Excel?
A cell is the intersection of a row and a column.
Example:
A1 is a cell in column A and row 1.
38. What is a worksheet and workbook?
A worksheet is a single sheet inside Excel.
A workbook is the complete Excel file that can contain multiple worksheets.
39. What is the difference between relative and absolute cell reference?
Relative reference changes when copied.
Example: A1
Absolute reference stays fixed.
Example: $A$1
Mixed reference fixes either row or column.
Example: A$1 or $A1
40. What is conditional formatting?
Conditional formatting changes the appearance of cells based on rules.
Example:
- Highlight sales above 1,00,000
- Highlight delayed orders
- Mark duplicate values
- Show low performance in red
It helps users identify patterns quickly.
Excel Formula Interview Questions
41. What is VLOOKUP?
VLOOKUP is used to search for a value in the first column of a table and return a related value from another column.
Example:
Find employee salary using employee ID.
42. What is the limitation of VLOOKUP?
VLOOKUP can only search from left to right.
It can break if column positions change.
That is why XLOOKUP or INDEX-MATCH is often better.
43. What is XLOOKUP?
XLOOKUP is a modern lookup function that can search in any direction.
It is more flexible than VLOOKUP.
Example:
=XLOOKUP(A2, Employee_ID_Column, Salary_Column, "Not Found")
44. What is INDEX-MATCH?
- INDEX-MATCH is a powerful lookup combination.
- INDEX returns a value from a range.
- MATCH finds the position of a value.
Together, they can perform flexible lookups.
45. What is the difference between VLOOKUP and INDEX-MATCH?
- VLOOKUP is easier for beginners.
- INDEX-MATCH is more flexible and can search left or right.
- INDEX-MATCH is also safer when columns are added or moved.
46. What is IF function in Excel?
IF checks a condition and returns one value if true and another value if false.
Example:
=IF(A2>=50,"Pass","Fail")
This checks if a student passed or failed.
47. What is nested IF?
Nested IF means using one IF inside another IF.
Example:
=IF(A2>=80,"Excellent",IF(A2>=50,"Pass","Fail"))
It is useful for grading or category-based logic.
48. What is SUMIF?
SUMIF adds values based on one condition.
Example:
=SUMIF(Category_Range,"Electronics",Sales_Range)
This adds sales only for the electronics category.
49. What is SUMIFS?
SUMIFS adds values based on multiple conditions.
Example:
Add sales for Electronics in Delhi during January.
SUMIFS is very useful for business reporting.
50. What is COUNTIF?
COUNTIF counts cells that meet one condition.
Example:
=COUNTIF(Status_Range,"Completed")
This counts completed tasks.
51. What is COUNTIFS?
COUNTIFS counts cells based on multiple conditions.
Example:
Count orders from Delhi where status is delivered.
52. What is the use of TEXT function?
TEXT changes a value into a specific format.
Example:
=TEXT(A2,"mmm-yyyy")
This can convert a date into month-year format.
53. How do you remove extra spaces in Excel?
Use TRIM.
Example:
=TRIM(A2)
This removes extra spaces from text.
54. How do you combine text from two cells?
Use CONCAT, CONCATENATE or TEXTJOIN.
Example:
=A2&" "&B2
This combines first name and last name.
55. How do you extract part of a text?
Use LEFT, RIGHT and MID.
Examples:
- LEFT extracts from the beginning.
- RIGHT extracts from the end.
- MID extracts from the middle.
These are useful for cleaning IDs, codes and names.
Pivot Table Interview Questions
56. What is a pivot table?
A pivot table summarizes large datasets quickly.
It helps analyze totals, averages, counts and categories without writing formulas manually.
Example:
You can use a pivot table to show total sales by region and product category.
57. Why are pivot tables useful for analysts?
Pivot tables help analysts:
- Summarize data quickly
- Group data by category
- Create reports
- Find trends
- Compare performance
- Analyze large datasets
They are one of the most important Excel skills for analysts.
58. What are rows, columns, values and filters in a pivot table?
- Rows show categories vertically.
- Columns show categories horizontally.
- Values show calculations such as sum, count or average.
- Filters allow users to limit the data shown.
59. How do you refresh a pivot table?
Right-click the pivot table and select Refresh.
You can also use the Refresh All option from the Data tab.
60. What is a slicer in Excel?
A slicer is a visual filter for pivot tables.
It allows users to filter data by clicking buttons.
Example:
A sales dashboard may have slicers for region, month and product category.
61. What is a calculated field in a pivot table?
A calculated field creates a new metric using existing fields.
Example:
Profit = Sales - Cost
This helps create custom calculations inside a pivot table.
Excel Data Cleaning Interview Questions
62. How do you remove duplicate values in Excel?
- Select the data.
- Go to Data tab.
- Click Remove Duplicates.
Choose the columns that define duplicate records.
This is useful for cleaning customer lists, leads and transaction data.
63. How do you handle missing values in Excel?
You can:
Keep them blank if unknown
Replace with “Not Available”
Use average or median for numeric values
Remove rows if data is not useful
Flag missing records for review
The right method depends on the business context.
64. How do you split full name into first name and last name?
You can use:
- Text to Columns
- TEXTSPLIT
- LEFT and RIGHT formulas
- Power Query
For simple cases, Text to Columns is fastest.
65. How do you convert text dates into proper date format?
You can use:
- DATEVALUE
- Text to Columns
- Power Query
- Custom formatting
Correct date formats are important for monthly reports and trend analysis.
66. What is Power Query?
Power Query is used to import, clean, transform and combine data in Excel.
It is helpful when you repeat the same cleaning steps every day or every week.
Instead of manually cleaning data again and again, Power Query can automate the process.
67. What is Flash Fill?
Flash Fill automatically detects patterns and fills values.
Example:
If you type first names from full names, Excel can detect the pattern and fill the rest.
It is useful for quick text cleaning.
Excel Dashboard Interview Questions
68. What makes a good Excel dashboard?
A good Excel dashboard should be clear, simple and useful.
It should include:
- Important KPIs
- Clean charts
- Filters or slicers
- Easy-to-read layout
- Updated data
- No unnecessary clutter
A dashboard should help the user make decisions faster.
69. Which charts are commonly used in Excel dashboards?
Common charts include:
- Bar chart
- Column chart
- Line chart
- Pie chart
- Donut chart
- Combo chart
- Area chart
- Scatter plot
For business dashboards, bar charts and line charts are often the easiest to understand.
70. What is the difference between a chart and a dashboard?
A chart shows one visual insight.
A dashboard combines multiple charts, KPIs and filters in one view.
Example:
A sales dashboard may show monthly revenue, top products, region-wise sales and target achievement.
71. How do you make a dashboard interactive in Excel?
You can use:
- Slicers
- Timelines
- Dropdown lists
- Pivot charts
- Form controls
- Dynamic formulas
Interactive dashboards allow users to filter data without editing formulas.
72. What is data validation?
Data validation controls what users can enter in a cell.
Example:
You can create a dropdown list for status values like Completed, Pending and Delayed.
This reduces manual errors.
SQL vs Excel Interview Questions
Interviewers may ask when to use SQL and when to use Excel.
73. What is the difference between SQL and Excel?
SQL is used to query and manage data from databases.
Excel is used to analyze, clean, calculate and present data in spreadsheets.
SQL is better for large structured datasets.
Excel is better for quick analysis, reports and business-friendly summaries.
74. When would you use SQL instead of Excel?
Use SQL when:
- Data is stored in a database
- Dataset is very large
- Multiple tables need to be joined
- Analysis must be repeated often
- Data needs to be pulled accurately from source systems
75. When would you use Excel instead of SQL?
Use Excel when:
- Dataset is small or medium-sized
- Quick calculations are needed
- Business users need a simple report
- Data needs manual review
- Charts or pivot tables are required quickly
76. Which is more important for data analysts, SQL or Excel?
Both are important.
SQL helps you extract and analyze data from databases.
Excel helps you clean, summarize and present data quickly.
For data analyst roles, learning both gives you a stronger foundation.
Business Scenario Interview Questions
These questions test how you think, not just what formulas you know.
77. You received a sales file with duplicate customer records. What will you do?
First, I will identify which columns define a duplicate record, such as customer ID, email or phone number.
Then I will check whether the duplicate rows are truly repeated or if they contain different transaction details.
If they are exact duplicates, I will remove them.
If they contain useful differences, I will keep the correct records and document the cleaning logic.
78. Sales dropped suddenly this month. How will you analyze it?
I will compare current month sales with previous months.
Then I will break sales by region, product, category, channel and customer segment.
I will check whether the drop came from fewer orders, lower average order value, stock issues, campaign changes or higher cancellations.
After that, I will summarize the reason and suggest action.
79. A manager asks for weekly revenue by region. How will you prepare it?
I will first extract order data using SQL.
Then I will group revenue by week and region.
If needed, I will export the result to Excel and create a pivot table or dashboard.
I will also validate totals before sharing the final report.
80. How will you check data accuracy before sending a report?
I will check:
- Total rows
- Missing values
- Duplicate records
- Date range
- Formula errors
- Outliers
- Grand totals
- Source-to-report match
I will also compare the final numbers with previous reports to catch unusual changes.
81. How do you explain technical insights to a non-technical manager?
I avoid unnecessary technical language.
Instead of saying, “I used a window function,” I say, “I ranked customers based on total revenue to identify the top buyers.”
The goal is to explain what the data means and what decision should be taken.
Tools Analysts Should Know Along With SQL & Excel
SQL and Excel are the foundation, but analysts can grow faster by learning other tools.
-
Power BI
-
Tableau
-
Python
-
Google Sheets
-
Power Query
-
Google BigQuery
- GitHub
FAQs
SQL and Excel are enough for many entry-level analyst and MIS roles, especially when combined with good communication and basic business understanding. For stronger data analyst roles, you should also learn Power BI or Tableau. Later, Python and statistics can help you move into advanced analytics roles.
The most common SQL questions are based on SELECT, WHERE, GROUP BY, HAVING, JOINs, subqueries, CTEs, window functions and duplicate handling. Interviewers often ask practical questions like finding top customers, monthly revenue, second-highest salary, inactive users and repeat buyers.
Important Excel skills include pivot tables, VLOOKUP, XLOOKUP, INDEX-MATCH, IF, SUMIFS, COUNTIFS, conditional formatting, charts, data validation and Power Query. Interviewers also test whether you can clean messy data, build reports and explain insights clearly to business users.
SQL and Excel are used for different purposes. SQL is better for extracting and analyzing large database tables. Excel is better for quick calculations, reporting, pivot tables and business-friendly analysis. A strong analyst should know both because real work often requires using them together.
Freshers should practice daily with small datasets. For SQL, focus on joins, grouping, subqueries and business queries. For Excel, practice formulas, pivot tables and dashboards. The best preparation is to build 2 to 3 mini projects and learn how to explain the insights clearly.


