---
schema_version: "1"
id: 3279aba7138b3c4810cfd38b2346474ebbc713b4168a99b22cbabfc4a102183f
title: Understand SOQL Queries
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/mc-core/guide/mc-manage-objects/mc-manage-objects-query/mc-manage-objects-query-soql.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-growth/guide/mc-manage-objects-query-soql.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2cfc88ebee411ae75d1bd9b8790d51b4105bd7a291bf29ef8a881f3ee6c3444d
products:
  - Marketing Cloud Next
  - Marketing Cloud
---
# Understand SOQL Queries

SOQL is a query language that’s similar to SQL but designed for Salesforce data. To query data using Salesforce APIs, create a SOQL statement that defines the information you want to search for.

## SOQL Statement Structure

The basic structure of a SOQL statement resembles this example.

```sql
SELECT _one or more fields_
FROM _an object_
WHERE _filter statements_
ORDER BY _optional sorting rules to apply to the query_
LIMIT _the maximum number of results to return_
```

For example, this SOQL query returns the value of the `Id`, `FirstName`, `LastName`, and `Country` fields for all contacts where the value of the MailingCountry field is `NG`. Results are returned in ascending order by `LastName`, and then in ascending order by `FirstName`. The maximum number of results returned is 25.

```sql
SELECT Id, FirstName, LastName, MailingCountry
FROM Contact
WHERE MailingCountry = 'NG'
ORDER BY LastName ASC, FirstName ASC
LIMIT 25
```

## Related Content

- [SOQL and SOSL Reference](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_sosl_intro.htm)
