Problem · Database
Null Counts by Column
Problem statement
You are given a Pandas dataframe named records with columns record_id, name, email, and score.
Return a dataframe containing the number of null values in each input column. The result must have columns column_name and null_count, include every input column even when its count is zero, and follow the input schema order shown above.
Table schema
Pandas
Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.
records
| Column | Type | Nullable | Description |
|---|---|---|---|
| record_id | Integer | Yes | — |
| name | Text | Yes | — |
| Text | Yes | — | |
| score | Decimal | Yes | — |
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| column_name | Text | No | — |
| null_count | Integer | No | — |
Row order: must match exactly. Numeric tolerance: 0.
Constraints
recordscontains at most10^5rows.- All four input columns are nullable.
- A null is any value recognized as missing by Pandas
isna().