Module 3: Functions and expressions
Work with text, numbers and dates inside a query, and turn values into categories with CASE.
- Text functions: Text functions change values per row: UPPER, TRIM, REPLACE, SPLITPART, LEFT/RIGHT; || with NULL gives NULL, CONCAT skips it.
- Numbers and dates: Integer / integer drops the decimals: cast or use 100.0 first; EXTRACT, DATETRUNC, TOCHAR and INTERVAL handle dates.
- CASE, COALESCE and NULLIF: CASE WHEN … THEN … ELSE … END labels rows (first true WHEN wins); COALESCE fills NULLs; x / NULLIF(y, 0) divides safely.
Ends with a 12-question checkpoint (80% passes) and a project: The ops team order sheet.