Data Analytics
111K subscribers
225 photos
1 video
2 files
952 links
Perfect channel to learn Data Analytics

Learn SQL, Python, Alteryx, Tableau, Power BI and many more

For Promotions: @coderfun @love_data
Download Telegram
Example: Population 100,000 customers, Sample 1,000 customers

Benefits: Faster analysis, Lower cost

160. Explain Type I and Type II Errors

Type I Error False Positive Rejecting a true null hypothesis.

Example: Fraud Alert but transaction is genuine

Type II Error False Negative Failing to reject a false null hypothesis.

Example: Fraud exists but system misses it

๐Ÿ”ฅ Most Important Statistics Topics for Data Analyst Interviews

Recruiters most frequently ask:

โœ… Mean, Median, Mode

โœ… Standard Deviation

โœ… Variance

โœ… Probability

โœ… Correlation

โœ… Hypothesis Testing

โœ… p-value

โœ… Confidence Intervals

โœ… Regression

โœ… A/B Testing

๐Ÿ’ก Common Statistics Scenario Questions

Q: Which measure is best when data contains outliers

Answer: Median

Reason: Outliers significantly affect the Mean but have little impact on the Median.

Q: A correlation of 0.85 means what

Answer: A strong positive relationship between two variables. It does NOT prove causation.

Q: Why is A/B Testing important

Answer: It helps businesses make data-driven decisions by comparing alternatives before implementing changes.

Examples: Website Design, Marketing Campaigns, Product Features

Q: When would you use Regression

Answer: To predict future outcomes based on historical data.

Examples: Sales Forecasting, Revenue Prediction, Customer Lifetime Value

๐Ÿš€ Interview Tip:

Most Data Analyst interviews don't require deep mathematical derivations.

Focus on: Understanding concepts, Business applications, Real-world examples, Interpreting results correctly

That's what interviewers typically care about most.

Double Tap โค๏ธ For Part-7
โค8
๐Ÿš€ Data Analytics Interview Questions & Answers โ€“ Case Study Questions Part 8 ๐Ÿ“Š๐Ÿ”ฅ

Case study questions test your analytical thinking, business understanding, problem-solving approach, and communication skills.

Interviewers are usually NOT looking for the exact answer.

They want to understand:

โœ” How you think

โœ” How you structure problems

โœ” Which metrics you analyze

โœ” How you reach conclusions

171. Sales Have Dropped by 20%. How Would You Analyze It?

Answer Approach

Step 1: Identify the Problem

Questions:

โ€ข Which products are affected?

โ€ข Which regions are affected?

โ€ข Since when did the decline start?

Step 2: Analyze Key Metrics

Check:

โœ” Revenue

โœ” Orders

โœ” Customers

โœ” Average Order Value

Step 3: Segment the Analysis

Analyze by:

โœ” Product Category

โœ” Region

โœ” Customer Segment

โœ” Sales Channel

Step 4: Find Root Cause

Possible Reasons:

โœ” Competitor activity

โœ” Pricing changes

โœ” Reduced marketing spend

โœ” Inventory issues

Recommendation

Identify affected segments and create targeted recovery strategies.

172. Why Are Customers Leaving a Platform?

Answer Approach

Analyze:

โœ” Churn Rate

โœ” Customer Lifetime Value

โœ” Customer Satisfaction

โœ” Product Usage

Questions to Ask

โ€ข Which customers are leaving?

โ€ข When are they leaving?

โ€ข What changed before churn?

Metrics

โœ” Retention Rate

โœ” Active Users

โœ” Subscription Renewals

Recommendation

Identify churn drivers and improve customer engagement.

173. How Would You Improve App Engagement?

Answer Approach

Analyze:

โœ” Daily Active Users DAU

โœ” Monthly Active Users MAU

โœ” Session Duration

โœ” Retention Rate

Investigate

โœ” Drop-off points

โœ” User journey

โœ” Feature usage

Possible Solutions

โœ” Push notifications

โœ” Personalized recommendations

โœ” Improved onboarding

174. Delivery Times Have Increased. How Would You Analyze It?

Answer Approach

Check:

โœ” Average Delivery Time

โœ” Delayed Orders

โœ” Region-wise Performance

Analyze

โœ” Delivery Partners

โœ” Traffic Conditions

โœ” Warehouse Performance

Root Causes

โœ” Increased demand

โœ” Staff shortages

โœ” Route inefficiencies

Recommendation

Optimize logistics and improve route planning.

175. Company Profit Is Decreasing Despite Increasing Sales. Why?

Answer Approach

Analyze:

โœ” Revenue

โœ” Cost

โœ” Profit Margin

Possible Reasons

โœ” Increased discounts

โœ” Higher operating costs

โœ” Rising transportation costs

โœ” Supplier price increases

Metrics to Review

โœ” Gross Margin

โœ” Net Margin

โœ” Cost per Unit

Recommendation

Focus on cost optimization and profitability analysis.

176. How Would You Analyze a Marketing Campaign?

Answer Approach

Measure:

โœ” Impressions

