← All questions
ApexMedium
SOQL inside a loop
A trigger runs this code when 200 Contacts are inserted in a single DML call. What happens?
for (Contact c : Trigger.new) {
Account acct = [SELECT Id, Name FROM Account WHERE Id = :c.AccountId];
c.Description = acct.Name;
}