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
๐Ÿ”Ÿ How would you find duplicate records in SQL?

Sample Answer:

"I would first identify the column or combination of columns that should uniquely identify a record. Then I would use GROUP BY and HAVING COUNT(*) > 1."

SELECT Customer_ID, COUNT(*) AS Count_Records
FROM Customers
GROUP BY Customer_ID
HAVING COUNT(*) > 1;


"This identifies Customer_ID values that appear more than once. I would then investigate whether those records are genuine duplicates before taking any corrective action."

๐Ÿ“Œ Double Tap โค๏ธ For Part-3
โค16
๐Ÿ“Š Data Analyst Interview Series โ€” Part 3

Guys, let's continue our Data Analyst Interview Series.

Today, let's cover 10 important SQL interview questions that test your practical SQL knowledge. ๐Ÿ‘‡

1๏ธโƒฃ What is a subquery in SQL?

Sample Answer:

โ€œA subquery is a query written inside another SQL query. It can be used to retrieve intermediate results that are then used by the outer query.

For example, to find employees whose salary is greater than the average salary:โ€

SELECT Employee_ID, Salary
FROM Employees
WHERE Salary > (
SELECT AVG(Salary)
FROM Employees
);


2๏ธโƒฃ What is a CTE?

Sample Answer:

โ€œCTE stands for Common Table Expression. It allows us to define a temporary named result set using the WITH clause, which can then be referenced within the main query.

CTEs make complex queries easier to read, maintain, and debug.โ€

WITH CustomerSales AS (
SELECT Customer_ID,
SUM(Sales) AS Total_Sales
FROM Sales
GROUP BY Customer_ID
)
SELECT *
FROM CustomerSales
WHERE Total_Sales > 100000;


3๏ธโƒฃ What is a window function?

Sample Answer:

โ€œA window function performs a calculation across a set of related rows while still retaining the individual rows in the result.

Unlike GROUP BY, it does not collapse multiple rows into a single row.

Common window functions include ROW_NUMBER(), RANK(), DENSE_RANK(), LAG(), and LEAD().โ€

4๏ธโƒฃ What is the difference between RANK(), DENSE_RANK(), and ROW_NUMBER()?

Sample Answer:

โ€œROW_NUMBER() assigns a unique sequential number to every row.

RANK() assigns the same rank to tied values but leaves gaps after a tie.

DENSE_RANK() also assigns the same rank to tied values but does not leave gaps.โ€

Example:

Values: 100, 100, 90

ROW_NUMBER: 1, 2, 3

RANK: 1, 1, 3

DENSE_RANK: 1, 1, 2

5๏ธโƒฃ How would you find the second-highest salary?

Sample Answer:

โ€œOne approach is to use DENSE_RANK(). This also handles duplicate salaries correctly.โ€

WITH RankedEmployees AS (
SELECT Employee_ID,
Salary,
DENSE_RANK() OVER (ORDER BY Salary DESC) AS Salary_Rank
FROM Employees
)
SELECT Employee_ID, Salary
FROM RankedEmployees
WHERE Salary_Rank = 2;


6๏ธโƒฃ How would you find the top 3 salaries in each department?

Sample Answer:

โ€œI would use a window function to rank employees within each department.โ€

WITH RankedEmployees AS (
SELECT Employee_ID,
Department,
Salary,
DENSE_RANK() OVER (
PARTITION BY Department
ORDER BY Salary DESC
) AS Salary_Rank
FROM Employees
)
SELECT *
FROM RankedEmployees
WHERE Salary_Rank <= 3;


โ€œThe PARTITION BY ensures that ranking starts separately for each department.โ€

7๏ธโƒฃ What is PARTITION BY in SQL?

Sample Answer:

โ€œPARTITION BY divides the result set into groups for a window function without collapsing the rows.

For example, if I want to rank employees separately within each department, I can use PARTITION BY Department.โ€

SELECT Employee_ID,
Department,
Salary,
RANK() OVER (
PARTITION BY Department
ORDER BY Salary DESC
) AS Salary_Rank
FROM Employees;


8๏ธโƒฃ What are LAG() and LEAD() functions?

Sample Answer:

โ€œLAG() allows me to access a value from a previous row, while LEAD() allows me to access a value from a following row.

They are particularly useful for comparing current values with previous or future values, such as month-over-month sales.โ€

SELECT Month,
Sales,
LAG(Sales) OVER (ORDER BY Month) AS Previous_Month_Sales
FROM Monthly_Sales;
โค4๐Ÿ‘1
9๏ธโƒฃ How would you calculate month-over-month growth?

Sample Answer:

โ€œI would first retrieve the previous month's sales using LAG(), then calculate the percentage change between the current month and previous month.โ€