โœ” Clicks

โœ” Conversions

โœ” Revenue

KPIs

Questions

โ€ข Which channel performed best?

โ€ข Which audience converted most?

Recommendation

Increase budget on high-performing channels.

177. How Would You Detect Fraud?

Answer Approach

Look for unusual patterns.

Examples:

โœ” Multiple transactions in seconds

โœ” Unusual locations

โœ” High-value transactions
โค3
Analyze

โœ” Transaction Amount

โœ” Transaction Frequency

โœ” User Behavior

Tools

โœ” SQL

โœ” Python

โœ” Machine Learning

Recommendation

Implement fraud detection alerts.

178. Employee Attrition Is Increasing. How Would You Analyze It?

Answer Approach

Analyze:

โœ” Attrition Rate

โœ” Employee Satisfaction

โœ” Salary

โœ” Tenure

Questions

โ€ข Which departments are affected?

โ€ข Which employees are leaving?

Root Causes

โœ” Low salary

โœ” Poor management

โœ” Limited growth opportunities

Recommendation

Improve retention strategies.

179. How Would You Improve Customer Retention?

Answer Approach

Analyze:

โœ” Churn Rate

โœ” Repeat Purchases

โœ” Customer Satisfaction

Segment Customers

โœ” High-value customers

โœ” New customers

โœ” At-risk customers

Strategies

โœ” Loyalty programs

โœ” Personalized offers

โœ” Better support

Goal 
Increase customer lifetime value.

180. How Would You Analyze Product Performance? 
Answer Approach 
Measure: 
โœ” Revenue 
โœ” Profit 
โœ” Units Sold 
โœ” Growth Rate 

Analyze By 
โœ” Product Category 
โœ” Region 
โœ” Customer Segment 

Questions 
โ€ข Which products generate most profit?
โ€ข Which products are underperforming?

Recommendation 
Invest more in profitable products and optimize low-performing products.

๐Ÿ”ฅ Common Framework for Any Case Study 
Whenever you get a case study: 
Step 1 Understand the problem. 
Step 2 Identify KPIs. 
Step 3 Segment the data. Examples: โœ” Region โœ” Product โœ” Customer โœ” Time 
Step 4 Find trends and root causes. 
Step 5 Provide recommendations.

๐Ÿ’ก Example Interview Answer Structure 
Use this framework: 
1. Define the problem
2. Identify relevant KPIs
3. Segment the data
4. Analyze trends
5. Identify root causes
6. Recommend actions
7. Estimate business impact

๐Ÿ”ฅ What Interviewers Want to Hear 
They want candidates who can: 
โœ… Think logically 
โœ… Use data to support decisions 
โœ… Ask the right questions 
โœ… Focus on business outcomes 
โœ… Provide actionable recommendations 

๐Ÿš€ Interview Tip 
Never jump directly to solutions. 
Always follow: 
Problem 
Data 
Analysis 
Insights 
Recommendations 
This structured approach impresses interviewers far more than giving random answers.

๐Ÿš€ Double Tap โค๏ธ For Part-9
โค7
Data Analytics isn't rocket science. It's just a different language.

Here's a beginner's guide to the world of data analytics:

1) Understand the fundamentals:
- Mathematics
- Statistics
- Technology

2) Learn the tools:
- SQL
- Python
- Excel (yes, it's still relevant!)

3) Understand the data:
- What do you want to measure?
- How are you measuring it?
- What metrics are important to you?

4) Data Visualization:
- A picture is worth a thousand words

5) Practice:
- There's no better way to learn than to do it yourself.

Data Analytics is a valuable skill that can help you make better decisions, understand your audience better, and ultimately grow your business.

It's never too late to start learning!
โค4๐Ÿ‘1
๐—”๐—ฐ๐—ฐ๐—ฒ๐—ป๐˜๐˜‚๐—ฟ๐—ฒ ๐—™๐—ฅ๐—˜๐—˜ ๐—ฉ๐—ถ๐—ฟ๐˜๐˜‚๐—ฎ๐—น ๐—œ๐—ป๐˜๐—ฒ๐—ฟ๐—ป๐˜€๐—ต๐—ถ๐—ฝ ๐—ณ๐—ผ๐—ฟ ๐——๐—ฎ๐˜๐—ฎ ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜๐—ถ๐—ฐ๐˜€ ๐˜„๐—ถ๐˜๐—ต ๐—™๐—ฟ๐—ฒ๐—ฒ ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ฒ ๐Ÿ“Š

Join the Accenture Virtual Internship Program and learn industry-relevant analytics skills with a free certificate ๐ŸŒ

โœจ Learn from Accenture Industry Experts
โœจ Boost Your Resume & LinkedIn Profile
โœจ Gain Practical Analytics Experience
โœจ Improve Career Opportunities in 2026
โœจ Great for Students & Freshers

๐Ÿ”— ๐—˜๐—ป๐—ฟ๐—ผ๐—น๐—น ๐—™๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜๐Ÿ‘‡:

https://pdlink.in/42TuhXg

