Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Salesforce Certified Platform Developer I (PDI) · Salesforce
Select 3 answers.
This question asks for 3 answers, but our data marks only 1. Compare with the community discussion below for the full answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
List of sObjects: List<Account> accounts = [SELECT Id, Name FROM Account LIMIT 10]; Single sObject: Account acc = [SELECT Id, Name FROM Account WHERE Id = '001XXXXXXXXXXXX']; String: String accountName = [SELECT Name FROM Account WHERE Id = '001XXXXXXXXXXXX'].Name; These examples demonstrate how SOQL queries can return either a list of sObjects, a single sObject, or a field value as a String.
In the last scenario the SOQL is returning an object, you're just assigning a field from this object to a variable, and in that case, any other type would be considered a correct answer here. The correct answer is BCD, because a SOQL can return an Integer in case of a COUNT method query.
Types Of SOQL Return Type Lists<sObject> sObject. Integar. AggregateResult.