Data Analyst Interview Resources
52.3K subscribers
377 photos
1 video
53 files
468 links
Join our telegram channel to learn how data analysis can reveal fascinating patterns, trends, and stories hidden within the numbers! ๐Ÿ“Š

For ads & suggestions: @love_data
Download Telegram
๐Ÿ“Š Interviewer: How do you remove duplicate records in SQL?

๐Ÿ‘‹ Me: We can remove duplicates using DISTINCT, GROUP BY, or delete duplicate rows using ROW_NUMBER().


โœ… 1๏ธโƒฃ Using DISTINCT (to fetch unique values)

SELECT DISTINCT column_name
FROM employees;


๐Ÿ‘‰ Returns unique records but does not delete duplicates.


โœ… 2๏ธโƒฃ Using GROUP BY (to identify duplicates)

SELECT name, COUNT(*)
FROM employees
GROUP BY name
HAVING COUNT(*) > 1;


๐Ÿ‘‰ Helps find duplicate records.


โœ… 3๏ธโƒฃ Delete Duplicates Using ROW_NUMBER() (Most Important โญ)
(Keeps one record and deletes others)

DELETE FROM employees
WHERE id IN (
SELECT id FROM (
SELECT id,
ROW_NUMBER() OVER (
PARTITION BY name, salary
ORDER BY id
) AS rn
FROM employees
) t
WHERE rn > 1
);


๐Ÿง  Logic Breakdown:

- DISTINCT โ†’ shows unique records
- GROUP BY โ†’ identifies duplicates
- ROW_NUMBER() โ†’ removes duplicates safely


โœ… Use Case: Data cleaning, ETL processes, data quality checks.

๐Ÿ’ก Tip: Always take a backup before deleting duplicate records.

๐Ÿ’ฌ Tap โค๏ธ for more!
โค2
๐Ÿ“Š Essential SQL Concepts Every Data Analyst Must Know

๐Ÿš€ SQL is the most important skill for Data Analysts. Almost every analytics job requires working with databases to extract, filter, analyze, and summarize data.

Understanding the following SQL concepts will help you write efficient queries and solve real business problems with data.

1๏ธโƒฃ SELECT Statement (Data Retrieval)

What it is: Retrieves data from a table.

SELECT name, salary
FROM employees;


Use cases: Retrieving specific columns, viewing datasets, extracting required information.

2๏ธโƒฃ WHERE Clause (Filtering Data)

What it is: Filters rows based on specific conditions.

SELECT *
FROM orders
WHERE order_amount > 500;


Common conditions: =, >, <, >=, <=, BETWEEN, IN, LIKE

3๏ธโƒฃ ORDER BY (Sorting Data)

What it is: Sorts query results in ascending or descending order.

SELECT name, salary
FROM employees
ORDER BY salary DESC;


Sorting options: ASC (default), DESC

4๏ธโƒฃ GROUP BY (Aggregation)

What it is: Groups rows with same values into summary rows.

SELECT department, COUNT(*)
FROM employees
GROUP BY department;


Use cases: Sales per region, customers per country, orders per product category.

5๏ธโƒฃ Aggregate Functions

What they do: Perform calculations on multiple rows.

SELECT AVG(salary)
FROM employees;


Common functions: COUNT(), SUM(), AVG(), MIN(), MAX()

6๏ธโƒฃ HAVING Clause

What it is: Filters grouped data after aggregation.

SELECT department, COUNT(*)
FROM employees
GROUP BY department
HAVING COUNT(*) > 5;


Key difference: WHERE filters rows before grouping, HAVING filters groups after aggregation.

7๏ธโƒฃ SQL JOINS (Combining Tables)

What they do: Combine tables.

-- INNER JOIN
SELECT orders.order_id, customers.customer_name
FROM orders
INNER JOIN customers
ON orders.customer_id = customers.customer_id;


-- LEFT JOIN
SELECT customers.customer_name, orders.order_id
FROM customers
LEFT JOIN orders
ON customers.customer_id = orders.customer_id;


Common types: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN

8๏ธโƒฃ Subqueries

What it is: Query inside another query.

SELECT name
FROM employees
WHERE salary > (SELECT AVG(salary) FROM employees);


Use cases: Comparing values, filtering based on aggregated results.

9๏ธโƒฃ Common Table Expressions (CTE)

