Pattern
A histogram in SQL
Count values per bin of a fixed width, keeping the empty bins.
The patterns, pitfalls and keywords of SQL and analytics engineering, each with the exercises that practise it.
COUNT(column) skips NULLs; COUNT(*) counts rows.7 / 93 is 0 when both sides are integers.NOT IN returns no rows at all.WHERE NOT is_deleted also drops the rows where the flag is NULL.GROUP BY.quantity * unit_price of the order lines, cancelled orders excluded.