Finding entries which have no foreign key mapping in any other table
This can be accomplished with a NOT EXISTS () clause in your WHERE clause.

SELECT id
FROM A
WHERE NOT EXISTS (
SELECT id
FROM B
WHERE A.ID = B.A_id
)
AND NOT EXISTS (
SELECT id
FROM C
WHERE A.ID = C.A_id)
...
...


You could generate this query programmatically by querying the schema for tables that have a foreign key on A.id, and then iterating over them to create the WHERE clause...