What it is: Temporary result set used inside a query.

WITH high_salary AS (
SELECT name, salary
FROM employees
WHERE salary > 70000
)
SELECT *
FROM high_salary;


Benefits: Cleaner queries, easier debugging, better readability.

๐Ÿ”Ÿ Window Functions

What they do: Perform calculations across rows related to current row.

SELECT name, salary, RANK() OVER (ORDER BY salary DESC) AS salary_rank
FROM employees;


Common functions: ROW_NUMBER(), RANK(), DENSE_RANK(), LAG(), LEAD()

Why SQL is Critical for Data Analysts
โ€ข Extract data from databases
โ€ข Analyze large datasets efficiently
โ€ข Generate reports and dashboards
โ€ข Support business decision-making

SQL Resources: https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v

Double Tap โ™ฅ๏ธ For More
โค5๐Ÿ‘1
Essential Excel Functions for Data Analysts ๐Ÿš€

1๏ธโƒฃ Basic Functions

SUM() โ€“ Adds a range of numbers. =SUM(A1:A10)

AVERAGE() โ€“ Calculates the average. =AVERAGE(A1:A10)

MIN() / MAX() โ€“ Finds the smallest/largest value. =MIN(A1:A10)


2๏ธโƒฃ Logical Functions

IF() โ€“ Conditional logic. =IF(A1>50, "Pass", "Fail")

IFS() โ€“ Multiple conditions. =IFS(A1>90, "A", A1>80, "B", TRUE, "C")

AND() / OR() โ€“ Checks multiple conditions. =AND(A1>50, B1<100)


3๏ธโƒฃ Text Functions

LEFT() / RIGHT() / MID() โ€“ Extract text from a string.

=LEFT(A1, 3) (First 3 characters)

=MID(A1, 3, 2) (2 characters from the 3rd position)


LEN() โ€“ Counts characters. =LEN(A1)

TRIM() โ€“ Removes extra spaces. =TRIM(A1)

UPPER() / LOWER() / PROPER() โ€“ Changes text case.


4๏ธโƒฃ Lookup Functions

VLOOKUP() โ€“ Searches for a value in a column.

=VLOOKUP(1001, A2:B10, 2, FALSE)


HLOOKUP() โ€“ Searches in a row.

XLOOKUP() โ€“ Advanced lookup replacing VLOOKUP.

=XLOOKUP(1001, A2:A10, B2:B10, "Not Found")



5๏ธโƒฃ Date & Time Functions

TODAY() โ€“ Returns the current date.

NOW() โ€“ Returns the current date and time.

YEAR(), MONTH(), DAY() โ€“ Extracts parts of a date.

DATEDIF() โ€“ Calculates the difference between two dates.


6๏ธโƒฃ Data Cleaning Functions

REMOVE DUPLICATES โ€“ Found in the "Data" tab.

CLEAN() โ€“ Removes non-printable characters.

SUBSTITUTE() โ€“ Replaces text within a string.

=SUBSTITUTE(A1, "old", "new")



7๏ธโƒฃ Advanced Functions

INDEX() & MATCH() โ€“ More flexible alternative to VLOOKUP.

TEXTJOIN() โ€“ Joins text with a delimiter.

UNIQUE() โ€“ Returns unique values from a range.

FILTER() โ€“ Filters data dynamically.

=FILTER(A2:B10, B2:B10>50)



8๏ธโƒฃ Pivot Tables & Power Query

PIVOT TABLES โ€“ Summarizes data dynamically.

GETPIVOTDATA() โ€“ Extracts data from a Pivot Table.

POWER QUERY โ€“ Automates data cleaning & transformation.


You can find Free Excel Resources here: https://t.me/excel_data

Hope it helps :)

#dataanalytics
โค4
Top 100 Data Analyst Interview Questions

โœ… Data Analytics Basics
1. What is data analytics?
2. Difference between data analytics and data science?
3. What problems does a data analyst solve?
4. What are the types of data analytics?
5. What tools do data analysts use daily?
6. What is a KPI?
7. What is a metric vs KPI?
8. What is descriptive analytics?
9. What is diagnostic analytics?
10. What does a typical day of a data analyst look like?

