ToMotion AI logo
Menu
Back to gallery

Public AI explainer video

SQL vs SOQL in 60 Seconds

If you can query customer records with SQL, is SOQL just Salesforce's version of SQL? Think of both as asking for specific records-like finding...

Prompt

Source idea used to generate this video.

Did you know Salesforce has its own query language called SOQL? But how is it different from SQL? Let's understand in just 60 seconds! SQL stands for Structured Query Language. It's used to retrieve and manage data in relational databases like MySQL and PostgreSQL. For example, if you want to retrieve all customers from a database, you can write: `SELECT * FROM Customers` Now, Salesforce works a little differently! It uses SOQL, which stands for Salesforce Object Query Language. SOQL is specifically designed to retrieve data from Salesforce objects like Accounts, Contacts, and Opportunities. For example, to retrieve all Account names in Salesforce, you write: `SELECT Name FROM Account` Simple, right? But here's the biggest difference! In SQL, you can use JOIN statements to combine data from multiple tables. In SOQL, you don't use traditional SQL JOINs. Instead, you navigate relationships between Salesforce objects. For example: `SELECT Name, Account.Name FROM Contact` This retrieves the Contact's name along with its related Account's name. Another important difference is that SQL supports INSERT, UPDATE, and DELETE statements, while SOQL is primarily used to read data. Salesforce uses DML operations to modify records. So remember, SQL is a general-purpose database query language, while SOQL is designed specifically for Salesforce! Follow for more Salesforce concepts explained in 60 seconds!

Narration

Narration used to create this video.

Video narration

If you can query customer records with SQL, is SOQL just Salesforce's version of SQL? Think of both as asking for specific records-like finding customers in a spreadsheet. SQL, or Structured Query Language, retrieves and manages data in relational tables. You might write, "SELECT star FROM Customers." SOQL, Salesforce Object Query Language, is built to read Salesforce objects-Accounts, Contacts, and Opportunities. For account names: "SELECT Name FROM Account." Here's the key difference: it isn't the SELECT. SQL combines tables with a JOIN. SOQL follows Salesforce relationships instead. From Contact, "SELECT Name, Account dot Name FROM Contact" gets the contact's name and related account's name. And SOQL is read-focused. Salesforce uses DML operations to handle changes-like inserting, updating, or deleting records. So, is SOQL just renamed SQL? No. SQL is general-purpose; SOQL is Salesforce-specific, relationship-aware, and focused on reading.