SOQL means Salesforce Object Query Language which is to query the records from the database.com based on the requirement. Salesforce Apex and SOQL (Salesforce Object Query Language) together give the developers powerful tools for managing Salesforce data and processes of their application.
- Records are pertaining to single sObject.
- Using Salesforce Object Query Language developers can fetch and process a large amount of data in an easy, human readable query language.
- Salesforce Object Query Language is very similar to SQL (Structured Query Language) used in other database systems.
- It doesn’t support all advanced features of the SQL.
Learn Salesforce Apex – SOQL features & Limitations.
- Salesforce Object Query Language is case sensitive and very easy to understand.
- It is similar to SQL and helps to optimize code.
- It reduces workload time.
- Salesforce objects data can retrieved or extracted to Excel sheets.
- It returns records.
- Records are stored in collection.
Salesforce Apex : SOQL limitations
- By default, 20,000 characters for a Statement.
- Number of SOQL rows – 50k.
- Number of SOSL Queries – 20.
- Number of DML Statements – 150.
- Number of DML Rows – 10k.
- Number of Script Statements – 200k.
- Maximum Heap size – 3000k.
- Number of call out – 10.
- Number of Email invocation – 10.
- Number of Filed describes – 100.
- Number of Child relationships – 100.
- Number of picklist describes – 100.
- Number of future calls – 10.
Writing first SOQL Statement?
Salesforce Object data can be retrieved using SOQL queries. To execute Salesforce Object Query Language queries we must install Force.com explorer software in our local system. And also we can use Force.com IDE. It is a powerful client application used to create, modify, test and develop Force.com application.
- Learn How to install Force.com Explorer.
- How to install Force.com IDE.
SOQL example Statement.
Select Id, Name From Account
As shown above fetching Record Id and Name from Standard object Account. To fetch records from Custom objects we must use __c at the end of the custom Object name.
SOQL Example Statement.
SELECT Name, Subject1__c FROM Student__c
From above example Student__c is the custom object and we fetching Record name and Subject1 marks details from Student object.
In this Salesforce Developer tutorial, we learn about enabling development mode in Salesforce, SOQL basics, SOQL Syntax, tools like Force.com Explorer and Force.com IDE, How to install Force.com Explorer, How to Install Force.com IDE, basics, Syntax, and Statements. Salesforce Apex and SOQL together give the developers powerful tools for managing the data and processes of their application.
Learn SOQL (Salesforce Object Query Language) – APEX Tutorials.
Salesforce Developer Tutorials – SOQL Basics
- The Alias Notation.
- The WHERE Clause.
- IN Operator.
- ORDER BY clause.
- INCLUDES and EXCLUDES operators.
- Comparison Operators.
- Not Equals.
- Less Than.
- Less Than or Equal to.
- Greater than.
- Greater than or equal to.
- SOQL Relationships.
- Relationships between Standard Objects.
- Relationships between Custom Objects.
- Many-to-One Relationships (n:1) in SOQL.
- Semi Join and Anti Join.
- Inner Join and Outer Join.
- Filtering Multi Select picklist values.
- Escape Sequence.
- Date Formats
- Date literals.
- GROUP BY ROLLUP Clause.
- FOR REFERENCE Clause.
- FOR VIEW Clause
- GROUP BY Class.
- COUNT ( ).
- COUNT (FIELD _NAME).
- COUNT_DISTINCT ( ).
- SUM ( ).
- MIN ( )
- MAX ( ).
- HAVING Class.