Common Mistakes

0001-01-01

The JOIN That Silently Loses Rows

The most common AI SQL mistake: a LEFT JOIN paired with a WHERE clause that filters on the right-side table, silently turning an outer join into an inner join and dropping the rows you asked for.

0001-01-01

COUNT(*) After a JOIN Counts Rows, Not Things

After a JOIN, COUNT(*) counts the rows in the intermediate result — which is not the same as counting the distinct entities you care about. The wrong number is plausible, which makes it dangerous.