Salesforce Decode
Salesforcedecode
SOQL & Data ModelingBeginnerCode Reviewbulkificationgovernor-limitssoql

Why should you never put SOQL inside a loop, and how do you fix it?

Scenario

Code loops over trigger.new and queries the Account for each Contact.

Answer it out loud first

Serious prep means attempting before reading. Take two minutes to structure your answer, then compare.