ApexSensei

Apex governor limits

Apex stops a transaction that runs too many queries, too many saves, too many rows, or too much CPU. The table lists those four synchronous limits.

LimitCapWhat it means
SOQL queries100A synchronous transaction can run 100 SOQL queries, so a query inside a loop spends one of them per pass.
DML statements150A synchronous transaction can run 150 DML statements, and one update of a whole list still counts as one statement.
Query rows50,000SOQL in one transaction can return 50,000 rows in total, across every query, not per query.
CPU time10 secondsSynchronous Apex gets 10 seconds of CPU time, which loops over large lists can spend before the work finishes.

Practice bulk DML on Bulk update once