DELETE FROM NODE WHERE KEY_CHILD NOT IN (SELECT ID_INTERNAL FROM CONTENT);
DELETE FROM NODE WHERE KEY_PARENT NOT IN (SELECT ID_INTERNAL FROM CONTENT);