SQL is a more traditional and widespread query language. It is ubiquitous and not at all limited to just Salesforce. The one place it is used within the Salesforce system is Marketing Cloud.
SOQL is the basic query language used in Apex, the REST API, etc. (reference):
Use the 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.
SOSL is similar to SOQL, but its use is generally across multiple objects at once, or when you don't necessarily know in which field the matching data might reside (reference):
Use the Salesforce Object Search Language (SOSL) to construct text-based search queries against the search index.
You can search text, email, and phone fields for multiple objects, including custom objects, that you have access to in a single query in the following environments.
When to Use SOSL
Use SOSL when you don’t know which object or field the data resides in, and you want to:
- Retrieve data for a specific term that you know exists within a field. Because SOSL can tokenize multiple terms within a field and build a search index from this, SOSL searches are faster and can return more relevant results.
- Retrieve multiple objects and fields efficiently where the objects might or might not be related to one another.
- Retrieve data for a particular division in an organization using the divisions feature.
- Retrieve data that’s in Chinese, Japanese, Korean, or Thai. Morphological tokenization for CJKT terms helps ensure accurate results.
SAQL was introduced with Wave and is used for analytics (reference):
Use SAQL (Salesforce Analytics Query Language) to access data in Analytics datasets. Analytics uses SAQL behind the scenes in lenses, dashboards, and explorer to gather data for visualizations.