Data and Databases
11. What is structured data?
12. What is semi-structured data?
13. What is unstructured data?
14. What is a database?
15. Difference between OLTP and OLAP?
16. What is a primary key?
17. What is a foreign key?
18. What is a fact table?
19. What is a dimension table?
20. What is a data warehouse?

SQL for Data Analysts
21. What is SELECT used for?
22. Difference between WHERE and HAVING?
23. What is GROUP BY?
24. What are aggregate functions?
25. Difference between INNER and LEFT JOIN?
26. What are subqueries?
27. What is a CTE?
28. How do you handle duplicates in SQL?
29. How do you handle NULL values?
30. What are window functions?

Excel for Data Analysis
31. What are pivot tables?
32. Difference between VLOOKUP and XLOOKUP?
33. What is conditional formatting?
34. What are COUNTIFS and SUMIFS?
35. What is data validation?
36. How do you remove duplicates in Excel?
37. What is IF formula used for?
38. Difference between relative and absolute reference?
39. How do you clean data in Excel?
40. What are common Excel mistakes analysts make?

Data Cleaning and Preparation
41. What is data cleaning?
42. How do you handle missing data?
43. How do you treat outliers?
44. What is data normalization?
45. What is data standardization?
46. How do you check data quality?
47. What is duplicate data?
48. How do you validate source data?
49. What is data transformation?
50. Why is data preparation important?

Statistics for Data Analysts
51. Difference between mean and median?
52. What is standard deviation?
53. What is variance?
54. What is correlation?
55. Difference between correlation and causation?
56. What is an outlier?
57. What is sampling?
58. What is distribution?
59. What is skewness?
60. When do you use median over mean?

Data Visualization
61. Why is data visualization important?
62. Difference between bar and line chart?
63. When do you use a pie chart?
64. What is a dashboard?
65. What makes a good dashboard?
66. What is a KPI card?
67. Common visualization mistakes?
68. How do you choose the right chart?
69. What is drill down?
70. What is data storytelling?

Power BI or Tableau
71. What is Power BI or Tableau used for?
72. What is a data model?
73. What is a relationship?
74. What is DAX?
75. Difference between measure and calculated column?
76. What is Power Query?
77. What are filters and slicers?
78. What is row level security?
79. What is refresh schedule?
80. How do you optimize reports?

Business and Case Questions
81. How do you analyze a sales drop?
82. How do you define success metrics?
83. What business metrics have you worked on?
84. How do you prioritize insights?
85. How do you validate insights?
86. What questions do you ask stakeholders?
87. How do you handle vague requirements?
88. How do you measure business impact?
89. How do you explain numbers to managers?
90. How do you recommend actions?

Projects and Real World
91. Explain your best project.
92. What data sources did you use?
93. How did you clean the data?
94. What insight had the most impact?
95. What challenge did you face?
96. How did you solve it?
97. How did stakeholders use your dashboard?
98. What would you improve in your project?
99. How do you handle tight deadlines?
100. Why should we hire you as a data analyst?

Double Tap โ™ฅ๏ธ For Detailed Answers
โค19๐Ÿ‘1
๐Ÿง  SQL Interview Question (Moderateโ€“Tricky & Identifying Users with Increasing Transactions)
๐Ÿ“Œ

transactions(transaction_id, user_id, transaction_date, amount)

โ“ Ques :

๐Ÿ‘‰ Find users whose transaction amount strictly increases with every new transaction.

๐Ÿงฉ How Interviewers Expect You to Think

โ€ข Sort transactions by date for each user
โ€ข Compare each amount with the previous one
โ€ข Identify users whose amounts always increase

๐Ÿ’ก SQL Solution

WITH t AS (
SELECT
user_id,
amount,
LAG(amount) OVER (
PARTITION BY user_id
ORDER BY transaction_date
) AS prev_amount
FROM transactions
)

SELECT user_id
FROM t
GROUP BY user_id
HAVING SUM(
CASE
WHEN prev_amount IS NOT NULL AND amount <= prev_amount
THEN 1 ELSE 0
END
) = 0;

๐Ÿ”ฅ Why This Question Is Powerful

โ€ข Tests understanding of LAG() with conditional logic
โ€ข Evaluates ability to validate patterns across sequential data
โ€ข Reflects real-world analytics like tracking user spending growth trends

