The following Apex DML statements are available:
Insert
Update
Upsert
Delete
Undelete
Merge
Insert
Update
Upsert
Delete
Undelete
Merge
Salesforce allows only 150 DML statements for each Apex transaction. So its better to check the list against null or empty before performing DML operations.
Example-
Account a = new Account(Name='Acme2');
insert(a);
Account myAcct = [SELECT Id, Name, BillingCity FROM Account WHERE Id = :a.Id];
myAcct.BillingCity = 'San Francisco';
try {
if(!myAcct.Empty()) { //Here if myAcct list is empty, you will save 1 DML operation.
update myAcct;
}
} catch (DmlException e) {
// Process exception here
}