SOQL Interview Questions
SOQL Interview Questions
Interview Questions on
SOQL in
Salesforce
What is SOQL
Statement
SOQL Query Structure
Build Queries out of Object
File ->Open->Objects ->Choose the Object -> Select the field ->Query
Build Queries out of Object
Parent to Child Query
Note: For custom relationships you use the API name of the
relationship field, but with __r rather than __c.
Child to Parent Query
Use Dot Notation when looking for parent object record and querying
on child object.
What is dynamic SOQL?
Dynamic SOQL refers to the creation of a SOQL string at
runtime with Apex code. Dynamic SOQL enables you to
create more flexible applications.
Example :
For Update clause will lock the records from getting updated from
other transactions untill the current transaction is completed.
What is LIKE clause in soql?
A. like clause is used to compare the string values or used to search for
the string value in the given fields
‘%’ – any no of characters
‘_’ – one character
Syntax to fetch the records from recycle bin using soql?
SELECT Id, isDeleted FROM <Oblectname> WHERE isDeleted = true
true All ROWS – This will only return the archived rows.
How many records can be fetched using SOQL?
We can retrieve up to 50000 records from SOQL in a single
transaction.