Skip to main content
Development

What is SOQL in Salesforce?

SOQL (Salesforce Object Query Language) is the query language that reads records from Salesforce objects, much like SQL SELECT. Apex allows 100 SOQL queries per synchronous transaction and 200 per asynchronous one.

Clientell AI, the AI Salesforce admin, helps with SOQL in a sandbox: it writes and tests the code, and shows it to you before anything deploys. See Apex and query generation

Try it in Clientell AI

“Write a SOQL example for my Account object, test it in a sandbox, and show me the code before anything deploys.”

Clientell reads your org first, drafts every change, and changes nothing until you approve. Platform deployments include rollback. How security works.

Start the 14-day free trial, no card

Term Context

Category

Development

10 terms in this category

Related Terms

4

connected concepts

Glossary

66

total definitions

How does SOQL work in Salesforce?

SOQL is structurally similar to SQL's SELECT statement but is purpose-built for Salesforce's object-relational data model. It supports parent-to-child and child-to-parent relationship queries, aggregate functions (COUNT, SUM, AVG, MIN, MAX), GROUP BY and HAVING clauses, and polymorphic fields via TYPEOF. Queries can filter on virtually any indexed field, and developers should design queries to be selective (meaning they use indexed fields) to avoid full table scans on large objects.

SOQL is used in Apex code, the Developer Console, Workbench, the REST API, and data migration tools like Data Loader. Governor limits cap the number of SOQL queries per transaction at 100 (synchronous) or 200 (asynchronous), so efficient query design is critical. Clientell's free SOQL Generator lets you build complex queries visually and instantly copy them into your dev environment, saving time and reducing syntax errors.

Questions people ask

What does SOQL stand for?

Salesforce Object Query Language. It reads records from Salesforce objects, much like SQL SELECT.

How many SOQL queries can one Apex transaction run?

100 in synchronous Apex and 200 in asynchronous Apex.

Where can I run a SOQL query?

In Apex, the Developer Console, Workbench, the REST API, and tools such as Data Loader.

What is the difference between SOQL and SOSL?

SOQL queries one object and its related objects. SOSL searches text across many objects in one call.

How do I write SOQL without memorising the syntax?

Use the free SOQL Generator to build the query visually, then copy it into your dev tool.

What should I read next?

Getting Started

Try this on your own org

Start the 14-day free trial, no card. Clientell scans read-only first and changes nothing until you approve.

14-day free trial  ·  No credit card required

SOC 2
HIPAA
GDPR
Salesforce Partner