โค๏ธ React if you want more tricky real interview-level SQL questions ๐Ÿš€
โค4
๐—›๐—ผ๐˜„ ๐—ฅ๐—ฎ๐˜„ ๐——๐—ฎ๐˜๐—ฎ ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ๐˜€ ๐—ฅ๐—ฒ๐—ฎ๐—น ๐—•๐˜‚๐˜€๐—ถ๐—ป๐—ฒ๐˜€๐˜€ ๐—ฉ๐—ฎ๐—น๐˜‚๐—ฒ

Data creates impact only when it turns into decisions. The analytics process can be seen as a simple journey:

๐Ÿ”น Data โ€“ Raw, messy information collected from systems, users, or transactions.

๐Ÿ”น Sorted โ€“ Cleaning and organizing the data by removing duplicates and fixing inconsistencies.

๐Ÿ”น Arranged โ€“ Analyzing the data through aggregation, grouping, and exploration to find patterns.

๐Ÿ”น Presented Visually โ€“ Using charts and dashboards to make insights easy to understand.

๐Ÿ”น Explained with a Story โ€“ Connecting insights to real business problems and context.

๐Ÿ”น Actionable โ€“ Turning insights into better decisions and improvements.

๐Ÿ“Š Great analysts donโ€™t just analyze data โ€” they turn it into decisions that create value.
โค2
๐Ÿš€ Data Analyst Roadmap


First things first ๐Ÿ‘‡
โŒ Donโ€™t buy expensive courses to become a Data Analyst.

๐Ÿ’ก Consistency > Certifications > Courses

Skills and practice are what actually get you hired.


โœ… Mandatory Skills for a Data Analyst

1๏ธโƒฃ SQL

Practice as much as possible.

This is the most important skill for any Data Analyst.

๐Ÿ“š Resource
YouTube Channel: Ankit Bansal
Playlist: SQL Practice / SQL Interview Questions


2๏ธโƒฃ Excel

Advanced Excel is required.

Focus on:

โ€ข Formulas
โ€ข Pivot Tables
โ€ข Power Query Basics
โ€ข Data Cleaning
โ€ข Data Analysis functions


3๏ธโƒฃ BI Tools

Choose ONE:

โ€ข Power BI
โ€ข Tableau

โŒ Do NOT learn both at the same time.

If you choose Power BI, learn these deeply:

โ€ข Power Query
โ€ข DAX
โ€ข M Code

๐Ÿ“š Resources

YouTube Channel: Learnit Training
Video: Power BI DAX Full Tutorial for Beginners

YouTube Channel: Enterprise DNA
Playlist: DAX Practice Series

YouTube Channel: Goodly (Chandeep Chhabra)
Playlists: Power Query Tutorials and M Code Tutorials


4๏ธโƒฃ Python

Focus mainly on:

โ€ข NumPy
โ€ข Pandas
โ€ข Basic visualization libraries (Matplotlib / Seaborn)

You donโ€™t need deep ML knowledge for Data Analyst roles.


โญ Good-to-Have Skills

These are not mandatory but help in career growth:

โ€ข Machine Learning (basic understanding)
โ€ข PySpark
โ€ข Databricks (becoming popular in data teams)
โ€ข Cloud platforms

Cloud options:

โ€ข Azure
โ€ข GCP


๐ŸŽ“ Certifications (Optional)

Certifications can help but are not required.

Useful ones:

โ€ข Microsoft Power BI Certification โ€“ PL-300
โ€ข Tableau Certification
โ€ข Azure Cloud Certification


โŒ No other certifications are required.

Save your money.

Focus on skills, projects, and practice.

Credit: Mohan
โค10
๐Ÿง  SQL Interview Question (Moderateโ€“Tricky & Retention Analysis)
๐Ÿ“Œ

subscriptions(user_id, start_date, end_date)

โ“ Ques :

๐Ÿ‘‰ Find users who renewed their subscription immediately after the previous one ended (no gap between subscriptions).

๐Ÿงฉ How Interviewers Expect You to Think

โ€ข Sort subscriptions by start_date for each user
โ€ข Use a window function to access the previous subscription end date
โ€ข Check if the next start_date equals the previous end_date

๐Ÿ’ก SQL Solution

WITH sub_cte AS (
SELECT
user_id,
start_date,
end_date,
LAG(end_date) OVER (
PARTITION BY user_id
ORDER BY start_date
) AS prev_end_date
FROM subscriptions
)

