I have two tables, one has primary key other has it as a foreign key.
I want to pull data from the primary table, only if the secondary table does not
use a "not exists" left join:
SELECT p.* FROM primary_table p LEFT JOIN second s ON p.ID = s.ID WHERE s.ID IS NULL