No, unlike SQL, SOQL is a query-only language. This means that you can only use it to retrieve data. If you need to
insert, update, or delete records, you need to use Data Manipulation Language (DML) operations provided by Apex,
Salesforce's proprietary programming language.
SOQL has a unique way of handling relationships between objects using Relationship Queries. These allow you to retrieve
records from one object, then query related objects in a single statement using a nested query. For example, to retrieve
an account's related contact records, you would use a nested SOQL query such as:
SELECT Name, (SELECT LastName FROM Contacts) FROM Account
Yes, Salesforce enforces several governor limits on SOQL queries to ensure resources are shared equitably. As of the year 2023,
a single SOQL query can retrieve up to 50,000 records, and a transaction can run up to
100 SOQL queries. Additionally, a single query can't select more than 35 child-to-parent relationships and can traverse
no more than five levels of parent-to-child relationships.
The total number of SOQL queries in a transaction varies
based on whether the Apex code is synchronous or asynchronous. Always refer to the latest Salesforce documentation for
the most accurate information.