๐Ÿ”ฅ Start your Data Analytics journey today and gain valuable virtual internship experience from a top global company.
โค1
๐Ÿš€ Data Analytics Interview Questions & Answers โ€“ Behavioral & HR Questions Part 9 ๐Ÿ’ผ๐Ÿ”ฅ

Behavioral questions are often the deciding factor in interviews.

Many candidates clear the technical rounds but fail to explain their experiences, projects, and achievements effectively.

For behavioral questions, use the STAR Method:

S โ†’ Situation

T โ†’ Task

A โ†’ Action

R โ†’ Result

This keeps answers structured and professional.

181. Tell Me About Yourself

Answer Structure

1. Current Role

2. Experience

3. Technical Skills

4. Projects

5. Why you're interested in the role

Sample Answer

"Hi, I'm a Data Analyst with experience working on data analysis, reporting, dashboard development, and process automation projects.

I have worked extensively with SQL, Excel, Power BI, Tableau, Python, and data visualization tools to generate business insights and improve decision-making.

In my previous projects, I developed dashboards, automated manual processes, and analyzed large datasets to support business teams.

I'm now looking for opportunities where I can apply my analytical skills, solve business problems using data, and continue growing as a Data Analyst."

182. Why Do You Want to Become a Data Analyst?

Answer

"I enjoy solving problems using data and transforming raw information into actionable insights.

Data Analytics combines business understanding, technology, and decision-making, which makes it an exciting field for me.

I enjoy identifying trends, analyzing patterns, and helping organizations make better decisions through data."

183. Explain Your Projects

Answer Structure

For each project explain:

โœ” Business Problem

โœ” Data Used

โœ” Tools Used

โœ” Analysis Performed

โœ” Outcome

Example

"I built a Sales Dashboard using SQL and Power BI.

The objective was to analyze sales performance across products and regions.

I cleaned and transformed the data, created KPIs, built visualizations, and identified top-performing products.

The dashboard helped stakeholders track revenue trends and business performance."

184. What Challenges Did You Face in Projects?

Answer

"One challenge I faced was dealing with inconsistent data from multiple sources.

I standardized formats, cleaned missing values, validated data quality, and collaborated with stakeholders to ensure accurate reporting.

As a result, we improved reporting accuracy and reduced manual corrections."

185. How Do You Handle Deadlines?

Answer

"I prioritize tasks based on business impact and urgency.

I break large projects into smaller milestones, communicate progress regularly, and focus on delivering high-quality work within deadlines."

186. Explain a Difficult Situation at Work

Answer STAR Format

Situation: Reporting process was taking several hours manually.

Task: Reduce manual effort and improve efficiency.

Action: Automated data processing using SQL and reporting tools.

Result: Reduced reporting time significantly and improved accuracy.

187. Why Should We Hire You?

Answer

"I bring a combination of technical skills, business understanding, and problem-solving abilities.
โค5๐Ÿ‘Ž1๐Ÿ”ฅ1
I have experience working with data analysis, SQL, Power BI, Excel, and reporting tools, and I focus on turning data into actionable business insights.

I am also a quick learner and enjoy working in collaborative environments."

188. What Are Your Strengths?

Sample Strengths

โœ” Analytical Thinking

โœ” Problem Solving

โœ” Attention to Detail

โœ” Communication Skills

โœ” Fast Learning 

Example Answer

"My biggest strength is analytical problem-solving. I enjoy breaking down complex business problems into smaller components and using data to identify solutions."

189. What Are Your Weaknesses?

Good Example

"I sometimes spend extra time validating my work because I want reports to be highly accurate.

I've learned to balance accuracy with efficiency by setting review timelines and prioritizing critical tasks."

Avoid: โŒ "I don't have weaknesses."

190. Where Do You See Yourself in 5 Years?

Answer

"In five years, I see myself growing into a Senior Data Analyst or Analytics Lead role where I can contribute to business strategy, mentor team members, and work on larger analytical initiatives."

191. Explain Your Career Gap

Answer

"I utilized my career gap to upskill myself through certifications, technical learning, and hands-on projects.

During this period, I focused on strengthening my knowledge of SQL, Power BI, Python, and Data Analytics concepts, which helped me become more prepared for industry roles."

192. Why Are You Switching Careers?

Answer

"My interest in data-driven decision-making motivated me to transition into Data Analytics.

I enjoy working with data, identifying insights, and solving business problems, which aligns strongly with my long-term career goals."

193. Explain Your Resume

Answer Structure

Explain:

โœ” Experience

โœ” Skills

โœ” Projects

โœ” Certifications

โœ” Achievements

Focus on relevance to the role.

194. How Do You Handle Pressure?

Answer

"I remain focused on priorities and break work into manageable tasks.

When facing pressure, I communicate clearly, stay organized, and concentrate on delivering quality results."

195. Explain Teamwork Experience

Answer

"I have worked closely with business stakeholders, developers, and reporting teams on various projects.

Effective communication, collaboration, and knowledge sharing helped us successfully deliver project outcomes."

196. How Do You Deal With Conflicts?