SELECT Month,
Sales,
LAG(Sales) OVER (ORDER BY Month) AS Previous_Sales,
(Sales - LAG(Sales) OVER (ORDER BY Month))
* 100.0 /
LAG(Sales) OVER (ORDER BY Month) AS MoM_Growth
FROM Monthly_Sales;


โ€œI would also handle cases where the previous month's value is zero or NULL to avoid incorrect calculations.โ€

๐Ÿ”Ÿ What is the difference between DELETE, TRUNCATE, and DROP?

Sample Answer:

โ€œDELETE removes selected rows from a table and can be used with a WHERE condition.

TRUNCATE removes all rows from a table while keeping the table structure.

DROP removes the entire table, including its structure and data.

So, the key difference is whether I'm removing specific records, all records, or the entire table itself.โ€

๐Ÿ“Œ Double Tap โค๏ธ For Part-4
โค19
๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ ๐—•๐—œ ๐—ณ๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜! ๐Ÿ”ฅ

Learn Power BI through these FREE learning resources
โ€‹
โœจ What You'll Learn:
๐Ÿ“Š Interactive Dashboards
๐Ÿ“ˆ Data Visualization
๐Ÿงน Data Transformation
๐Ÿ’ผ Real-World Reporting Skills
๐ŸŽฏ Beginner-Friendly โ€” No Coding Required

๐—ฆ๐˜๐—ฎ๐—ฟ๐˜ ๐—Ÿ๐—ฒ๐—ฎ๐—ฟ๐—ป๐—ถ๐—ป๐—ด ๐—ณ๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜
โ€‹
โ€‹https://pdlink.in/4hznwlu

๐Ÿ’ซPerfect for Students โ€ข Freshers โ€ข Data Analyst Aspirants โ€ข Working Professionals
โค1๐Ÿ‘1
๐Ÿ“Š Data Analyst Interview Series โ€” Part 4

Guys, let's continue our Data Analyst Interview Series.

Today, let's cover 10 practical SQL questions that are commonly asked in Data Analyst interviews. ๐Ÿ‘‡

1๏ธโƒฃ How do you find the highest salary in each department?

Sample Answer:

"I would use a window function such as DENSE_RANK() and partition the data by department."

WITH RankedEmployees AS (
SELECT Employee_ID,
Department,
Salary,
DENSE_RANK() OVER (
PARTITION BY Department
ORDER BY Salary DESC
) AS Salary_Rank
FROM Employees
)
SELECT Employee_ID, Department, Salary
FROM RankedEmployees
WHERE Salary_Rank = 1;


2๏ธโƒฃ How do you find customers who have never placed an order?

Sample Answer:

"I would use a LEFT JOIN between the Customers and Orders tables and then filter for customers where no matching order exists."

SELECT c.Customer_ID,
c.Customer_Name
FROM Customers c
LEFT JOIN Orders o
ON c.Customer_ID = o.Customer_ID
WHERE o.Customer_ID IS NULL;


3๏ธโƒฃ How do you find the total sales for each customer?

Sample Answer:

"I would group the sales data by Customer_ID and use SUM() to calculate the total sales."

SELECT Customer_ID,
SUM(Sales) AS Total_Sales
FROM Orders
GROUP BY Customer_ID;


4๏ธโƒฃ How do you find the top 5 customers by sales?

Sample Answer:

"I would aggregate sales by customer, sort the result in descending order, and then return the top five customers."

SELECT Customer_ID,
SUM(Sales) AS Total_Sales
FROM Orders
GROUP BY Customer_ID
ORDER BY Total_Sales DESC
LIMIT 5;


"The exact syntax for limiting rows can vary depending on the database, such as TOP in SQL Server."

5๏ธโƒฃ How do you calculate the average order value?

Sample Answer:

"Average Order Value can be calculated by dividing total sales by the number of orders. If each row represents one order, AVG() can also be used directly on the order amount."

SELECT AVG(Order_Amount) AS Average_Order_Value
FROM Orders;


6๏ธโƒฃ How would you identify customers who placed more than 5 orders?

Sample Answer:

"I would group the orders by Customer_ID and use HAVING to filter customers whose order count is greater than five."

SELECT Customer_ID,
COUNT(**) AS Order_Count
FROM Orders
GROUP BY Customer_ID
HAVING COUNT(**) > 5;


7๏ธโƒฃ How do you find records from the last 30 days?

Sample Answer:

"I would compare the date column with the current date and subtract 30 days. The exact syntax depends on the database."

For example:

SELECT **
FROM Orders
WHERE Order_Date >= CURRENT_DATE - INTERVAL '30' DAY;


8๏ธโƒฃ How do you find the total sales by month?

Sample Answer:

