Q1
Why does SELECT COUNT(*) return a higher number than SELECT COUNT(discount) after a LEFT JOIN, and when does putting a filter on the right table silently convert it into an INNER JOIN?
COUNT(*) counts every row including NULL right-side matches, whereas COUNT(col) ignores NULLs. Furthermore, placing WHERE right.status = 'Active' filters out unmatched NULL rows—silently turning your LEFT JOIN into an INNER JOIN. Move right-table conditions inside the ON clause instead.
Q2
What is the trap when comparing RANK(), DENSE_RANK(), and ROW_NUMBER() on tied revenue figures inside executive KPI dashboards?
If two regions tie at #2: ROW_NUMBER() arbitrarily assigns 2 and 3, RANK() assigns both 2 and skips to 4, while DENSE_RANK() assigns both 2 and next 3. Choosing the wrong function causes top-N filters (<= 3) to drop or skip tied business leaders.
Q3
Why can AVERAGE of monthly averages give a completely wrong annual KPI in Excel or SQL (Simpson's Paradox / unweighted mean trap)?
Averaging pre-computed percentages or monthly averages ignores sample sizes—giving a quiet 10-order month the same weight as a 10,000-order festive month. Always compute SUM(revenue) / SUM(orders) across raw granularity.
Q4
In Excel, why does VLOOKUP break silently when columns are inserted—and how can XLOOKUP's binary search mode (search_mode = 2) fail silently if data isn't sorted?
VLOOKUP hardcodes column index integers (3), returning wrong columns when tables change. While XLOOKUP solves column shifts, enabling binary search on unsorted keys skips valid rows and returns wrong matches.
Q5
Why does df['col'] = df['col'].fillna(...) or chained indexing df[df.a > 0]['b'] = 1 trigger Pandas SettingWithCopyWarning and silently drop edits?
Chained brackets first slice a temporary copy or view unpredictably, writing edits into garbage memory instead of the original DataFrame. Always use .loc[row_mask, col_name] = value in one step.
Q6
How do you diagnose why a Power BI dashboard visual looks different from your SQL query totals?
Check for implicit many-to-many or bi-directional relationships causing duplicate row counting, hidden report/page filters, non-matching date granularities, or DISTINCTCOUNT vs COUNT mismatches.
Q7
When cleaning messy CSV datasets, why can mean imputation distort skewed salary or house-price metrics?
Outliers pull the arithmetic mean far above typical values, biasing downstream dashboards and regressions. Inspect distribution skewness and prefer median imputation or domain-segmented grouping.
Q8
Why does grouping by MONTH(order_date) instead of DATE_TRUNC('month', order_date) corrupt multi-year trend charts?
MONTH(order_date) merges Jan 2024, Jan 2025, and Jan 2026 into a single 'January' bucket! Always truncate or format with year (YYYY-MM) before aggregating multi-year time series.
Q9
What is data leakage during an analytics churn retrospective—and why do post-event timestamps break insights?
Including fields populated *after* churn occurred (e.g. cancellation_reason, refund_processed_date) falsely predicts 99% accuracy while holding zero value for proactive retention ahead of churn.
Q10
Why should Power Query transformations happen as far upstream as possible (Query Folding)?
When Power Query folds steps (Filter, Group By, Remove Columns) back into native SQL on the database server, Power BI downloads tiny aggregated results instead of dragging millions of raw rows across RAM.