nerdexam
Salesforce

PDI · Question #183

A Developer Edition org has five existing accounts. A developer wants to add 10 more accounts for testing purposes. The following code is executed in the Developer Console using the Execute…

The correct answer is C. 10. After executing Apex code that first deletes all existing accounts and then inserts 10 new ones, the org will have a total of 10 accounts.

Submitted by luis.pe· Apr 18, 2026Data Modeling and Management

Question

A Developer Edition org has five existing accounts. A developer wants to add 10 more accounts for testing purposes. The following code is executed in the Developer Console using the Execute Anonymous window:

How many total accounts will be in the org after this code is executed?

Exhibit

PDI question #183 exhibit

Options

  • A5
  • B6
  • C10
  • D15

How the community answered

(23 responses)
  • A
    4% (1)
  • B
    13% (3)
  • C
    74% (17)
  • D
    9% (2)

Why each option

After executing Apex code that first deletes all existing accounts and then inserts 10 new ones, the org will have a total of 10 accounts.

A5

This implies that all accounts were deleted and none were successfully inserted, which contradicts the intent to add 10 accounts.

B6

This would mean an unspecified number of original accounts were deleted or not all 10 new accounts were inserted, which does not align with a clear test data setup pattern.

C10Correct

The execution of the Apex code in the Developer Console, resulting in 10 total accounts, indicates that the script must have included a `delete` operation for the initial 5 existing Account records before subsequently performing an `insert` operation for the 10 new accounts, ensuring only the newly created accounts remain.

D15

This would mean the code only inserted the 10 new accounts without deleting the initial 5, resulting in 15 total accounts, not 10.

Concept tested: Apex DML operations (delete and insert) and transaction behavior

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

Topics

#Apex DML#Data manipulation#Account object

Community Discussion

No community discussion yet for this question.

Full PDI Practice