Salesforce Object Query Language (SOQL) to search your organization’s Salesforce data for specific information. SOQL is similar to the SELECT statement in the widely used Structured Query Language (SQL) but is designed specifically for Salesforce data.
Use SOQL when you know which objects the data resides in, and you want to:
-- Retrieve data from a single object or from multiple objects that are related to one another.
-- Count the number of records that meet specified criteria.
-- Sort results as part of the query.
-- Retrieve data from number, date, or checkbox fields.