Answer

"I focus on understanding different perspectives and resolving issues professionally.

I believe in discussing facts, aligning on goals, and finding solutions that benefit the team and business."

197. Describe Leadership Experience

Answer

"Although I may not have held a formal leadership title, I have taken ownership of projects, coordinated with stakeholders, shared knowledge with team members, and helped drive successful project delivery."

198. Explain a Project Failure

Answer

"One project faced delays due to changing business requirements.

I learned the importance of gathering requirements thoroughly, maintaining regular stakeholder communication, and planning for changes early in the project lifecycle."

199. How Do You Prioritize Tasks?

Answer


"I prioritize tasks based on business impact, urgency, dependencies, and deadlines.

Critical tasks affecting business operations are handled first, followed by lower-priority activities."

200. Do You Have Any Questions for Us?

Always Say YES

Good Questions: 

1. What does success look like in this role? 

2. What are the biggest challenges facing the team? 

3. What types of projects would I be working on? 

4. What growth opportunities are available? 

5. How is performance measured? 

Never respond with: โŒ "No, I don't have any questions."

๐Ÿ”ฅ Most Important Behavioral Topics

Recruiters usually evaluate:

โœ… Communication Skills

โœ… Problem-Solving Ability

โœ… Teamwork

โœ… Leadership Potential

โœ… Adaptability

โœ… Business Understanding

โœ… Learning Mindset 

๐Ÿ’ก Golden Interview Tip

Technical skills may get you shortlisted.

Behavioral skills often get you hired. 

The strongest candidates can:
โค5๐Ÿ‘4
โœ” Explain projects clearly

โœ” Quantify achievements

โœ” Communicate business impact

โœ” Demonstrate problem-solving

โœ” Show confidence without exaggeration 

๐Ÿš€ Double Tap โค๏ธ For More
โค13
๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ - ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐ๐—ธ๐——๐—ฒ๐˜ƒ ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ช๐—ถ๐˜๐—ต ๐—š๐—ฒ๐—ป๐—”๐—œ ๐Ÿ˜

Curriculum designed and taught by alumni from IITs & leading tech companies.

Learn Coding & Get Placed In Top Tech Companies

๐—›๐—ถ๐—ด๐—ต๐—น๐—ถ๐—ด๐—ต๐˜๐˜€:-

๐Ÿ’ผ Avg. Package: โ‚น7.2 LPA | Highest: โ‚น41 LPA

๐‘๐ž๐ ๐ข๐ฌ๐ญ๐ž๐ซ ๐๐จ๐ฐ ๐Ÿ‘‡:-

 https://pdlink.in/42WOE5H

Hurry! Limited seats are available.๐Ÿƒโ€โ™‚๏ธ
โค4
๐Ÿš€ Top 10 Careers in Data Analytics (2026)๐Ÿ“Š๐Ÿ’ผ

1๏ธโƒฃ Data Analyst
โ–ถ๏ธ Skills: Excel, SQL, Power BI, Data Cleaning, Data Visualization
๐Ÿ’ฐ Avg Salary: โ‚น6โ€“15 LPA (India) / 90K+ USD (Global)

2๏ธโƒฃ Business Intelligence (BI) Analyst
โ–ถ๏ธ Skills: Power BI, Tableau, SQL, Data Modeling, Dashboard Design
๐Ÿ’ฐ Avg Salary: โ‚น8โ€“18 LPA / 100K+

3๏ธโƒฃ Product Analyst
โ–ถ๏ธ Skills: SQL, Python, A/B Testing, Product Metrics, Experimentation
๐Ÿ’ฐ Avg Salary: โ‚น12โ€“25 LPA / 120K+

4๏ธโƒฃ Analytics Engineer
โ–ถ๏ธ Skills: SQL, dbt, Data Modeling, Data Warehousing, ETL
๐Ÿ’ฐ Avg Salary: โ‚น12โ€“22 LPA / 120K+

5๏ธโƒฃ Marketing Analyst
โ–ถ๏ธ Skills: Google Analytics, SQL, Excel, Customer Segmentation, Attribution Analysis
๐Ÿ’ฐ Avg Salary: โ‚น7โ€“16 LPA / 95K+

6๏ธโƒฃ Financial Data Analyst
โ–ถ๏ธ Skills: Excel, SQL, Forecasting, Financial Modeling, Power BI
๐Ÿ’ฐ Avg Salary: โ‚น8โ€“18 LPA / 105K+

7๏ธโƒฃ Data Visualization Specialist
โ–ถ๏ธ Skills: Tableau, Power BI, Storytelling with Data, Dashboard Design
๐Ÿ’ฐ Avg Salary: โ‚น7โ€“17 LPA / 100K+

8๏ธโƒฃ Operations Analyst
โ–ถ๏ธ Skills: SQL, Excel, Process Analysis, Business Metrics, Reporting
๐Ÿ’ฐ Avg Salary: โ‚น6โ€“15 LPA / 95K+

