In PostgreSQL 18, table emp has 3 rows with dept_id values 10, 20 and NULL, and table dept has 2 rows: (id 10, region 'north') and (id 20, region 'south'). How many rows does SELECT * FROM emp e LEFT JOIN dept d ON d.id = e.dept_id AND d.region = 'north'; return?
Explanation
Moving the same condition into ON makes it part of the match test rather than a filter on the result, so the two emp rows that no longer match are still emitted with null dept columns, alongside the one that matches. Answering 1 assumes ON and WHERE are interchangeable, which holds only for inner joins.