nerdexam
Salesforce

PDI · Question #208

Which three data types can a SOQL query return? Choose 3 answers

The correct answer is A. List C. Integer D. sObJect. A SOQL query primarily returns a List of sObject records; however, aggregate queries can also return single scalar values like Integer for counts.

Submitted by valeria.br· Apr 18, 2026Data Modeling and Management

Question

Which three data types can a SOQL query return? Choose 3 answers

Options

  • AList
  • BLong
  • CInteger
  • DsObJect
  • EDouble

How the community answered

(20 responses)
  • A
    90% (18)
  • B
    5% (1)
  • E
    5% (1)

Why each option

A SOQL query primarily returns a List of sObject records; however, aggregate queries can also return single scalar values like Integer for counts.

AListCorrect

The most common return type for a SOQL query is a List of sObject records, for example, List<Account> or List<Contact>.

BLong

While Long is a valid Apex data type, SOQL aggregate functions like COUNT() return Integer if the count fits, or use COUNT(fieldname) which returns Integer. A direct SOQL query doesn't explicitly return a Long type for standard data.

CIntegerCorrect

For aggregate functions like COUNT(), a SOQL query can return an Integer value representing the count of records.

DsObJectCorrect

Each row returned by a SOQL query, representing a record, is of the sObject type, or a specific child type like Account or Contact. A query returns a List of these sObject instances.

EDouble

While Double is a valid Apex data type for decimals, SOQL aggregate functions for sums (SUM()) or averages (AVG()) typically return Decimal type, not Double.

Concept tested: SOQL return types

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

Topics

#SOQL#Data Types#Apex Queries

Community Discussion

No community discussion yet for this question.

Full PDI Practice