Functions & transformation — flashcards
One card per lesson — 4 in this module. Recall the key points, then check. 4 cards. Click a card to flip, or use the arrow keys and space bar.
String functions — what are the key points?
CONCAT handles nulls more gracefully than || in most dialects · Trailing whitespace silently breaks joins — TRIM on import · A function around a filtered column prevents index use Read the lesson
Numeric functions — what are the key points?
Integer / integer performs integer division in many dialects · Use NULLIF on the denominator to avoid division-by-zero errors · Multiply by 100.0 rather than 100 to force decimal arithmetic Read the lesson
Date and time functions — what are the key points?
Group by a truncated date, not a formatted string, so it sorts correctly · Use half-open ranges for dates, never BETWEEN on timestamps · YEAR(col) = 2024 in WHERE prevents an index seek Read the lesson
COALESCE and NULLIF — what are the key points?
COALESCE returns the first non-null argument and is portable · Any arithmetic with null yields null — wrap nullable columns · NULLIF(x, 0) is the standard division-by-zero guard Read the lesson