Wybierz z 3 tabel jeden jest pusty

Replacing "JOIN", which implies "INNER JOIN", by "LEFT JOIN" should do the trick.

Blue-eyed Beaver