SELECT DISTINCT user_id
FROM sub_cte
WHERE start_date = prev_end_date;

๐Ÿ”ฅ Why This Question Is Powerful

โ€ข Tests ability to analyze subscription lifecycle data
โ€ข Evaluates knowledge of window functions for sequential comparisons
โ€ข Similar logic used in retention and churn analysis

โค๏ธ React if you want more real interview-level SQL questions like this. ๐Ÿš€
โค4
How to Become a Data Analyst from Scratch! ๐Ÿš€

Whether you're starting fresh or upskilling, here's your roadmap:

โžœ Master Excel and SQL - solve SQL problems from leetcode & hackerank
โžœ Get the hang of either Power BI or Tableau - do some hands-on projects
โžœ learn what the heck ATS is and how to get around it
โžœ learn to be ready for any interview question
โžœ Build projects for a data portfolio
โžœ And you don't need to do it all at once!
โžœ Fail and learn to pick yourself up whenever required

Whether it's acing interviews or building an impressive portfolio, give yourself the space to learn, fail, and grow. Good things take time โœ…

Like if it helps โค๏ธ

I have curated best 80+ top-notch Data Analytics Resources ๐Ÿ‘‡๐Ÿ‘‡
https://topmate.io/analyst/861634

Hope it helps :)
โค1๐Ÿ‘1
โœ… Power BI Interview Questions ๐ŸŽฏ๐Ÿ“Š

1๏ธโƒฃ What is Power BI?
A Microsoft tool for data visualization, reporting, and business intelligence.

2๏ธโƒฃ What are the building blocks of Power BI?
โ€ข Datasets
โ€ข Reports
โ€ข Dashboards
โ€ข Tiles
โ€ข Visualizations

3๏ธโƒฃ Difference between Power BI Desktop and Power BI Service?
โ€ข Desktop: Used to create and design reports
โ€ข Service: Cloud-based platform to share and collaborate

4๏ธโƒฃ What is Power Query?
A data transformation tool for cleaning and shaping data before loading into the model.

5๏ธโƒฃ What is DAX?
Data Analysis Expressions โ€“ a formula language used for calculations in Power BI.

6๏ธโƒฃ What are measures and calculated columns?
โ€ข Measure: Calculated on aggregation (e.g. SUM of sales)
โ€ข Calculated Column: Row-level computation (e.g. profit = revenue - cost)

7๏ธโƒฃ What is a slicer?
A visual filter that allows users to dynamically filter data on a report.

8๏ธโƒฃ How do you handle data refresh in Power BI?
โ€ข Schedule refresh via Power BI Service
โ€ข Use gateways for on-prem data sources

9๏ธโƒฃ What is the difference between direct query and import mode?
โ€ข Import: Data is loaded into Power BI
โ€ข Direct Query: Queries run directly on the source in real time

๐Ÿ”Ÿ What is the Power BI Gateway?
A bridge between on-premise data sources and Power BI cloud service.

๐Ÿ’ฌ Tap โค๏ธ for more
โค7
๐Ÿง  SQL Interview Question (Moderateโ€“Tricky & Top Performer Analysis)
๐Ÿ“Œ

sales(region, salesperson_id, revenue)

โ“ Ques :

๐Ÿ‘‰ Find the top 2 highest revenue-generating salespersons in each region.

๐Ÿงฉ How Interviewers Expect You to Think

โ€ข Data is grouped by region ๐ŸŒ
โ€ข Need ranking within each group
โ€ข Handle ties carefully (RANK / DENSE_RANK)
โ€ข Filter top N per group

๐Ÿ’ก SQL Solution

SELECT region, salesperson_id, revenue
FROM (
SELECT
region,
salesperson_id,
revenue,
DENSE_RANK() OVER (PARTITION BY region ORDER BY revenue DESC) AS rnk
FROM sales
) t
WHERE rnk <= 2;

๐Ÿ”ฅ Why This Question Is Powerful

โ€ข Tests window functions (RANK / DENSE_RANK) ๐Ÿง 
โ€ข Very common in business reporting & leaderboards ๐Ÿ“Š
โ€ข Checks understanding of partitioning + ordering logic

โค๏ธ React if you want more such real interview-level SQL questions ๐Ÿš€
โค5๐Ÿ‘2
๐Ÿง  SQL Interview Question (Moderateโ€“Tricky & Duplicate Detection + Latest Record)
๐Ÿ“Œ

