Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 257 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 257
Topic #: 1
[All Certified Platform Developer II Questions]

A developer has a requirement to query three fields (Id, Name, Type) from an Account and First and Last names for all Contacts associated with the Account.

Which option is the preferred optimized method to achieve this for the Account named ‘Ozone Electronics’?

  • A. Account a = [SELECT ID, Name, Type FROM Account WHERE name=‘Ozone Electronics’]; list lContacts = [SELECT firstname, lastname FROM Contact WHERE accounted=:a.ID];
  • B. Account a = [SELECT ID, Name, Type, (SELECT FirstName, LastName FROM Contacts) FROM Account WHERE name=‘Ozone Electronics’ LIMIT 1];
  • C. list lContacts = new list();
    for (Contact c :[SELECT firstname, lastname, Account.Name, Account.ID, Account.Type FROM Contact WHERE Account.Name=‘ozone electronics’]) ( lContacts.add(c); )
  • D. list lAccounts = [SELECT ID, Name, Type FROM Account JOIN (SELECT ID, firstname, lastname FROM Contact WHERE contact.account.name = ‘ozone electronics’)];
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
M4JK3LSON
11 months ago
If you still figuring out like me previously, take a look that in question there is a information about SINGLE Account, so LIMIT 1 shoudnt be problematic and Ans B is good option
upvoted 1 times
...
stan_malta
1 year ago
Selected Answer: B
"Preferred optimized method" can only be B
upvoted 1 times
...
[Removed]
1 year, 4 months ago
I think the correct answer is B.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...