PD1 Data Modeling and Management 2 — Questions and Answers
Question 1: A developer needs a field that auto-increments with each new record and cannot be edited after creation. Which field type should they use?
- Auto Number (Correct answer)
- Formula
- Autonumber (read-only)
- Roll-Up Summary
Correct answer: Auto Number
The Auto Number field type generates a sequential, read-only number for each new record automatically.
Question 2: Which relationship type in Salesforce creates a dependent record where the child is deleted when the parent is deleted?
- Lookup
- Master-Detail (Correct answer)
- Many-to-Many
- Hierarchical
Correct answer: Master-Detail
Master-Detail relationships enforce cascading deletes — deleting the parent record also deletes all related child records.
Question 3: A junction object in Salesforce is used to implement which type of data relationship?
- One-to-One
- One-to-Many
- Many-to-Many (Correct answer)
- Hierarchical
Correct answer: Many-to-Many
A junction object with two Master-Detail relationships to other objects implements a Many-to-Many relationship.
Question 4: What is the maximum number of Master-Detail relationships an object can have?
- 1
- 2 (Correct answer)
- 3
- 5
Correct answer: 2
An object can have a maximum of 2 Master-Detail relationships in Salesforce.
Question 5: Which of the following is TRUE about Roll-Up Summary fields?
- They can be created on Lookup relationship child objects
- They calculate values from child records in a Master-Detail relationship (Correct answer)
- They support all field types including text
- They can roll up data from records two levels up
Correct answer: They calculate values from child records in a Master-Detail relationship
Roll-Up Summary fields aggregate child record data (COUNT, SUM, MIN, MAX) and can only be placed on the master object of a Master-Detail relationship.
Question 6: A developer wants to store a field value calculated from other fields on the same record without consuming storage. Which field type is best?
- Text
- Number
- Formula (Correct answer)
- Percent
Correct answer: Formula
Formula fields calculate their values dynamically at runtime and do not consume data storage.
Question 7: What happens to child records in a Lookup relationship when the parent record is deleted?
- Child records are also deleted
- Child records have their lookup field set to null (Correct answer)
- The deletion is prevented
- Child records are moved to the Recycle Bin
Correct answer: Child records have their lookup field set to null
In a Lookup relationship, deleting the parent record sets the lookup field on child records to null by default (unless deletion is prevented in the relationship settings).
A developer needs a field that auto-increments with each new record and cannot be edited after creation.
Which field type should they use?