employees(emp_id, email, updated_at)

โ“ Ques :

๐Ÿ‘‰ Find duplicate emails, but return only the latest record for each duplicate email.

๐Ÿงฉ How Interviewers Expect You to Think

โ€ข Identify duplicates using COUNT() ๐Ÿ“Š
โ€ข Use window functions for ranking
โ€ข Partition by email
โ€ข Order by latest timestamp
โ€ข Filter only duplicates + latest row

๐Ÿ’ก SQL Solution

SELECT emp_id, email, updated_at
FROM (
SELECT
emp_id,
email,
updated_at,
COUNT(*) OVER (PARTITION BY email) AS cnt,
ROW_NUMBER() OVER (
PARTITION BY email
ORDER BY updated_at DESC
) AS rn
FROM employees
) t
WHERE cnt > 1
AND rn = 1;

๐Ÿ”ฅ Why This Question Is Powerful

โ€ข Tests window functions (COUNT OVER, ROW_NUMBER) ๐Ÿง 
โ€ข Combines deduplication + ranking logic
โ€ข Very common in data cleaning scenarios ๐Ÿงน
โ€ข Real-world use case: keeping latest user records

โค๏ธ React if you want more such real interview-level SQL questions ๐Ÿš€
โค7
Key Power BI Functions Every Analyst Should Master

DAX Functions:

1. CALCULATE():

Purpose: Modify context or filter data for calculations.

Example: CALCULATE(SUM(Sales[Amount]), Sales[Region] = "East")



2. SUM():

Purpose: Adds up column values.

Example: SUM(Sales[Amount])



3. AVERAGE():

Purpose: Calculates the mean of column values.

Example: AVERAGE(Sales[Amount])



4. RELATED():

Purpose: Fetch values from a related table.

Example: RELATED(Customers[Name])



5. FILTER():

Purpose: Create a subset of data for calculations.

Example: FILTER(Sales, Sales[Amount] > 100)



6. IF():

Purpose: Apply conditional logic.

Example: IF(Sales[Amount] > 1000, "High", "Low")



7. ALL():

Purpose: Removes filters to calculate totals.

Example: ALL(Sales[Region])



8. DISTINCT():

Purpose: Return unique values in a column.

Example: DISTINCT(Sales[Product])



9. RANKX():

Purpose: Rank values in a column.

Example: RANKX(ALL(Sales[Region]), SUM(Sales[Amount]))



10. FORMAT():

Purpose: Format numbers or dates as text.

Example: FORMAT(TODAY(), "MM/DD/YYYY")

You can refer these Power BI Interview Resources to learn more: https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02

Like this post if you want me to continue this Power BI series ๐Ÿ‘โ™ฅ๏ธ

Share with credits: https://t.me/sqlspecialist

Hope it helps :)
โค5
โœ… How to Grow Fast in Data Analytics ๐Ÿ“ˆ๐Ÿ’ผ

1๏ธโƒฃ Master Core Tools
- Excel: Pivot tables, lookups, charts
- SQL: Joins, aggregations, subqueries
- Power BI / Tableau: Dashboards, filters, visuals
- Python: pandas, matplotlib, seaborn for deeper analysis

2๏ธโƒฃ Learn Key Concepts
- Descriptive stats: mean, median, variance
- Data cleaning: missing values, outliers
- Visualization best practices
- Business KPIs and metrics (e.g., churn rate, CAC, ROI)

3๏ธโƒฃ Build Practical Projects
- Sales dashboard in Power BI
- SQL analysis of e-commerce data
- Python analysis of COVID-19 trends
- Excel-based budget tracker

4๏ธโƒฃ Share Your Work
- Post dashboards on LinkedIn
- Upload projects to GitHub
- Record quick YouTube explainers

5๏ธโƒฃ Join the Community
- LinkedIn groups, Reddit (r/dataisbeautiful), Kaggle
- Attend webinars, local meetups, analytics bootcamps

6๏ธโƒฃ Stay Current
- Follow Google Analytics, Microsoft BI, Mode
- Subscribe to newsletters: Data Elixir, Analytics Vidhya
- Learn new tools: Looker, BigQuery, Power Query

๐ŸŽฏ Practice daily. Improve weekly. Share monthly.

