B · Query · intermediate · Week 2 · Chapter 4 of 8
SQL lite for truth-seeking
SELECT, WHERE, GROUP BY, COUNT, averages. Enough to verify a dashboard number once.
Path progress
50%
Step 1 of 1
Reproduce a number
Reproduce a numberDrag stickies · tap for tips
Example
SELECT date_trunc('day', created_at) AS day,
COUNT(*) FILTER (WHERE status = 'error') AS errors,
COUNT(*) AS total
FROM events
WHERE created_at >= now() - interval '7 days'
GROUP BY 1
ORDER BY 1;
Do this now
Match (or explain mismatch of) one dashboard figure with a query or export.