# 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)
