Sanity Checks
A query that runs is not a query that is right. SQL will happily give you a confident, well-formatted, entirely wrong number, and nothing about the output looks different.
The checks worth running every time:
Does the row count change after a join, and did you expect that?
Does the sum of the groups equal the total?
Are there rows with NULL in the column you filtered on, which the filter silently excluded?
Does an inner join drop rows a left join would keep?
Does the number change if you write the query a second way?
✦ The most valuable check in SQL
Compute it a second way. It is the same discipline as the APIs & Datasets module, and it is even more valuable here, because a join silently multiplying or dropping rows produces a plausible number rather than an error.
Mark this lesson complete
Signed in, your progress follows you to every device.