The differences are mentioned in the table below:
SOQL (Salesforce Object Query Language) | SOSL (Salesforce Object Search Language) |
Only one object can be searched at a time | Many objects can be searched at a time |
Can query any type of field | Can query only on email, text or phone |
Can be used in classes and triggers | Can be used in classes, but not triggers |
DML Operation can be performed on query results | DML Operation cannot be performed on search results |
Returns records | Returns fields |