AlgoMaster Logo

Scalar Functions: Strings, Numbers, Dates

Last Updated: May 3, 2026

10 min read

So far, every query has returned column values exactly as they're stored. But stored data is rarely in the format you need. Artist names have trailing whitespace. Track durations are raw seconds instead of a readable "3:45" format. Calculated amounts come out with ten decimal places.

Scalar functions transform individual values within each row, letting you clean, format, and convert data as part of a query.

Premium Content

Subscribe to unlock full access to this content and more premium articles.