"I would extract the month from the order date, group the data by month, and calculate the total sales."

SELECT
DATE_TRUNC('month', Order_Date) AS Month,
SUM(Sales) AS Total_Sales
FROM Orders
GROUP BY DATE_TRUNC('month', Order_Date)
ORDER BY Month;


9๏ธโƒฃ How do you find employees whose salary is above their department's average salary?

Sample Answer:

"I would calculate the average salary for each department and compare each employee's salary with that department-level average. A CTE makes this easier to read."

WITH DepartmentAverage AS (
SELECT Department,
AVG(Salary) AS Avg_Salary
FROM Employees
GROUP BY Department
)
SELECT e.Employee_ID,
e.Department,
e.Salary
FROM Employees e
JOIN DepartmentAverage d
ON e.Department = d.Department
WHERE e.Salary > d.Avg_Salary;
๐Ÿ‘3โค1
๐Ÿ”Ÿ What is the difference between UNION and JOIN?

Sample Answer:

"JOIN combines columns from different tables based on a related key.

UNION combines rows from the results of two SELECT statements with compatible column structures.

For example, if I want to combine customer information with order information, I would typically use a JOIN. If I want to append two similar datasets containing the same type of records, I might use UNION."

๐Ÿ“Œ Double Tap โค๏ธ For Part 5
โค7
๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐ๐—ธ ๐——๐—ฒ๐˜ƒ๐—ฒ๐—น๐—ผ๐—ฝ๐—ฒ๐—ฟ ๐—ช๐—œ๐˜๐—ต ๐—š๐—ฒ๐—ป๐—”๐—œ

Start a high-paying tech careerโ€”even without prior coding experience

๐Ÿ† ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—›๐—ถ๐—ด๐—ต๐—น๐—ถ๐—ด๐—ต๐˜๐˜€:
๐Ÿ’ฐ โ‚น41 LPA highest salary
๐Ÿ“ˆ โ‚น7.4 LPA average salary
๐ŸŽ“ 2,000+ students placed
๐Ÿข 500+ hiring partners
โœ… 100% job assistance
๐Ÿ“œ Skill Indiaโ€“authenticated certificate

๐Ÿ”— ๐—”๐—ฝ๐—ฝ๐—น๐˜† ๐—ก๐—ผ๐˜„๐Ÿ‘‡:-

https://pdlink.in/3SuUeuD

๐ŸŽฏ HurryUp.....Limited Seats Available
โค4๐Ÿ‘1
๐Ÿ“Š Data Analyst Interview Series โ€” Part 5

Guys, let's continue our Data Analyst Interview Series.

This time, let's move to one of the most important skills for a Data Analyst: Excel.

Here are 10 Excel interview questions you should know. ๐Ÿ‘‡

1๏ธโƒฃ What is a PivotTable and why is it used?

Sample Answer:

โ€œA PivotTable is an Excel feature used to quickly summarize and analyze large datasets. It allows me to group, filter, and aggregate data without writing complex formulas.

For example, I can use a PivotTable to calculate total sales by region, product, or month and quickly identify business trends.โ€

2๏ธโƒฃ What is the difference between VLOOKUP and XLOOKUP?

Sample Answer:

โ€œVLOOKUP searches for a value in the first column of a selected range and returns a value from another column. It has limitations such as primarily working from left to right.

XLOOKUP is more flexible. It can search in any direction, provides better handling of missing values, and allows separate lookup and return ranges.

For new Excel work, I would generally prefer XLOOKUP when it is available.โ€

3๏ธโƒฃ What is the difference between COUNT, COUNTA, COUNTIF, and COUNTIFS?

Sample Answer:

โ€œCOUNT counts cells containing numbers.

COUNTA counts non-empty cells.

COUNTIF counts cells that meet one condition.

COUNTIFS counts cells that meet multiple conditions.โ€

Example:

=COUNT(A2:A100)

=COUNTA(A2:A100)

=COUNTIF(B2:B100,"Completed")

=COUNTIFS(B2:B100,"Completed",C2:C100,">1000")

4๏ธโƒฃ What is the difference between SUMIF and SUMIFS?

Sample Answer:

โ€œSUMIF is used when I have one condition, while SUMIFS is used when I need to apply multiple conditions.

For example, to calculate sales for the India region:

=SUMIF(A:A,"India",B:B)

To calculate sales for India where the product is Laptop:

=SUMIFS(C:C,A:A,"India",B:B,"Laptop")

5๏ธโƒฃ How do you remove duplicate records in Excel?

Sample Answer:

โ€œI first determine which columns should uniquely identify a record. Then I can use Excel's Remove Duplicates feature to identify and remove duplicate rows.

