SQL Practice Logo

SQLPractice Online

MySQL String & Math Functions: Overview

Module: Database-Specific Features

Master String Functions: CONCAT() joins strings, SUBSTRING() extracts, REPLACE() substitutes, UPPER()/LOWER() case conversion, LENGTH() gets length

Learn Math Functions: ROUND() rounds decimals, CEIL()/FLOOR() round up/down, ABS() absolute value, MOD() modulo, POWER() exponentiation

Understand Date Functions: DATE_FORMAT() formats dates, DATE_ADD()/DATE_SUB() add/subtract intervals, DATEDIFF() calculates difference, NOW() current timestamp

Master Aggregate Functions: COUNT(), SUM(), AVG(), MIN(), MAX() with GROUP BY, HAVING for filtering groups

Learn Performance Impact: Functions in WHERE prevent index usage, use range comparisons instead, functions in SELECT are fine

Understand NULL Handling: COALESCE() returns first non-NULL, IFNULL() replaces NULL, NULLIF() returns NULL if equal

Master String Functions: CONCAT() joins strings, SUBSTRING() extracts, REPLACE() substitutes, UPPER()/LOWER() case conversion, LENGTH() gets length

Learn Math Functions: ROUND() rounds decimals, CEIL()/FLOOR() round up/down, ABS() absolute value, MOD() modulo, POWER() exponentiation

Understand Date Functions: DATE_FORMAT() formats dates, DATE_ADD()/DATE_SUB() add/subtract intervals, DATEDIFF() calculates difference, NOW() current timestamp

Master Aggregate Functions: COUNT(), SUM(), AVG(), MIN(), MAX() with GROUP BY, HAVING for filtering groups

Learn Performance Impact: Functions in WHERE prevent index usage, use range comparisons instead, functions in SELECT are fine

Understand NULL Handling: COALESCE() returns first non-NULL, IFNULL() replaces NULL, NULLIF() returns NULL if equal