Recently Asked Data Analyst interview questions-2
Recently Asked Data Analyst interview questions-2
SQL
Answer: To find duplicate rows in a table, we use the GROUP BY clause and the HAVING
keyword:
FROM table_name
This query groups the data by relevant columns and filters those with a count greater than
one, indicating duplicates.
2. How would you perform a left join and filter out nulls in SQL?
Answer: A LEFT JOIN retains all records from the left table and matches records from the
right table. To remove nulls from the right table, use a WHERE clause:
FROM table1 a
3. What is a window function in SQL, and how do you use it for ranking data?
Answer: Window functions perform calculations across a subset of rows related to the
current row without collapsing data. The RANK() function assigns ranks based on a
specified column:
SELECT id, name, salary, RANK() OVER (PARTITION BY department ORDER BY salary DESC)
AS rank
FROM employees;
This ranks employees within each department based on salary.
Python
1. How do you import a CSV file into a pandas DataFrame and handle missing
data?
3. What are the differences between the apply() and map() functions in pandas?
Df[‘column’] = df[‘column’].map(lambda x: x * 2)
Df[‘column’] = df[‘column’].apply(lambda x: x * 2)
Excel
1. How would you use VLOOKUP or XLOOKUP to merge data between two Excel
sheets?
Answer: VLOOKUP searches for a value in the first column and returns a value from a
specified column:
2. What is the difference between absolute and relative cell references, and when
would you use each?
Answer: Relative references (A1) adjust dynamically when copied across cells.
Use absolute references for fixed lookup values and relative references for formulas that
need to adjust dynamically.
3. How do you create a pivot table and analyze data with it?
1. Select data → Insert → PivotTable.
2. Drag fields into Rows, Columns, Values, and Filters sections.
3. Use “Value Field Settings” to calculate SUM, COUNT, or AVERAGE.
Power BI
1. How would you create and customize a calculated column in Power BI?
Calculated columns store results in the data model and update when refreshed.
2. What is the difference between a slicer and a filter in Power BI, and when would
you use each?
Answer: Slicers are visual elements that allow users to interactively filter data on a report.
Filters are applied at the report, page, or visual level in the “Filter Pane.”
Use slicers for interactive dashboards and filters for static data refinement.
3. How do you create relationships between tables in Power BI, and how do they
impact your data model?
Answer :