🧠 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 🚀
📌
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.
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
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. 🚀
📌
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 :)
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
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
Useful websites to practice and enhance your Data Analytics skills
👇👇
1. SQL
https://mode.com/sql-tutorial/introduction-to-sql
https://t.me/sqlspecialist/232?single
2. Python
https://www.learnpython.org/
https://bit.ly/3T7y4ta
https://www.geeksforgeeks.org/python-programming-language/learn-python-tutorial
3. R
https://www.datacamp.com/courses/free-introduction-to-r
4. Data Structures
https://leetcode.com/study-plan/data-structure/
https://www.udacity.com/course/data-structures-and-algorithms-in-python--ud513
5. Data Visualization
https://www.freecodecamp.org/learn/data-visualization/
https://www.tableau.com/learn/training/20223
https://www.workout-wednesday.com/power-bi-challenges/
6. Excel
https://excel-practice-online.com/
https://www.w3schools.com/EXCEL/index.php
Join @free4unow_backup for more free courses
ENJOY LEARNING 👍👍
👇👇
1. SQL
https://mode.com/sql-tutorial/introduction-to-sql
https://t.me/sqlspecialist/232?single
2. Python
https://www.learnpython.org/
https://bit.ly/3T7y4ta
https://www.geeksforgeeks.org/python-programming-language/learn-python-tutorial
3. R
https://www.datacamp.com/courses/free-introduction-to-r
4. Data Structures
https://leetcode.com/study-plan/data-structure/
https://www.udacity.com/course/data-structures-and-algorithms-in-python--ud513
5. Data Visualization
https://www.freecodecamp.org/learn/data-visualization/
https://www.tableau.com/learn/training/20223
https://www.workout-wednesday.com/power-bi-challenges/
6. Excel
https://excel-practice-online.com/
https://www.w3schools.com/EXCEL/index.php
Join @free4unow_backup for more free courses
ENJOY LEARNING 👍👍
❤1
🧠 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 🚀
📌
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 🚀
📌
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 :)
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!
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 🚀
📌
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
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 🚀
📌
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
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
🎯 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
🧠 SQL Interview Question (Detect Negative Account Balance)
📌
transactions(txn_id, txn_date, amount)
(credit = +ve, debit = -ve)
❓ Ques :
👉 Find the first date when account balance becomes negative
👉 Return txn_date
🧩 How Interviewers Expect You to Think
• Calculate running balance over time 💰
• Use cumulative sum
• Track when balance drops below zero
• Return first occurrence
💡 SQL Solution
WITH balance_cte AS (
SELECT
txn_date,
SUM(amount) OVER (
ORDER BY txn_date
) AS running_balance
FROM transactions
)
SELECT txn_date
FROM balance_cte
WHERE running_balance < 0
ORDER BY txn_date
LIMIT 1;
🔥 Why This Question Is Powerful
• Tests cumulative sum (window function) 🧠
• Very common in fintech & transaction analysis
• Checks real-world problem solving ability
❤️ React for more SQL interview questions 🚀
📌
transactions(txn_id, txn_date, amount)
(credit = +ve, debit = -ve)
❓ Ques :
👉 Find the first date when account balance becomes negative
👉 Return txn_date
🧩 How Interviewers Expect You to Think
• Calculate running balance over time 💰
• Use cumulative sum
• Track when balance drops below zero
• Return first occurrence
💡 SQL Solution
WITH balance_cte AS (
SELECT
txn_date,
SUM(amount) OVER (
ORDER BY txn_date
) AS running_balance
FROM transactions
)
SELECT txn_date
FROM balance_cte
WHERE running_balance < 0
ORDER BY txn_date
LIMIT 1;
🔥 Why This Question Is Powerful
• Tests cumulative sum (window function) 🧠
• Very common in fintech & transaction analysis
• Checks real-world problem solving ability
❤️ React for more SQL interview questions 🚀
❤5
7 Misconceptions About Data Analytics (and What’s Actually True): 📊🚀
❌ You need to be a math or statistics genius
✅ Basic math + logical thinking is enough. Most real-world analytics is about understanding data, not complex formulas.
❌ You must learn every tool before applying for jobs
✅ Start with core tools (Excel, SQL, one BI tool). Master fundamentals — tools can be learned on the job.
❌ Data analytics is only about numbers
✅ It’s about storytelling with data — explaining insights clearly to non-technical stakeholders.
❌ You need coding skills like a software developer
✅ Not required. SQL + basic Python/R is enough for most analyst roles. Deep coding is optional, not mandatory.
❌ Analysts just make dashboards all day
✅ Dashboards are just one part. Real work includes data cleaning, business understanding, ad-hoc analysis, and decision support.
❌ You need huge datasets to be a “real” data analyst
✅ Even small datasets can provide powerful insights if the questions are right.
❌ Once you learn analytics, your learning is done
✅ Data analytics evolves constantly — new tools, business problems, and techniques mean continuous learning.
💬 Tap ❤️ if you agree
❌ You need to be a math or statistics genius
✅ Basic math + logical thinking is enough. Most real-world analytics is about understanding data, not complex formulas.
❌ You must learn every tool before applying for jobs
✅ Start with core tools (Excel, SQL, one BI tool). Master fundamentals — tools can be learned on the job.
❌ Data analytics is only about numbers
✅ It’s about storytelling with data — explaining insights clearly to non-technical stakeholders.
❌ You need coding skills like a software developer
✅ Not required. SQL + basic Python/R is enough for most analyst roles. Deep coding is optional, not mandatory.
❌ Analysts just make dashboards all day
✅ Dashboards are just one part. Real work includes data cleaning, business understanding, ad-hoc analysis, and decision support.
❌ You need huge datasets to be a “real” data analyst
✅ Even small datasets can provide powerful insights if the questions are right.
❌ Once you learn analytics, your learning is done
✅ Data analytics evolves constantly — new tools, business problems, and techniques mean continuous learning.
💬 Tap ❤️ if you agree
❤6
✅ A-Z Data Science Roadmap (Beginner to Job Ready) 📊🧠
1️⃣ Learn Python Basics
• Variables, data types, loops, functions
• Libraries: NumPy, Pandas
2️⃣ Data Cleaning Manipulation
• Handling missing values, duplicates
• Data wrangling with Pandas
• GroupBy, merge, pivot tables
3️⃣ Data Visualization
• Matplotlib, Seaborn
• Plotly for interactive charts
• Visualizing distributions, trends, relationships
4️⃣ Math for Data Science
• Statistics (mean, median, std, distributions)
• Probability basics
• Linear algebra (vectors, matrices)
• Calculus (for ML intuition)
5️⃣ SQL for Data Analysis
• SELECT, JOIN, GROUP BY, subqueries
• Window functions
• Real-world queries on large datasets
6️⃣ Exploratory Data Analysis (EDA)
• Univariate multivariate analysis
• Outlier detection
• Correlation heatmaps
7️⃣ Machine Learning (ML)
• Supervised vs Unsupervised
• Regression, classification, clustering
• Train-test split, cross-validation
• Overfitting, regularization
8️⃣ ML with scikit-learn
• Linear logistic regression
• Decision trees, random forest, SVM
• K-means clustering
• Model evaluation metrics (accuracy, RMSE, F1)
9️⃣ Deep Learning (Basics)
• Neural networks, activation functions
• TensorFlow / PyTorch
• MNIST digit classifier
🔟 Projects to Build
• Titanic survival prediction
• House price prediction
• Customer segmentation
• Sentiment analysis
• Dashboard + ML combo
1️⃣1️⃣ Tools to Learn
• Jupyter Notebook
• Git GitHub
• Google Colab
• VS Code
1️⃣2️⃣ Model Deployment
• Streamlit, Flask APIs
• Deploy on Render, Heroku or Hugging Face Spaces
1️⃣3️⃣ Communication Skills
• Present findings clearly
• Build dashboards or reports
• Use storytelling with data
1️⃣4️⃣ Portfolio Resume
• Upload projects on GitHub
• Write blogs on Medium/Kaggle
• Create a LinkedIn-optimized profile
💡 Pro Tip: Learn by building real projects and explaining them simply!
💬 Tap ❤️ for more!
1️⃣ Learn Python Basics
• Variables, data types, loops, functions
• Libraries: NumPy, Pandas
2️⃣ Data Cleaning Manipulation
• Handling missing values, duplicates
• Data wrangling with Pandas
• GroupBy, merge, pivot tables
3️⃣ Data Visualization
• Matplotlib, Seaborn
• Plotly for interactive charts
• Visualizing distributions, trends, relationships
4️⃣ Math for Data Science
• Statistics (mean, median, std, distributions)
• Probability basics
• Linear algebra (vectors, matrices)
• Calculus (for ML intuition)
5️⃣ SQL for Data Analysis
• SELECT, JOIN, GROUP BY, subqueries
• Window functions
• Real-world queries on large datasets
6️⃣ Exploratory Data Analysis (EDA)
• Univariate multivariate analysis
• Outlier detection
• Correlation heatmaps
7️⃣ Machine Learning (ML)
• Supervised vs Unsupervised
• Regression, classification, clustering
• Train-test split, cross-validation
• Overfitting, regularization
8️⃣ ML with scikit-learn
• Linear logistic regression
• Decision trees, random forest, SVM
• K-means clustering
• Model evaluation metrics (accuracy, RMSE, F1)
9️⃣ Deep Learning (Basics)
• Neural networks, activation functions
• TensorFlow / PyTorch
• MNIST digit classifier
🔟 Projects to Build
• Titanic survival prediction
• House price prediction
• Customer segmentation
• Sentiment analysis
• Dashboard + ML combo
1️⃣1️⃣ Tools to Learn
• Jupyter Notebook
• Git GitHub
• Google Colab
• VS Code
1️⃣2️⃣ Model Deployment
• Streamlit, Flask APIs
• Deploy on Render, Heroku or Hugging Face Spaces
1️⃣3️⃣ Communication Skills
• Present findings clearly
• Build dashboards or reports
• Use storytelling with data
1️⃣4️⃣ Portfolio Resume
• Upload projects on GitHub
• Write blogs on Medium/Kaggle
• Create a LinkedIn-optimized profile
💡 Pro Tip: Learn by building real projects and explaining them simply!
💬 Tap ❤️ for more!
❤7
Data Analytics Interview Questions with Answers Part-1: 📱
1. What is the difference between data analysis and data analytics?
⦁ Data analysis involves inspecting, cleaning, and modeling data to discover useful information and patterns for decision-making.
⦁ Data analytics is a broader process that includes data collection, transformation, analysis, and interpretation, often involving predictive and prescriptive techniques to drive business strategies.
2. Explain the data cleaning process you follow.
⦁ Identify missing, inconsistent, or corrupt data.
⦁ Handle missing data by imputation (mean, median, mode) or removal if appropriate.
⦁ Standardize formats (dates, strings).
⦁ Remove duplicates.
⦁ Detect and treat outliers.
⦁ Validate cleaned data against known business rules.
3. How do you handle missing or duplicate data?
⦁ Missing data: Identify patterns; if random, impute using statistical methods or predictive modeling; else consider domain knowledge before removal.
⦁ Duplicate data: Detect with key fields; remove exact duplicates or merge fuzzy duplicates based on context.
4. What is a primary key in a database?
A primary key uniquely identifies each record in a table, ensuring entity integrity and enabling relationships between tables via foreign keys.
5. Write a SQL query to find the second highest salary in a table.
6. Explain INNER JOIN vs LEFT JOIN with examples.
⦁ INNER JOIN: Returns only matching rows between two tables.
⦁ LEFT JOIN: Returns all rows from the left table, plus matching rows from the right; if no match, right columns are NULL.
Example:
7. What are outliers? How do you detect and treat them?
⦁ Outliers are data points significantly different from others that can skew analysis.
⦁ Detect with boxplots, z-score (>3), or IQR method (values outside 1.5*IQR).
⦁ Treat by investigating causes, correcting errors, transforming data, or removing if they’re noise.
8. Describe what a pivot table is and how you use it.
A pivot table is a data summarization tool that groups, aggregates (sum, average), and displays data cross-categorically. Used in Excel and BI tools for quick insights and reporting.
9. How do you validate a data model’s performance?
⦁ Use relevant metrics (accuracy, precision, recall for classification; RMSE, MAE for regression).
⦁ Perform cross-validation to check generalizability.
⦁ Test on holdout or unseen data sets.
10. What is hypothesis testing? Explain t-test and z-test.
⦁ Hypothesis testing assesses if sample data supports a claim about a population.
⦁ t-test: Used when sample size is small and population variance is unknown, often comparing means.
⦁ z-test: Used for large samples with known variance to test population parameters.
React ♥️ for Part-2
1. What is the difference between data analysis and data analytics?
⦁ Data analysis involves inspecting, cleaning, and modeling data to discover useful information and patterns for decision-making.
⦁ Data analytics is a broader process that includes data collection, transformation, analysis, and interpretation, often involving predictive and prescriptive techniques to drive business strategies.
2. Explain the data cleaning process you follow.
⦁ Identify missing, inconsistent, or corrupt data.
⦁ Handle missing data by imputation (mean, median, mode) or removal if appropriate.
⦁ Standardize formats (dates, strings).
⦁ Remove duplicates.
⦁ Detect and treat outliers.
⦁ Validate cleaned data against known business rules.
3. How do you handle missing or duplicate data?
⦁ Missing data: Identify patterns; if random, impute using statistical methods or predictive modeling; else consider domain knowledge before removal.
⦁ Duplicate data: Detect with key fields; remove exact duplicates or merge fuzzy duplicates based on context.
4. What is a primary key in a database?
A primary key uniquely identifies each record in a table, ensuring entity integrity and enabling relationships between tables via foreign keys.
5. Write a SQL query to find the second highest salary in a table.
SELECT MAX(salary)
FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);
6. Explain INNER JOIN vs LEFT JOIN with examples.
⦁ INNER JOIN: Returns only matching rows between two tables.
⦁ LEFT JOIN: Returns all rows from the left table, plus matching rows from the right; if no match, right columns are NULL.
Example:
SELECT * FROM A INNER JOIN B ON A.id = B.id;
SELECT * FROM A LEFT JOIN B ON A.id = B.id;
7. What are outliers? How do you detect and treat them?
⦁ Outliers are data points significantly different from others that can skew analysis.
⦁ Detect with boxplots, z-score (>3), or IQR method (values outside 1.5*IQR).
⦁ Treat by investigating causes, correcting errors, transforming data, or removing if they’re noise.
8. Describe what a pivot table is and how you use it.
A pivot table is a data summarization tool that groups, aggregates (sum, average), and displays data cross-categorically. Used in Excel and BI tools for quick insights and reporting.
9. How do you validate a data model’s performance?
⦁ Use relevant metrics (accuracy, precision, recall for classification; RMSE, MAE for regression).
⦁ Perform cross-validation to check generalizability.
⦁ Test on holdout or unseen data sets.
10. What is hypothesis testing? Explain t-test and z-test.
⦁ Hypothesis testing assesses if sample data supports a claim about a population.
⦁ t-test: Used when sample size is small and population variance is unknown, often comparing means.
⦁ z-test: Used for large samples with known variance to test population parameters.
React ♥️ for Part-2
❤8