9๏ธโƒฃ Risk & Fraud Analyst
โ–ถ๏ธ Skills: SQL, Python, Fraud Detection Models, Statistical Analysis
๐Ÿ’ฐ Avg Salary: โ‚น10โ€“20 LPA / 110K+

๐Ÿ”Ÿ Analytics Consultant
โ–ถ๏ธ Skills: SQL, BI Tools, Business Strategy, Stakeholder Communication
๐Ÿ’ฐ Avg Salary: โ‚น12โ€“28 LPA / 125K+

๐Ÿ“Š Data Analytics is one of the most practical and fastest ways to enter the tech industry in 2026.

Double Tap โค๏ธ if this helped you!
โค33
๐Ÿณ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐—ง๐—ผ ๐—˜๐—ป๐—ฟ๐—ผ๐—น๐—น ๐—œ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ๐Ÿ˜ 

โœ… 100% FREE & Beginner-Friendly
โœ… Learn AI, ML, Data Science, Ethical Hacking & More
โœ… Taught by Industry Experts
โœ… Practical & Hands-on Learning

๐Ÿ“ข Start learning today and take your tech career to the next level! ๐Ÿš€

๐‹๐ข๐ง๐ค ๐Ÿ‘‡:- 
 
https://pdlink.in/4bQ6FpS
 
Enroll For FREE & Get Certified ๐ŸŽ“
โค5
๐Ÿš€ Real-World SQL Scenario Based Interview Questions with Answers

๐Ÿ“Œ Question 1: Find Customers Who Purchased in Consecutive Months

Table: orders customer_id, order_date

Requirement: Identify customers who placed orders in consecutive months.

WITH monthly_orders AS (
SELECT DISTINCT
customer_id,
DATE_TRUNC('month', order_date) AS order_month
FROM orders
),
consecutive_orders AS (
SELECT
customer_id,
order_month,
LAG(order_month) OVER (
PARTITION BY customer_id
ORDER BY order_month
) AS prev_month
FROM monthly_orders
)
SELECT customer_id
FROM consecutive_orders
WHERE order_month = prev_month + INTERVAL '1 month';

๐Ÿ“Œ Question 2: Find the Top 3 Customers by Revenue Each Month
Table: orders customer_id, amount, order_date

WITH customer_revenue AS (
SELECT
DATE_TRUNC('month', order_date) AS month,
customer_id,
SUM(amount) AS revenue
FROM orders
GROUP BY 1, 2
)

SELECT *
FROM (
SELECT *,
DENSE_RANK() OVER (
PARTITION BY month
ORDER BY revenue DESC
) AS rnk
FROM customer_revenue
) t
WHERE rnk <= 3;

๐Ÿ“Œ Question 3: Calculate Running Total Revenue

Table: sales sale_date, amount
Requirement: Show cumulative revenue over time.

SELECT
sale_date,
amount,
SUM(amount) OVER (
ORDER BY sale_date
) AS running_revenue
FROM sales;

๐Ÿ“Œ Question 4: Find Users Who Have Not Logged In During the Last 30 Days
Tables: users user_id, logins user_id, login_date

SELECT u.user_id
FROM users u
LEFT JOIN logins l
ON u.user_id = l.user_id
GROUP BY u.user_id
HAVING MAX(login_date) < CURRENT_DATE - INTERVAL '30 days'
OR MAX(login_date) IS NULL;

๐Ÿ“Œ Question 5: Detect Duplicate Transactions

Table: transactions transaction_id, customer_id, amount, transaction_date
Requirement: Find duplicate transactions based on customer, amount, and date.

SELECT
customer_id,
amount,
transaction_date,
COUNT(*) AS duplicate_count
FROM transactions
GROUP BY customer_id, amount, transaction_date
HAVING COUNT(*) > 1;

๐Ÿ“Œ Question 6: Calculate Average Order Value by Month

Table: orders order_id, amount, order_date

SELECT
DATE_TRUNC('month', order_date) AS month,
ROUND(AVG(amount), 2) AS avg_order_value
FROM orders
GROUP BY DATE_TRUNC('month', order_date)
ORDER BY month;

๐Ÿ“Œ Question 7: Find the Most Recent Order for Each Customer
Table: orders order_id, customer_id, order_date

WITH ranked_orders AS (
SELECT *,
ROW_NUMBER() OVER (
PARTITION BY customer_id
ORDER BY order_date DESC
) AS rn
FROM orders
)
SELECT
customer_id,
order_id,
order_date
FROM ranked_orders
WHERE rn = 1;

๐Ÿ“Œ Question 8: Calculate Product Contribution to Total Revenue

Table: sales product_id, amount
Requirement: Find percentage contribution of each product.

SELECT
product_id,
SUM(amount) AS revenue,
ROUND(
100.0 * SUM(amount) /
SUM(SUM(amount)) OVER (),
2
) AS contribution_pct
FROM sales
GROUP BY product_id;

๐Ÿ“Œ Question 9: Find Customers with No Orders
Tables: customers customer_id, orders customer_id

SELECT c.customer_id
FROM customers c
LEFT JOIN orders o
ON c.customer_id = o.customer_id
WHERE o.customer_id IS NULL;

