Условие
Какой запрос вернёт самое большое число?
Для справки: (A RIGHT JOIN B) эквивалентно (B LEFT JOIN A).
-- a)
SELECT count(distinct first.counter_column)
FROM first
LEFT JOIN second
ON first.join_key = second.join_key
WHERE second.filter_column >= 5
-- b)
SELECT count(distinct first.counter_column)
FROM first
LEFT JOIN second
ON first.join_key = second.join_key
AND second.filter_column >= 5
-- c)
SELECT count(distinct first.counter_column)
FROM first
RIGHT JOIN second
ON first.join_key = second.join_key
WHERE second.filter_column >= 5
-- d)
SELECT count(distinct first.counter_column)
FROM first
RIGHT JOIN second
ON first.join_key = second.join_key
AND second.filter_column >= 5