SELECT child_table.* FROM child_table LEFT JOIN parent_table ON parent_table.referenced_column = child_table.referencing_column WHERE parent_table.referenced_column IS NULL -- Delete all data from output of that query