๐Ÿ“Œ Question 10: Calculate 7-Day Moving Average Sales

Table: sales sale_date, amount

SELECT
sale_date,
amount,
ROUND(
AVG(amount) OVER (
ORDER BY sale_date
ROWS BETWEEN 6 PRECEDING AND CURRENT ROW
),
2
) AS moving_avg_7_days
FROM sales;

โค๏ธ Double Tap For More
โค20๐Ÿ‘2
๐Ÿ“Š ๐—ง๐—–๐—ฆ ๐—™๐—ฅ๐—˜๐—˜ ๐——๐—ฎ๐˜๐—ฎ ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜๐—ถ๐—ฐ๐˜€ ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€

Here's an amazing opportunity from TCS to learn essential data analytics skills completely FREE and earn a certificate

๐Ÿ”— ๐—˜๐—ป๐—ฟ๐—ผ๐—น๐—น ๐—™๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜๐Ÿ‘‡:

https://pdlink.in/4waJYWJ

๐Ÿ”ฅ Data Analytics continues to be one of the most in-demand career paths, and this free course is a great first step toward building job-ready skills.

โณ Don't miss this opportunity to upskill and boost your career!
โค7
๐Ÿš€ SQL Scenario Based Interview Questions with Answers Part 2

๐Ÿ“Œ Question 11: Find the Second Highest Salary in Each Department 
Table: employees (employee_id, department_id, salary)

WITH ranked_salary AS (
    SELECT *,
           DENSE_RANK() OVER (
               PARTITION BY department_id
               ORDER BY salary DESC
           ) AS rnk
    FROM employees
)
SELECT department_id, employee_id, salary
FROM ranked_salary
WHERE rnk = 2;


๐Ÿ“Œ Question 12: Identify Users Who Purchased on Their First Visit 
Tables: visits (user_id, visit_date) | orders (user_id, order_date)

WITH first_visit AS (
    SELECT user_id,
           MIN(visit_date) AS first_visit_date
    FROM visits
    GROUP BY user_id
)
SELECT DISTINCT f.user_id
FROM first_visit f
JOIN orders o
    ON f.user_id = o.user_id
   AND f.first_visit_date = o.order_date;


๐Ÿ“Œ Question 13: Find Products Never Sold 
Tables: products (product_id, product_name) | sales (product_id)

SELECT p.product_id, p.product_name
FROM products p
LEFT JOIN sales s
       ON p.product_id = s.product_id
WHERE s.product_id IS NULL;


๐Ÿ“Œ Question 14: Calculate Month-over-Month Revenue Growth 
Table: orders (order_date, revenue)

WITH monthly_revenue AS (
    SELECT DATE_TRUNC('month', order_date) AS month,
           SUM(revenue) AS total_revenue
    FROM orders
    GROUP BY 1
)
SELECT month,
       total_revenue,
       LAG(total_revenue) OVER (ORDER BY month) AS previous_month,
       ROUND(
           100.0 *
           (total_revenue - LAG(total_revenue) OVER (ORDER BY month))
           /
           LAG(total_revenue) OVER (ORDER BY month),
           2
       ) AS growth_pct
FROM monthly_revenue;


๐Ÿ“Œ Question 15: Find Employees Earning More Than Department Average 
Table: employees (employee_id, department_id, salary)

SELECT employee_id, department_id, salary
FROM (
    SELECT *,
           AVG(salary) OVER (
               PARTITION BY department_id
           ) AS dept_avg
    FROM employees
) t
WHERE salary > dept_avg;


๐Ÿ“Œ Question 16: Find Longest Consecutive Login Streak 
Table: logins (user_id, login_date)

WITH cte AS (
    SELECT user_id,
           login_date,
           login_date -
           ROW_NUMBER() OVER (
               PARTITION BY user_id
               ORDER BY login_date
           ) * INTERVAL '1 day' AS grp
    FROM logins
)
SELECT user_id, COUNT(*) AS streak_days
FROM cte
GROUP BY user_id, grp
ORDER BY streak_days DESC;


๐Ÿ“Œ Question 17: Find Peak Sales Day of Every Month 
Table: sales (sale_date, amount)

WITH daily_sales AS (
    SELECT DATE(sale_date) AS sale_day,
           SUM(amount) AS revenue
    FROM sales
    GROUP BY DATE(sale_date)
)
SELECT *
FROM (
    SELECT *,
           ROW_NUMBER() OVER (
               PARTITION BY DATE_TRUNC('month', sale_day)
               ORDER BY revenue DESC
           ) rn
    FROM daily_sales
) t
WHERE rn = 1;


๐Ÿ“Œ Question 18: Find Customers Who Ordered Every Month 
Table: orders (customer_id, order_date)

WITH customer_months AS (
    SELECT customer_id,
           COUNT(DISTINCT DATE_TRUNC('month', order_date)) AS months_active
    FROM orders
    GROUP BY customer_id
),
total_months AS (
    SELECT COUNT(DISTINCT DATE_TRUNC('month', order_date)) AS total_months
    FROM orders
)
SELECT customer_id
FROM customer_months c
CROSS JOIN total_months t
WHERE c.months_active = t.total_months;


