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.
SOQL statements evaluate a list of sObjects, a single sObject, or an Integer for count method queries.
upvoted 3 times
...
Log in to ExamTopics
Sign in:
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.
ABHI0O07
7 months, 4 weeks agoMaxGoiabinha
6 months, 4 weeks agohelper_raw
11 months, 4 weeks agotanyen
1 year, 1 month ago