List<Contact> cont = new List<Contact>();
Map<String, inscor__Customer_Quote__c> cqMap = new Map<String, inscor__Customer_Quote__c>();
for (inscor__Customer_Quote__c cq : [SELECT Id, inscor__Contact__c FROM inscor__Customer_Quote__c]) {
cqMap.put(cq.inscor__Contact__c, cq);
}
for (Contact c : [SELECT Id FROM Contact WHERE inscor__External_Reference_ID__c = null]) {
if (!cqMap.containsKey(c.Id)) {
cont.add(c);
}
}
delete cont;