SQL data engineering interview problem. Difficulty: advanced. Pattern: Aggregation. About 18 minutes. Part of the Pro drill bank.
Return one row with median_salary: the median of non-null employees.salary. Use MEDIAN(salary) or an equivalent percentile approach.
Input: employees (non-null salaries) salary | 95000 | 95000 | 105000 | 110000 | 120000 | Output: median_salary | 105000.0 | Why this passes: MEDIAN ignores NULL and returns the middle value of the five ordered non-null salaries.
Topics: lakebench, sql, median, percentile.
More SQL interview questions · All interview problems · Learn data engineering
Interview-style drill: Median of non-null salaries.
Return one row with `median_salary`: the median of non-null `employees.salary`. Use MEDIAN(salary) or an equivalent percentile approach.