๐Ÿ“Œ Question 19: Find Top Selling Product Category 
Tables: products (product_id, category) | sales (product_id, quantity)

SELECT category, SUM(quantity) AS total_sold
FROM sales s
JOIN products p ON s.product_id = p.product_id
GROUP BY category
ORDER BY total_sold DESC
LIMIT 1;


๐Ÿ“Œ Question 20: Calculate Median Salary 
Table: employees (employee_id, salary)

SELECT PERCENTILE_CONT(0.5)
WITHIN GROUP (ORDER BY salary)
AS median_salary
FROM employees;


๐Ÿ’ก Double Tap โค๏ธ For More
โค17
๐ŸŽ“ ๐—š๐—ผ๐—ผ๐—ด๐—น๐—ฒ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ ๐Ÿš€

Learn job-ready skills from Google and boost your resume?๐ŸŒŸ

โœ”๏ธ Learn from Google Experts
โœ”๏ธ Industry-Recognized Certificates
โœ”๏ธ Beginner-Friendly Learning Paths
โœ”๏ธ Self-Paced Courses
โœ”๏ธ Enhance Resume & LinkedIn Profile
โœ”๏ธ Build Job-Ready Skills

๐Ÿ”— ๐—˜๐—ป๐—ฟ๐—ผ๐—น๐—น ๐—™๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜๐Ÿ‘‡:

https://pdlink.in/4vjLGVq

โณ Start Learning Today & Upgrade Your Career!
โค7๐Ÿ‘Ž5
๐—œ๐—ป๐˜๐—ฒ๐—ฟ๐˜ƒ๐—ถ๐—ฒ๐˜„๐—ฒ๐—ฟ:
You have 2 minutes to solve this SQL query.

Find employees who earn more than the average salary of their own department.

๐— ๐—ฒ: Challenge accepted! ๐Ÿ’ช

SELECT
employee_id,
employee_name,
department,
salary
FROM employees e
WHERE salary > (
SELECT AVG(salary)
FROM employees
WHERE department = e.department
);


๐Ÿ’ก Explanation:

The query uses a correlated subquery to calculate the average salary for each employee's department.

โ€ข The outer query iterates through each employee.
โ€ข The inner query calculates the average salary of that employee's department.
โ€ข If an employee's salary is greater than their department's average, they're included in the result.

This is a classic SQL interview question that tests your understanding of:
โœ… Correlated Subqueries
โœ… Aggregate Functions (AVG)
โœ… Filtering with WHERE

๐ŸŽฏ Expected Output Example


+----------+------------+--------+
| Employee | Department | Salary |
+----------+------------+--------+
| John | IT | 90,000 |
| Sarah | HR | 70,000 |
| David | Finance | 85,000 |
+----------+------------+--------+


