nerdexam
Salesforce

PDI · Question #196

How many Accounts will be inserted by the following block of code?

The correct answer is C. 0. The code attempts to insert accounts, but the DML operation results in 0 records being successfully inserted, likely due to an uninitialized list, an empty list, or a transaction-rolling-back DML exception.

Submitted by marco_it· Apr 18, 2026Data Modeling and Management

Question

How many Accounts will be inserted by the following block of code?

Exhibit

PDI question #196 exhibit

Options

  • A100
  • B150
  • C0
  • D500

How the community answered

(53 responses)
  • A
    2% (1)
  • B
    2% (1)
  • C
    91% (48)
  • D
    6% (3)

Why each option

The code attempts to insert accounts, but the DML operation results in 0 records being successfully inserted, likely due to an uninitialized list, an empty list, or a transaction-rolling-back DML exception.

A100

This option implies a successful insertion of 100 accounts, which would not happen if the DML operation failed or was performed on an empty list.

B150

This option implies a successful insertion of 150 accounts, which would not happen if the DML operation failed or was performed on an empty list.

C0Correct

Without the specific code, assuming a common scenario where a DML operation fails entirely due to a governor limit exception (e.g., too many SOQL queries or DML statements causing a rollback) or if the list intended for insertion is uninitialized (null) or empty, no accounts would be successfully inserted into the database.

D500

This option implies a successful insertion of 500 accounts, which would not happen if the DML operation failed or was performed on an empty list.

Concept tested: Apex DML operations and governor limits

Source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dm_insert.htm

Topics

#Apex DML#List Operations#Data Insertion#Database Operations

Community Discussion

No community discussion yet for this question.

Full PDI Practice