๐Ÿ’ฌ Tap โค๏ธ if this helped you!
โค7
๐Ÿง  SQL Interview Question (Self Join + Salary Comparison)
๐Ÿ“Œ

employees(emp_id, manager_id, salary)

โ“ Ques :

๐Ÿ‘‰ Find employees whose salary is higher than their managerโ€™s salary.

๐Ÿงฉ How Interviewers Expect You to Think

โ€ข Understand hierarchical relationships ๐Ÿ‘ฅ
โ€ข Use self join on same table
โ€ข Compare values across related rows
โ€ข Handle NULL manager cases

๐Ÿ’ก SQL Solution

SELECT
e.emp_id,
e.salary AS emp_salary,
m.salary AS manager_salary
FROM employees e
JOIN employees m
ON e.manager_id = m.emp_id
WHERE e.salary > m.salary;

๐Ÿ”ฅ Why This Question Is Powerful

โ€ข Tests self join concept deeply ๐Ÿง 
โ€ข Real-world scenario in org hierarchy analysis
โ€ข Checks ability to compare across rows
โ€ข Frequently asked in interviews

โค๏ธ React if you want more real interview-level SQL questions ๐Ÿš€
โค2๐Ÿ‘2
Data Analyst Interview Preparation Roadmap โœ…

Technical skills to revise

- SQL
Write queries from scratch.
Practice joins, group by, subqueries.
Handle duplicates and NULLs.
Window functions basics.

- Excel
Pivot tables without help.
XLOOKUP and IF confidently.
Data cleaning steps.

- Power BI or Tableau
Explain data model.
Write basic DAX.
Explain one dashboard end to end.

- Statistics
Mean vs median.
Standard deviation meaning.
Correlation vs causation.

- Python. If required
Pandas basics.
Groupby and filtering.

Interview question types

- SQL questions
Top N per group.
Running totals.
Duplicate records.
Date based queries.

- Business case questions
Why did sales drop.
Which metric matters most and why.

- Dashboard questions
Explain one KPI.
How users will use this report.

- Project questions
Data source.
Cleaning logic.
Key insight.
Business action.

Resume preparation
- Must have Tools section.
- One strong project.
- Metrics driven points.
Example: Improved reporting time by 30 percent using Power BI.

Mock interviews
- Practice explaining out loud.
- Time your answers.
- Use real datasets.

Daily prep plan
1 SQL problem.
1 dashboard review.
10 interview questions.

- Common mistakes
Memorizing queries.
No project explanation.
Weak business reasoning.

- Final task
- Prepare one project story.
- Prepare one SQL solution on paper.
- Prepare one business metric explanation.

Double Tap โ™ฅ๏ธ For More
โค4
๐Ÿง  SQL Interview Question (Products Frequently Bought Together)
๐Ÿ“Œ

order_items(order_id, product_id)

โ“ Ques :

๐Ÿ‘‰ Find pairs of products that are frequently bought together in the same order

๐Ÿ‘‰ Return product_id_1, product_id_2, pair_count

๐Ÿงฉ How Interviewers Expect You to Think

โ€ข Self-join on same order ๐Ÿ›’
โ€ข Avoid duplicate/reverse pairs
โ€ข Count frequency of each pair

๐Ÿ’ก SQL Solution

SELECT
o1.product_id AS product_id_1,
o2.product_id AS product_id_2,
COUNT(*) AS pair_count
FROM order_items o1
JOIN order_items o2
ON o1.order_id = o2.order_id
AND o1.product_id < o2.product_id
GROUP BY
o1.product_id,
o2.product_id
ORDER BY pair_count DESC;

๐Ÿ”ฅ Why This Question Is Powerful

โ€ข Classic market basket analysis ๐Ÿง 
โ€ข Tests self-join + combinations logic
โ€ข Frequently asked in e-commerce & analytics roles

โค๏ธ React for more SQL interview questions ๐Ÿš€
โค7
๐Ÿ“ข Advertising in this channel

You can place an ad via Telegaโ€คio. It takes just a few minutes.

Formats and current rates: View details
๐Ÿ”ฅ Top SQL Interview Questions with Answers

๐ŸŽฏ 1๏ธโƒฃ Find 2nd Highest Salary
๐Ÿ“Š Table: employees
id | name | salary
1 | Rahul | 50000
2 | Priya | 70000
3 | Amit | 60000
4 | Neha | 70000

