Aggregate functions ignore NULLs: AVG averages only the values present, COUNT(column) counts only the non-nulls, whereas COUNT(*) counts all rows. SUM or AVG on a set containing only NULLs return NULL. COALESCE lets you replace a NULL with a fallback value.
Example
SELECT COALESCE(SUM(montant), 0) FROM paiements;