(Only employees earning above their department's average salary.)

๐Ÿš€ Correlated subqueries are asked frequently in interviews. Learn when to use themโ€”and also know how to rewrite them using window functions for better performance on large datasets.

โค๏ธ React with โค๏ธ for more SQL interview challenges!
โค22
๐— ๐—ถ๐—ฐ๐—ฟ๐—ผ๐˜€๐—ผ๐—ณ๐˜ ๐Ÿญ๐Ÿฌ๐Ÿฌ+ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐—ณ๐—ผ๐—ฟ ๐—”๐˜‡๐˜‚๐—ฟ๐—ฒ, ๐—”๐—œ, ๐—–๐˜†๐—ฏ๐—ฒ๐—ฟ๐˜€๐—ฒ๐—ฐ๐˜‚๐—ฟ๐—ถ๐˜๐˜† & ๐— ๐—ผ๐—ฟ๐—ฒ ๐Ÿš€

Learn the most in-demand tech skills from Microsoft completely FREE๐ŸŒŸ

Microsoft Learn offers 100+ free courses designed to help students, freshers, and professionals build job-ready skills in today's fastest-growing technology domains.

โœ… 100% Free Learning
โœ… Beginner to Advanced Levels

๐Ÿ”— ๐—˜๐—ป๐—ฟ๐—ผ๐—น๐—น ๐—™๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜๐Ÿ‘‡:

https://pdlink.in/4f0GNuH

๐Ÿš€ Learn. Practice. Upskill. Get Career Ready
โค2๐Ÿ‘Ž1
๐—œ๐—ป๐˜๐—ฒ๐—ฟ๐˜ƒ๐—ถ๐—ฒ๐˜„๐—ฒ๐—ฟ:

You have 2 minutes to solve this SQL query.

Find the employees who have the highest salary in each department.

๐— ๐—ฒ: Challenge accepted! ๐Ÿ’ช

SELECT
    employee_id,
    employee_name,
    department,
    salary
FROM (
    SELECT
        employee_id,
        employee_name,
        department,
        salary,
        DENSE_RANK() OVER (
            PARTITION BY department
            ORDER BY salary DESC
        ) AS rnk
    FROM employees
) ranked
WHERE rnk = 1;


๐Ÿ’ก Explanation:

This query uses the DENSE_RANK() window function to rank employees by salary within each department.

โ€ข PARTITION BY department creates separate rankings for each department.

โ€ข ORDER BY salary DESC ranks the highest salary as 1.

โ€ข DENSE_RANK() ensures that if multiple employees have the same highest salary, they all receive Rank 1.

โ€ข The outer query filters only the employees with rnk = 1.

This question tests your knowledge of:

โœ… Window Functions

โœ… DENSE_RANK() vs RANK() vs ROW_NUMBER()

โœ… Partitioning Data

๐ŸŽฏ Output Example

Employee | Department | Salary

John | IT | 95,000

Sarah | HR | 80,000

David | Finance | 90,000

Alice | IT | 95,000

(John and Alice both appear because they share the highest salary in the IT department.)

๐Ÿš€ Whenever an interview question asks for the top N records per group, think of window functions.

DENSE_RANK(), RANK(), and ROW_NUMBER() are among the most commonly tested SQL concepts.

โค๏ธ React with โค๏ธ for more SQL interview challenges!
โค16
๐Ÿ“Š ๐—ฃ๐˜„๐—– ๐—ถ๐˜€ ๐—ผ๐—ณ๐—ณ๐—ฒ๐—ฟ๐—ถ๐—ป๐—ด ๐—ฎ ๐—™๐—ฅ๐—˜๐—˜ ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ ๐—•๐—œ ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ

This helps tolearn data visualization, dashboard creation, KPI analysis, and business intelligence skills that companies actively look for.

โœ… Free Certificate
โœ… Self-Paced Learning
โœ… Hands-On Power BI Projects
โœ… Beginner Friendly
โœ… Resume & LinkedIn Boost

Don't miss this opportunity to add an in-demand skill to your profile and stand out from the crowd! ๐Ÿ’ผ๐Ÿ”ฅ

๐Ÿ”— ๐—˜๐—ป๐—ฟ๐—ผ๐—น๐—น ๐—™๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜๐Ÿ‘‡:

https://pdlink.in/4g5sKFa

Share with yours friends who wants to start a career in Data Analytics
๐—œ๐—ป๐˜๐—ฒ๐—ฟ๐˜ƒ๐—ถ๐—ฒ๐˜„๐—ฒ๐—ฟ:
You have 2 minutes to solve this SQL query.

Find employees whose salary is higher than their manager's salary.

Assume the table structure is:

employees(employee_id, employee_name, manager_id, salary)

๐— ๐—ฒ: Challenge accepted! ๐Ÿ’ช

SELECT
e.employee_id,
e.employee_name,
e.salary AS employee_salary,
m.employee_name AS manager_name,
m.salary AS manager_salary
FROM employees e
JOIN employees m
ON e.manager_id = m.employee_id
WHERE e.salary > m.salary;

๐Ÿ’ก Explanation:

This query uses a self join because both employees and managers are stored in the same table.

โ€ข e represents the employee.
โ€ข m represents the manager.
โ€ข The join matches each employee with their manager using manager_id.
โ€ข The WHERE clause filters employees whose salary is greater than their manager's salary.

This question tests your understanding of:
โœ… Self Joins
โœ… Aliases (e and m)
โœ… Comparing values across related rows

๐ŸŽฏ Expected Output Example

Employee Employee Salary Manager Manager Salary

John 90,000 David 80,000
Sarah 85,000 Michael 75,000


๐Ÿš€ Self joins are one of the most frequently asked SQL interview topics. Practice scenarios involving employees, managers, organizational hierarchies, categories, and parent-child relationships.

โค๏ธ React with โค๏ธ for more SQL interview challenges!
โค17
๐Ÿ“Š ๐—™๐—ฅ๐—˜๐—˜ ๐—ง๐—ฎ๐˜๐—ฎ ๐——๐—ฎ๐˜๐—ฎ ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜๐—ถ๐—ฐ๐˜€ ๐—ฉ๐—ถ๐—ฟ๐˜๐˜‚๐—ฎ๐—น ๐—œ๐—ป๐˜๐—ฒ๐—ฟ๐—ป๐˜€๐—ต๐—ถ๐—ฝ | ๐—ช๐—ถ๐˜๐—ต ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ฒ ๐Ÿš€

Here's an amazing opportunity to complete the FREE Tata Data Analytics Virtual Internship and earn a certificate that you can showcase on your Resume and LinkedIn.

โœ… 100% FREE
โœ… Self-Paced & Online
โœ… Beginner-Friendly
โœ… Certificate on Completion
โœ… Real Business Case Studies
โœ… Resume & LinkedIn Boost

๐Ÿ”— ๐—˜๐—ป๐—ฟ๐—ผ๐—น๐—น ๐—™๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜๐Ÿ‘‡:

https://pdlink.in/4eybW8J

๐Ÿš€ Upskill Today. Build Your Portfolio. Get Career Ready!
โค9