✅10 Most Useful SQL Interview Queries (with Examples) 💼
1️⃣ Find the second highest salary:
2️⃣ Count employees in each department:
3️⃣ Fetch duplicate emails:
4️⃣ Join orders with customer names:
5️⃣ Get top 3 highest salaries:
6️⃣ Retrieve latest 5 logins:
7️⃣ Employees with no manager:
8️⃣ Search names starting with ‘S’:
9️⃣ Total sales per month:
🔟 Delete inactive users:
✅ Tip: Master subqueries, joins, groupings & filters – they show up in nearly every interview!
💬 Tap ❤️ for more!
1️⃣ Find the second highest salary:
SELECT MAX(salary)
FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);
2️⃣ Count employees in each department:
SELECT department, COUNT(*)
FROM employees
GROUP BY department;
3️⃣ Fetch duplicate emails:
SELECT email, COUNT(*)
FROM users
GROUP BY email
HAVING COUNT(*) > 1;
4️⃣ Join orders with customer names:
SELECT c.name, o.order_date
FROM customers c
JOIN orders o ON c.id = o.customer_id;
5️⃣ Get top 3 highest salaries:
SELECT DISTINCT salary
FROM employees
ORDER BY salary DESC
LIMIT 3;
6️⃣ Retrieve latest 5 logins:
SELECT * FROM logins
ORDER BY login_time DESC
LIMIT 5;
7️⃣ Employees with no manager:
SELECT name
FROM employees
WHERE manager_id IS NULL;
8️⃣ Search names starting with ‘S’:
SELECT * FROM employees
WHERE name LIKE 'S%';
9️⃣ Total sales per month:
SELECT MONTH(order_date) AS month, SUM(amount)
FROM sales
GROUP BY MONTH(order_date);
🔟 Delete inactive users:
DELETE FROM users
WHERE last_active < '2023-01-01';
✅ Tip: Master subqueries, joins, groupings & filters – they show up in nearly every interview!
💬 Tap ❤️ for more!
❤5
Starting your journey as a data analyst is an amazing start for your career. As you progress, you might find new areas that pique your interest:
• Data Science: If you enjoy diving deep into statistics, predictive modeling, and machine learning, this could be your next challenge.
• Data Engineering: If building and optimizing data pipelines excites you, this might be the path for you.
• Business Analysis: If you're passionate about translating data into strategic business insights, consider transitioning to a business analyst role.
But remember, even if you stick with data analysis, there's always room for growth, especially with the evolving landscape of AI.
No matter where your path leads, the key is to start now.
• Data Science: If you enjoy diving deep into statistics, predictive modeling, and machine learning, this could be your next challenge.
• Data Engineering: If building and optimizing data pipelines excites you, this might be the path for you.
• Business Analysis: If you're passionate about translating data into strategic business insights, consider transitioning to a business analyst role.
But remember, even if you stick with data analysis, there's always room for growth, especially with the evolving landscape of AI.
No matter where your path leads, the key is to start now.
❤4
Top 10 SQL interview questions with solutions by @sqlspecialist
1. What is the difference between WHERE and HAVING?
Solution:
WHERE filters rows before aggregation.
HAVING filters rows after aggregation.
2. Write a query to find the second-highest salary.
Solution:
3. How do you fetch the first 5 rows of a table?
Solution:
For SQL Server:
4. Write a query to find duplicate records in a table.
Solution:
5. How do you find employees who don’t belong to any department?
Solution:
6. What is a JOIN, and write a query to fetch data using INNER JOIN.
Solution:
A JOIN combines rows from two or more tables based on a related column.
7. Write a query to find the total number of employees in each department.
Solution:
8. How do you fetch the current date in SQL?
Solution:
9. Write a query to delete duplicate rows but keep one.
Solution:
10. What is a Common Table Expression (CTE), and how do you use it?
Solution:
A CTE is a temporary result set defined within a query.
Hope it helps :)
#sql #dataanalysts
1. What is the difference between WHERE and HAVING?
Solution:
WHERE filters rows before aggregation.
HAVING filters rows after aggregation.
SELECT department, AVG(salary)
FROM employees
WHERE salary > 3000
GROUP BY department
HAVING AVG(salary) > 5000;
2. Write a query to find the second-highest salary.
Solution:
SELECT MAX(salary) AS second_highest_salary
FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);
3. How do you fetch the first 5 rows of a table?
Solution:
SELECT * FROM employees
LIMIT 5; -- (MySQL/PostgreSQL)
For SQL Server:
SELECT TOP 5 * FROM employees;
4. Write a query to find duplicate records in a table.
Solution:
SELECT column1, column2, COUNT(*)
FROM table_name
GROUP BY column1, column2
HAVING COUNT(*) > 1;
5. How do you find employees who don’t belong to any department?
Solution:
SELECT *
FROM employees
WHERE department_id IS NULL;
6. What is a JOIN, and write a query to fetch data using INNER JOIN.
Solution:
A JOIN combines rows from two or more tables based on a related column.
SELECT e.name, d.department_name
FROM employees e
INNER JOIN departments d ON e.department_id = d.id;
7. Write a query to find the total number of employees in each department.
Solution:
SELECT department_id, COUNT(*) AS total_employees
FROM employees
GROUP BY department_id;
8. How do you fetch the current date in SQL?
Solution:
SELECT CURRENT_DATE; -- MySQL/PostgreSQL
SELECT GETDATE(); -- SQL Server
9. Write a query to delete duplicate rows but keep one.
Solution:
WITH CTE AS (
SELECT *, ROW_NUMBER() OVER (PARTITION BY column1, column2 ORDER BY id) AS rn
FROM table_name
)
DELETE FROM CTE WHERE rn > 1;
10. What is a Common Table Expression (CTE), and how do you use it?
Solution:
A CTE is a temporary result set defined within a query.
WITH EmployeeCTE AS (
SELECT department_id, COUNT(*) AS total_employees
FROM employees
GROUP BY department_id
)
SELECT * FROM EmployeeCTE WHERE total_employees > 10;
Hope it helps :)
#sql #dataanalysts
❤2
Top 50 Data Analytics Interview Questions (2025)
1. What is the difference between data analysis and data analytics?
2. Explain the data cleaning process you follow.
3. How do you handle missing or duplicate data?
4. What is a primary key in a database?
5. Write a SQL query to find the second highest salary in a table.
6. Explain INNER JOIN vs LEFT JOIN with examples.
7. What are outliers? How do you detect and treat them?
8. Describe what a pivot table is and how you use it.
9. How do you validate a data model’s performance?
10. What is hypothesis testing? Explain t-test and z-test.
11. How do you explain complex data insights to non-technical stakeholders?
12. What tools do you use for data visualization?
13. How do you optimize a slow SQL query?
14. Describe a time when your analysis impacted a business decision.
15. What is the difference between clustered and non-clustered indexes?
16. Explain the bias-variance tradeoff.
17. What is collaborative filtering?
18. How do you handle large datasets?
19. What Python libraries do you use for data analysis?
20. Describe data profiling and its importance.
21. How do you detect and handle multicollinearity?
22. Can you explain the concept of data partitioning?
23. What is data normalization? Why is it important?
24. Describe your experience with A/B testing.
25. What’s the difference between supervised and unsupervised learning?
26. How do you keep yourself updated with new tools and techniques?
27. What’s a use case for a LEFT JOIN over an INNER JOIN?
28. Explain the curse of dimensionality.
29. What are the key metrics you track in your analyses?
30. Describe a situation when you had conflicting priorities in a project.
31. What is ETL? Have you worked with any ETL tools?
32. How do you ensure data quality?
33. What’s your approach to storytelling with data?
34. How would you improve an existing dashboard?
35. What’s the role of machine learning in data analytics?
36. Explain a time when you automated a repetitive data task.
37. What’s your experience with cloud platforms for data analytics?
38. How do you approach exploratory data analysis (EDA)?
39. What’s the difference between outlier detection and anomaly detection?
40. Describe a challenging data problem you solved.
41. Explain the concept of data aggregation.
42. What’s your favorite data visualization technique and why?
43. How do you handle unstructured data?
44. What’s the difference between R and Python for data analytics?
45. Describe your process for preparing a dataset for analysis.
46. What is a data lake vs a data warehouse?
47. How do you manage version control of your analysis scripts?
48. What are your strategies for effective teamwork in analytics projects?
49. How do you handle feedback on your analysis?
50. Can you share an example where you turned data into actionable insights?
Double tap ❤️ for detailed answers
1. What is the difference between data analysis and data analytics?
2. Explain the data cleaning process you follow.
3. How do you handle missing or duplicate data?
4. What is a primary key in a database?
5. Write a SQL query to find the second highest salary in a table.
6. Explain INNER JOIN vs LEFT JOIN with examples.
7. What are outliers? How do you detect and treat them?
8. Describe what a pivot table is and how you use it.
9. How do you validate a data model’s performance?
10. What is hypothesis testing? Explain t-test and z-test.
11. How do you explain complex data insights to non-technical stakeholders?
12. What tools do you use for data visualization?
13. How do you optimize a slow SQL query?
14. Describe a time when your analysis impacted a business decision.
15. What is the difference between clustered and non-clustered indexes?
16. Explain the bias-variance tradeoff.
17. What is collaborative filtering?
18. How do you handle large datasets?
19. What Python libraries do you use for data analysis?
20. Describe data profiling and its importance.
21. How do you detect and handle multicollinearity?
22. Can you explain the concept of data partitioning?
23. What is data normalization? Why is it important?
24. Describe your experience with A/B testing.
25. What’s the difference between supervised and unsupervised learning?
26. How do you keep yourself updated with new tools and techniques?
27. What’s a use case for a LEFT JOIN over an INNER JOIN?
28. Explain the curse of dimensionality.
29. What are the key metrics you track in your analyses?
30. Describe a situation when you had conflicting priorities in a project.
31. What is ETL? Have you worked with any ETL tools?
32. How do you ensure data quality?
33. What’s your approach to storytelling with data?
34. How would you improve an existing dashboard?
35. What’s the role of machine learning in data analytics?
36. Explain a time when you automated a repetitive data task.
37. What’s your experience with cloud platforms for data analytics?
38. How do you approach exploratory data analysis (EDA)?
39. What’s the difference between outlier detection and anomaly detection?
40. Describe a challenging data problem you solved.
41. Explain the concept of data aggregation.
42. What’s your favorite data visualization technique and why?
43. How do you handle unstructured data?
44. What’s the difference between R and Python for data analytics?
45. Describe your process for preparing a dataset for analysis.
46. What is a data lake vs a data warehouse?
47. How do you manage version control of your analysis scripts?
48. What are your strategies for effective teamwork in analytics projects?
49. How do you handle feedback on your analysis?
50. Can you share an example where you turned data into actionable insights?
Double tap ❤️ for detailed answers
❤9
Hey guys 👋
I was working on something big from last few days.
Finally, I have curated best 80+ top-notch Data Analytics Resources 👇👇
https://topmate.io/analyst/861634
If you go on purchasing these books, it will cost you more than 15000 but I kept the minimal price for everyone's benefit.
I hope these resources will help you in data analytics journey.
I will add more resources here in the future without any additional cost.
All the best for your career ❤️
I was working on something big from last few days.
Finally, I have curated best 80+ top-notch Data Analytics Resources 👇👇
https://topmate.io/analyst/861634
If you go on purchasing these books, it will cost you more than 15000 but I kept the minimal price for everyone's benefit.
I hope these resources will help you in data analytics journey.
I will add more resources here in the future without any additional cost.
All the best for your career ❤️
❤3👏2✍1
Master PowerBI in 15 days.pdf
2.7 MB
Master Power-bi in 15 days 💪🔥
Do not forget to React ❤️ to this Message for More Content Like this
Thanks For Joining All ❤️🙏
Do not forget to React ❤️ to this Message for More Content Like this
Thanks For Joining All ❤️🙏
Power-bi interview questions and answers.pdf
921.5 KB
Top 50 Power-bi interview questions and answers 💪🔥
Do not forget to React ❤️ to this Message for More Content Like this
Thanks For Joining All ❤️🙏
Do not forget to React ❤️ to this Message for More Content Like this
Thanks For Joining All ❤️🙏
❤16
Python Interview Questions with Answers Part-1: ☑️
1. What is Python and why is it popular for data analysis?
Python is a high-level, interpreted programming language known for simplicity and readability. It’s popular in data analysis due to its rich ecosystem of libraries like Pandas, NumPy, and Matplotlib that simplify data manipulation, analysis, and visualization.
2. Differentiate between lists, tuples, and sets in Python.
⦁ List: Mutable, ordered, allows duplicates.
⦁ Tuple: Immutable, ordered, allows duplicates.
⦁ Set: Mutable, unordered, no duplicates.
3. How do you handle missing data in a dataset?
Common methods: removing rows/columns with missing values, filling with mean/median/mode, or using interpolation. Libraries like Pandas provide
4. What are list comprehensions and how are they useful?
Concise syntax to create lists from iterables using a single readable line, often replacing loops for cleaner and faster code.
Example:
5. Explain Pandas DataFrame and Series.
⦁ Series: 1D labeled array, like a column.
⦁ DataFrame: 2D labeled data structure with rows and columns, like a spreadsheet.
6. How do you read data from different file formats (CSV, Excel, JSON) in Python?
Using Pandas:
⦁ CSV:
⦁ Excel:
⦁ JSON:
7. What is the difference between Python’s
⦁
⦁
8. How do you filter rows in a Pandas DataFrame?
Using boolean indexing:
9. Explain the use of
Example:
10. What are lambda functions and how are they used?
Anonymous, inline functions defined with
Example:
React ♥️ for Part 2
1. What is Python and why is it popular for data analysis?
Python is a high-level, interpreted programming language known for simplicity and readability. It’s popular in data analysis due to its rich ecosystem of libraries like Pandas, NumPy, and Matplotlib that simplify data manipulation, analysis, and visualization.
2. Differentiate between lists, tuples, and sets in Python.
⦁ List: Mutable, ordered, allows duplicates.
⦁ Tuple: Immutable, ordered, allows duplicates.
⦁ Set: Mutable, unordered, no duplicates.
3. How do you handle missing data in a dataset?
Common methods: removing rows/columns with missing values, filling with mean/median/mode, or using interpolation. Libraries like Pandas provide
.dropna(), .fillna() functions to do this easily.4. What are list comprehensions and how are they useful?
Concise syntax to create lists from iterables using a single readable line, often replacing loops for cleaner and faster code.
Example:
[x**2 for x in range(5)] → ``5. Explain Pandas DataFrame and Series.
⦁ Series: 1D labeled array, like a column.
⦁ DataFrame: 2D labeled data structure with rows and columns, like a spreadsheet.
6. How do you read data from different file formats (CSV, Excel, JSON) in Python?
Using Pandas:
⦁ CSV:
pd.read_csv('file.csv')⦁ Excel:
pd.read_excel('file.xlsx')⦁ JSON:
pd.read_json('file.json')7. What is the difference between Python’s
append() and extend() methods?⦁
append() adds its argument as a single element to the end of a list.⦁
extend() iterates over its argument adding each element to the list.8. How do you filter rows in a Pandas DataFrame?
Using boolean indexing:
df[df['column'] > value] filters rows where ‘column’ is greater than value.9. Explain the use of
groupby() in Pandas with an example. groupby() splits data into groups based on column(s), then you can apply aggregation. Example:
df.groupby('category')['sales'].sum() gives total sales per category.10. What are lambda functions and how are they used?
Anonymous, inline functions defined with
lambda keyword. Used for quick, throwaway functions without formally defining with def. Example:
df['new'] = df['col'].apply(lambda x: x*2)React ♥️ for Part 2
❤7🔥3
Grab the deal before it over
Best deal from admin
One month premium of perplexity ai with comet browser worth 200$ for free
No payment no checkout direct redeem.
Open link, login & download comet browser.
Ask anything to comet you get best answers for your learning
https://pplx.ai/bhavinahir537
Best deal from admin
One month premium of perplexity ai with comet browser worth 200$ for free
No payment no checkout direct redeem.
Open link, login & download comet browser.
Ask anything to comet you get best answers for your learning
https://pplx.ai/bhavinahir537
pplx.ai
Expired Link
This link has expired. Please contact the owner of this link to get a new one.
🔥3❤2
If I had to start learning data analyst all over again, I'd follow this:
1- Learn SQL:
---- Joins (Inner, Left, Full outer and Self)
---- Aggregate Functions (COUNT, SUM, AVG, MIN, MAX)
---- Group by and Having clause
---- CTE and Subquery
---- Windows Function (Rank, Dense Rank, Row number, Lead, Lag etc)
2- Learn Excel:
---- Mathematical (COUNT, SUM, AVG, MIN, MAX, etc)
---- Logical Functions (IF, AND, OR, NOT)
---- Lookup and Reference (VLookup, INDEX, MATCH etc)
---- Pivot Table, Filters, Slicers
3- Learn BI Tools:
---- Data Integration and ETL (Extract, Transform, Load)
---- Report Generation
---- Data Exploration and Ad-hoc Analysis
---- Dashboard Creation
4- Learn Python (Pandas) Optional:
---- Data Structures, Data Cleaning and Preparation
---- Data Manipulation
---- Merging and Joining Data (Merging and joining DataFrames -similar to SQL joins)
---- Data Visualization (Basic plotting using Matplotlib and Seaborn)
Hope this helps you 😊
1- Learn SQL:
---- Joins (Inner, Left, Full outer and Self)
---- Aggregate Functions (COUNT, SUM, AVG, MIN, MAX)
---- Group by and Having clause
---- CTE and Subquery
---- Windows Function (Rank, Dense Rank, Row number, Lead, Lag etc)
2- Learn Excel:
---- Mathematical (COUNT, SUM, AVG, MIN, MAX, etc)
---- Logical Functions (IF, AND, OR, NOT)
---- Lookup and Reference (VLookup, INDEX, MATCH etc)
---- Pivot Table, Filters, Slicers
3- Learn BI Tools:
---- Data Integration and ETL (Extract, Transform, Load)
---- Report Generation
---- Data Exploration and Ad-hoc Analysis
---- Dashboard Creation
4- Learn Python (Pandas) Optional:
---- Data Structures, Data Cleaning and Preparation
---- Data Manipulation
---- Merging and Joining Data (Merging and joining DataFrames -similar to SQL joins)
---- Data Visualization (Basic plotting using Matplotlib and Seaborn)
Hope this helps you 😊
👍4❤1
Free Access to our premium Data Science Channel
👇👇
https://whatsapp.com/channel/0029Va4QUHa6rsQjhITHK82y
Amazing premium resources only for my subscribers
🎁 Free Data Science Courses
🎁 Machine Learning Notes
🎁 Python Free Learning Resources
🎁 Learn AI with ChatGPT
🎁 Build Chatbots using LLM
🎁 Learn Generative AI
🎁 Free Coding Certified Courses
Join fast ❤️
ENJOY LEARNING 👍👍
👇👇
https://whatsapp.com/channel/0029Va4QUHa6rsQjhITHK82y
Amazing premium resources only for my subscribers
🎁 Free Data Science Courses
🎁 Machine Learning Notes
🎁 Python Free Learning Resources
🎁 Learn AI with ChatGPT
🎁 Build Chatbots using LLM
🎁 Learn Generative AI
🎁 Free Coding Certified Courses
Join fast ❤️
ENJOY LEARNING 👍👍
❤4
Excel Formulas every data analyst should know
❤6
📊 Core Data Analyst Interview Topics You Should Know ✅
1️⃣ Excel/Spreadsheet Skills
⦁ VLOOKUP, INDEX-MATCH, XLOOKUP (newer Excel fave)
⦁ Pivot Tables for summarizing data
⦁ Conditional Formatting to highlight trends
⦁ Data Cleaning & Validation with formulas like IFERROR
2️⃣ SQL & Databases
⦁ SELECT, JOINs (INNER, LEFT, RIGHT, FULL)
⦁ GROUP BY, HAVING, ORDER BY for aggregations
⦁ Subqueries & Window Functions (ROW_NUMBER, LAG)
⦁ CTEs for cleaner, reusable queries
3️⃣ Data Visualization
⦁ Tools: Power BI, Tableau, Excel, Google Data Studio
⦁ Best practices: Choose charts wisely (bar for comparisons, line for trends)
⦁ Dashboards & Interactivity with slicers/drill-downs
⦁ Storytelling with Data to make insights pop
4️⃣ Statistics & Probability
⦁ Mean, Median, Mode, Standard Deviation for summaries
⦁ Correlation vs. Causation (correlation doesn't imply cause!)
⦁ Hypothesis Testing (t-test, p-value for significance)
⦁ Confidence Intervals to gauge reliability
5️⃣ Python for Data Analysis
⦁ Libraries: Pandas for dataframes, NumPy for arrays, Matplotlib/Seaborn for plots
⦁ Data wrangling & cleaning (handling nulls, merging)
⦁ Basic EDA: Describe stats, visualizations, correlations
6️⃣ Business Understanding
⦁ KPI identification (e.g., conversion rate, churn)
⦁ Funnel analysis for drop-offs
⦁ A/B Testing basics to validate changes
⦁ Decision-making support with actionable recommendations
7️⃣ Problem Solving & Case Studies
⦁ Product metrics (DAU/MAU, retention)
⦁ Customer segmentation (RFM analysis)
⦁ Market trend analysis with time-series
8️⃣ ETL Concepts
⦁ Extract from sources, Transform (clean/aggregate), Load to warehouses
⦁ Data pipeline basics using tools like Airflow or dbt
9️⃣ Data Cleaning Techniques
⦁ Handling missing values (impute or drop)
⦁ Duplicates, outliers detection/removal
⦁ Data formatting (standardize dates, text)
🔟 Soft Skills & Communication
⦁ Explaining insights to non-technical stakeholders simply
⦁ Clear visualization storytelling (avoid clutter)
⦁ Collaborating with cross-functional teams for context
💬 Tap ❤️ for more!
1️⃣ Excel/Spreadsheet Skills
⦁ VLOOKUP, INDEX-MATCH, XLOOKUP (newer Excel fave)
⦁ Pivot Tables for summarizing data
⦁ Conditional Formatting to highlight trends
⦁ Data Cleaning & Validation with formulas like IFERROR
2️⃣ SQL & Databases
⦁ SELECT, JOINs (INNER, LEFT, RIGHT, FULL)
⦁ GROUP BY, HAVING, ORDER BY for aggregations
⦁ Subqueries & Window Functions (ROW_NUMBER, LAG)
⦁ CTEs for cleaner, reusable queries
3️⃣ Data Visualization
⦁ Tools: Power BI, Tableau, Excel, Google Data Studio
⦁ Best practices: Choose charts wisely (bar for comparisons, line for trends)
⦁ Dashboards & Interactivity with slicers/drill-downs
⦁ Storytelling with Data to make insights pop
4️⃣ Statistics & Probability
⦁ Mean, Median, Mode, Standard Deviation for summaries
⦁ Correlation vs. Causation (correlation doesn't imply cause!)
⦁ Hypothesis Testing (t-test, p-value for significance)
⦁ Confidence Intervals to gauge reliability
5️⃣ Python for Data Analysis
⦁ Libraries: Pandas for dataframes, NumPy for arrays, Matplotlib/Seaborn for plots
⦁ Data wrangling & cleaning (handling nulls, merging)
⦁ Basic EDA: Describe stats, visualizations, correlations
6️⃣ Business Understanding
⦁ KPI identification (e.g., conversion rate, churn)
⦁ Funnel analysis for drop-offs
⦁ A/B Testing basics to validate changes
⦁ Decision-making support with actionable recommendations
7️⃣ Problem Solving & Case Studies
⦁ Product metrics (DAU/MAU, retention)
⦁ Customer segmentation (RFM analysis)
⦁ Market trend analysis with time-series
8️⃣ ETL Concepts
⦁ Extract from sources, Transform (clean/aggregate), Load to warehouses
⦁ Data pipeline basics using tools like Airflow or dbt
9️⃣ Data Cleaning Techniques
⦁ Handling missing values (impute or drop)
⦁ Duplicates, outliers detection/removal
⦁ Data formatting (standardize dates, text)
🔟 Soft Skills & Communication
⦁ Explaining insights to non-technical stakeholders simply
⦁ Clear visualization storytelling (avoid clutter)
⦁ Collaborating with cross-functional teams for context
💬 Tap ❤️ for more!
❤5