โ“ Problem Statement: Find the second highest distinct salary from the employees table.

โœ… Solution
SELECT MAX(salary) FROM employees WHERE salary < ( SELECT MAX(salary) FROM employees );

๐ŸŽฏ 2๏ธโƒฃ Find Nth Highest Salary
๐Ÿ“Š Table: employees
id | name | salary
1 | A | 100
2 | B | 200
3 | C | 300
4 | D | 200

โ“ Problem Statement: Write a query to find the 3rd highest salary.

โœ… Solution
SELECT salary FROM ( SELECT salary, DENSE_RANK() OVER(ORDER BY salary DESC) r FROM employees ) t WHERE r = 3;

๐ŸŽฏ 3๏ธโƒฃ Find Duplicate Records
๐Ÿ“Š Table: employees
id | name
1 | Rahul
2 | Amit
3 | Rahul
4 | Neha

โ“ Problem Statement: Find all duplicate names in the employees table.

โœ… Solution
SELECT name, COUNT(*) FROM employees GROUP BY name HAVING COUNT(*) > 1;

๐ŸŽฏ 4๏ธโƒฃ Customers with No Orders
๐Ÿ“Š Table: customers
customer_id | name
1 | Rahul
2 | Priya
3 | Amit

๐Ÿ“Š Table: orders
order_id | customer_id
101 | 1
102 | 2

โ“ Problem Statement: Find customers who have not placed any orders.

โœ… Solution
SELECT c.name FROM customers c LEFT JOIN orders o ON c.customer_id = o.customer_id WHERE o.customer_id IS NULL;

๐ŸŽฏ 5๏ธโƒฃ Top 3 Salaries per Department
๐Ÿ“Š Table: employees
name | department | salary
A | IT | 100
B | IT | 200
C | IT | 150
D | HR | 120
E | HR | 180

โ“ Problem Statement: Find the top 3 highest salaries in each department.

โœ… Solution
SELECT * FROM ( SELECT name, department, salary, ROW_NUMBER() OVER( PARTITION BY department ORDER BY salary DESC ) r FROM employees ) t WHERE r <= 3;

๐ŸŽฏ 6๏ธโƒฃ Running Total of Sales
๐Ÿ“Š Table: sales
date | sales
2024-01-01 | 100
2024-01-02 | 200
2024-01-03 | 300

โ“ Problem Statement: Calculate the running total of sales by date.

โœ… Solution
SELECT date, sales, SUM(sales) OVER(ORDER BY date) AS running_total FROM sales;

๐ŸŽฏ 7๏ธโƒฃ Employees Above Average Salary
๐Ÿ“Š Table: employees
name | salary
A | 100
B | 200
C | 300

โ“ Problem Statement: Find employees earning more than the average salary.

โœ… Solution
SELECT name, salary FROM employees WHERE salary > ( SELECT AVG(salary) FROM employees );

๐ŸŽฏ 8๏ธโƒฃ Department with Highest Total Salary
๐Ÿ“Š Table: employees
name | department | salary
A | IT | 100
B | IT | 200
C | HR | 500

โ“ Problem Statement: Find the department with the highest total salary.

โœ… Solution
SELECT department, SUM(salary) AS total_salary FROM employees GROUP BY department ORDER BY total_salary DESC LIMIT 1;

๐ŸŽฏ 9๏ธโƒฃ Customers Who Placed Orders
๐Ÿ“Š Tables: Same as Q4
โ“ Problem Statement: Find customers who have placed at least one order.

โœ… Solution
SELECT name FROM customers c WHERE EXISTS ( SELECT 1 FROM orders o WHERE c.customer_id = o.customer_id );

๐ŸŽฏ ๐Ÿ”Ÿ Remove Duplicate Records
๐Ÿ“Š Table: employees
id | name
1 | Rahul
2 | Rahul
3 | Amit

โ“ Problem Statement: Delete duplicate records but keep one unique record.

โœ… Solution
DELETE FROM employees WHERE id NOT IN ( SELECT MIN(id) FROM employees GROUP BY name );

๐Ÿš€ Pro Tip:
๐Ÿ‘‰ In interviews:
First explain logic
Then write query
Then optimize

Double Tap โ™ฅ๏ธ For More
โค5๐ŸŽ‰1