SQL data engineering interview problem. Difficulty: beginner. Pattern: Aggregation. About 8 minutes. Free to practice.
From employees, return a single row with: employee_count: COUNT(*) avg_salary: ROUND(AVG(salary), 2) min_salary: MIN(salary) max_salary: MAX(salary) AVG/MIN/MAX ignore NULL salaries.
Input: employees name | salary Alice Chen | 120000 Bob Kumar | 95000 Dan Park | 110000 Eve Ng | 95000 Omar Ali | 105000 Max Reed | NULL Output: employee_count | avg_salary | min_salary | max_salary 6 | 105000.0 | 95000 | 120000 Why this passes: COUNT(*) includes the NULL-salary row. AVG/MIN/MAX skip NULL over the five paid salaries.
Topics: lakebench, sql, agg, avg.
More SQL interview questions · All interview problems · Learn data engineering
Interview-style drill: Return count, average, min, and max salary across all employees.
From `employees`, return a single row with: - `employee_count`: COUNT(*) - `avg_salary`: ROUND(AVG(salary), 2) - `min_salary`: MIN(salary) - `max_salary`: MAX(salary) AVG/MIN/MAX ignore NULL salaries.