Salesforce Best Practices
Do not write SOQL and DML Operations inside loop statements: A common mistake that developers do, is to place queries or DML statements inside a “for loop”. Salesforce has Governor limits that enforce a maximum number of SOQL Statements. Placing queries inside the loop can increase the chances of hitting [...]