However, I would not immediately delete duplicates. I would first verify whether they are genuine duplicates or legitimate repeated transactions.โ€

6๏ธโƒฃ How do you handle missing values in Excel?

Sample Answer:

โ€œFirst, I identify how many values are missing and understand why they are missing.

Depending on the situation, I may replace them with an appropriate value, use a formula such as IF or IFERROR, flag them as โ€˜Unknownโ€™, or exclude them if the business requirement allows it.

I would avoid blindly replacing missing values because that can affect the accuracy of the analysis.โ€

7๏ธโƒฃ What is conditional formatting?

Sample Answer:

โ€œConditional formatting automatically changes the appearance of cells based on specified conditions.

For example, I can use it to highlight sales below target, overdue transactions, duplicate values, negative profit, or unusually high values.

It is useful for quickly identifying patterns and exceptions in a dataset.โ€

8๏ธโƒฃ How would you identify the top 10 customers by sales in Excel?

Sample Answer:

โ€œI could use a PivotTable to summarize total sales by customer, sort the values in descending order, and filter the result to the top 10 customers.
๐Ÿ‘2โค1
Alternatively, depending on the Excel version and requirement, I could use functions such as SORT, FILTER, or LARGE.โ€

9๏ธโƒฃ What is the difference between relative and absolute cell references?

Sample Answer:

โ€œA relative reference changes when a formula is copied to another cell.

For example:

=A2**B2

An absolute reference remains fixed when the formula is copied.

For example:

=A2**$B$1

Absolute references are particularly useful when applying a calculation using a fixed assumption, tax rate, exchange rate, or target value.โ€

๐Ÿ”Ÿ How would you clean a large dataset in Excel?

Sample Answer:

โ€œI would first understand the structure and identify data-quality issues.

My process would typically include:

โ€ข Removing or investigating duplicates

โ€ข Handling missing values

โ€ข Standardizing text and date formats

โ€ข Correcting inconsistent values

โ€ข Checking data types

โ€ข Identifying invalid or unusual values

โ€ข Using formulas or Power Query for repeatable transformations

โ€ข Validating the cleaned dataset before analysis

For a large or recurring dataset, I would prefer Power Query rather than manually cleaning the data every time.โ€

Double Tap โค๏ธ For Part-6
โค7๐Ÿ‘1
๐Ÿ“Š Kandinsky 6.0 Video: AI-Powered Content Creation for Analysts

The new Kandinsky 6.0 Video lineup โ€” the flagship Pro and the lightweight Lite โ€” generates videos with synchronized audio in quality up to Full HD: useful for data storytelling and presentations. Open-source under the MIT license.

๐ŸŽฏ Key capabilities for analysts:
โ€ข Create video reports with voiceover narration
โ€ข Animate data visualizations with background music
โ€ข Generate demo clips for stakeholder presentations
โ€ข Produce training videos with synchronized explanations

๐Ÿ“ˆ Technical details:
โ€ข Video + audio generation in one model
โ€ข Lip-sync for spokesperson videos
โ€ข 44 kHz audio quality
โ€ข Realistic physics in animations
โ€ข Up to 5 seconds per clip

๐Ÿ”ง Integration:
Open-source (MIT license). Works with:
โ€ข Diffusers (Python)
โ€ข FastVideo
โ€ข ComfyUI

๐Ÿ“Š Performance:
โ€ข Clearly outperforms the previous version across all criteria (Pro)
โ€ข Pro beats Veo 3.1 Fast in image animation

Anton Frolov, Sber: "For professional content, this means faster and more cost-effective production."

๐Ÿ”— Hugging Face
โค5๐Ÿ‘1
๐ŸŽ“ ๐— ๐—ถ๐—ฐ๐—ฟ๐—ผ๐˜€๐—ผ๐—ณ๐˜ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐˜„๐—ถ๐˜๐—ต ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ฒ๐˜€! ๐Ÿš€๐Ÿ”ฅ

Upgrade your resume with Microsoft learning opportunities. Explore courses covering some of today's most in-demand tech skills!

๐ŸŽฏ Perfect for Students โ€ข Freshers โ€ข Job Seekers โ€ข Working Professionals

โœ… Learn at your own pace โœ… Build career-relevant skills โœ… Explore available certificates and credentials

๐Ÿ”— ๐—”๐—ฐ๐—ฐ๐—ฒ๐˜€๐˜€ ๐— ๐—ถ๐—ฐ๐—ฟ๐—ผ๐˜€๐—ผ๐—ณ๐˜ ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐—›๐—ฒ๐—ฟ๐—ฒ ๐Ÿ‘‡

https://pdlink.in/3Uf5trR

๐Ÿ”ฅ Share with friends looking to upskill in 2026!
โค1