Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Coalesce null salaries to zero

SQL data engineering interview problem. Difficulty: beginner. Pattern: Missing Data. About 8 minutes. Free to practice.

For every employee, return name and salary where NULL salary becomes 0 via COALESCE. Order by name.

Constraints

  • Every employee row must appear exactly once.
  • Return exactly these columns: name, salary.

Examples

Input: employees name | salary Alice Chen | 120000 Max Reed | NULL Omar Ali | 105000 Output: name | salary Alice Chen | 120000 Max Reed | 0 Omar Ali | 105000 Why this passes: COALESCE replaces NULL with 0 without dropping the row.

Topics: lakebench, sql, coalesce, null.

More SQL interview questions · All interview problems · Learn data engineering

beginner

Coalesce null salaries to zero

Interview-style drill: Return each employee name with salary defaulted to 0 when NULL.

For every employee, return `name` and `salary` where NULL salary becomes 0 via COALESCE. Order by `name`.