Problems / Clamp Percent Scores / Editorial
LEAST(GREATEST(x, lo), hi)
GREATEST
LEAST
clamp(x, 0, 100)
clip
raw_pct < 0 OR raw_pct > 100
raw <> clamped
GREATEST/LEAST are the horizontal min/max — across expressions within one row — while MIN/MAX are vertical, across rows. SQL splitting these into different function families trips up almost everyone once. The other habit this problem models: when cleaning data, *keep the evidence* — emitting was_clamped alongside the fix turns silent mutation into an auditable transformation, which is what separates cleaning from corrupting.
MIN
MAX
was_clamped
Solve Clamp Percent Scores yourself →