SlideShare a Scribd company logo
Learn to Leverage the Power of SOQL
Louise Lockie
Salesforce MVP
11x Certified
@LouiseLockie
Mike Gerholdt
Sr. Director, Admin
Evangelism
Salesforce
@MikeGerholdt
Today’s Speakers
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any
of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking
statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or
service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for
future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts
or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our
service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth,
interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible
mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our
employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com
products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of
salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most
recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information
section of our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be
delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available.
Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
Statement under the Private Securities Litigation Reform Act of 1995
Forward-Looking Statement
Connect with Us!
@SalesforceAdmns
#AwesomeAdmin
admin.salesforce.com
Salesforce Admins
Salesforce Admins
Salesforce Admins
Watch the Recording
The video will be posted to
YouTube & the webinar recap
page: bit.ly/powerofSOQL
This webinar is being recorded!
Join the Admin Webinar Group for Q&A!
Don’t wait until the end to ask your
question!
• We have team members on hand to answer
questions in the webinar group.
Stick around for live Q&A at the end!
• Speakers will tackle more questions at the end,
time-allowing
bit.ly/AdminWebinarGroup
• What is SOQL?
• How do I write a SOQL Query?
• Demo
• Resources
• Q&A
Today’s Agenda
What is SOQL?
Salesforce
Object
Query
Language
What is SOQL?
Use SOQL to read information stored in your org’s database.
SOQL is syntactically similar to SQL (Structured Query Language)
What’s In It For Me?
How Can SOQL Help Admins?
q Enables quick and easy data analysis
q Extends use of existing tools
q Stepping stone to Apex
q Adds another marketable skill
q Treats your inner geek
Have You Used SOQL Logic Before?
It May Even Look Familiar
Data Loader Report Builder
Where Can Admins Use SOQL?
DEVELOPER CONSOLE DATA LOADER
Find the Developer Console in The Setup Menu
Developer Console
How do I write an SOQL Query?
SOQL Query Format
SELECT(which fields do you want in the results)
FROM (which object do these fields come from)
Example:
SELECT name, id FROM play__c
Where to start
Sample SOQL Query in Developer Console
Filter Your Results with WHERE
SELECT name , id
FROM play__c
WHERE date__c = last_year
Add Conditions With AND
SELECT name , id
FROM play__c
WHERE date__c = last_year AND
rating__c > 4
Add Conditions With OR
SELECT name , id
FROM play__c
WHERE date__c = last_year AND
(rating__c > 4 OR cost__c < 20)
Demo
Other Operators and Tools
LIMIT
ORDER BY (ASC/DESC)
IN
=
!=
LIKE %
SUM() MIN() MAX() AVG()
TODAY LAST_MONTH
COUNT()
COUNT_DISTINCT()
SELECT id, name
FROM account
ORDER BY name ASC
LIMIT 10
SELECT id, name, email
FROM contact
WHERE firstname LIKE ‘Louis%’
SELECT id, name
FROM account
WHERE billingstate IN (‘GA’,
‘FL’, ‘NC’)
SELECT
COUNT_DISTINCT(name)
FROM account
Examples
Every query starts with SELECT and has a FROM
Don’t forget to use the API names for objects and fields (__c)
Apply single quotes ‘like this’ when looking for text values or picklist results
Use INCLUDES and EXCLUDES for Multiselect picklists but IN and NOT IN for
standard picklists
Wildcard in SOQL is “%” not “*”
SELECT * is not available in SOQL (in SQL this returns all fields, in SOQL we
must list them out)
Tips and Tricks to Remember
Resources
Resources
Blog Posts
Women Code Heroes Blog – A Sweet
Intro to SOQL
Developer Documentation -
Introduction to SOQL and SOSL
Salesforce Ben – SOQL Cheat Sheet
SF99 – Intro to SOQL and why you
should learn it
Trailhead Modules
Database & .Net Basics
Apex Basics & Database
Developer Console Basics
Transform SQL Queries to SOQL Queries
in a Lightning App
Quick Start: Apex Coding for Admins
Q&A
bit.ly/AdminWebinarGroup
Slides
bit.ly/powerofSOQL
Wrapping Up
Survey
Please complete
GoToWebinar survey
Learn to Leverage the Power of SOQL

More Related Content

What's hot (20)

PDF
Best Practices with Apex in 2022.pdf
Mohith Shrivastava
 
PPTX
Introduction to Apex for Developers
Salesforce Developers
 
PPTX
Modeling and Querying Data and Relationships in Salesforce
Salesforce Developers
 
PPTX
Governor limits
Shivanath Devinarayanan
 
PPTX
Apex code (Salesforce)
Mohammed Safwat Abu Kwaik
 
PPTX
Salesforce Basic Development
Naveen Dhanaraj
 
PDF
Introduction to Visualforce
Salesforce Developers
 
PPTX
Salesforce Service Cloud Training | Salesforce Training For Beginners - Servi...
Edureka!
 
PPTX
Salesforce Org Health Check & Performance Testing
ImtiazBinMohiuddin
 
PDF
26.2.1 Packet Tracer - Configure Extended IPv4 ACLs - Scenario 1 - ITExamAnsw...
rediani
 
PDF
Flow in Salesforce
vikas singh
 
PPTX
Introduction to apex code
EdwinOstos
 
PPTX
Salesforce Connect
Jitendra Joysar ☁
 
PPTX
Record sharing model in salesforce
Sunil kumar
 
PPTX
Batch Apex in Salesforce
David Helgerson
 
PPTX
Salesforce asynchronous apex
Badan Singh Pundeer
 
PDF
Managing Your Batch and Scheduled Apex Processes with Relax
Salesforce Developers
 
PDF
SFDC User Setup
Simeon Tzanev
 
PDF
Apex Testing Best Practices
Salesforce Developers
 
PPTX
Apex collection patterns
Sathishkumar Periyasamy
 
Best Practices with Apex in 2022.pdf
Mohith Shrivastava
 
Introduction to Apex for Developers
Salesforce Developers
 
Modeling and Querying Data and Relationships in Salesforce
Salesforce Developers
 
Governor limits
Shivanath Devinarayanan
 
Apex code (Salesforce)
Mohammed Safwat Abu Kwaik
 
Salesforce Basic Development
Naveen Dhanaraj
 
Introduction to Visualforce
Salesforce Developers
 
Salesforce Service Cloud Training | Salesforce Training For Beginners - Servi...
Edureka!
 
Salesforce Org Health Check & Performance Testing
ImtiazBinMohiuddin
 
26.2.1 Packet Tracer - Configure Extended IPv4 ACLs - Scenario 1 - ITExamAnsw...
rediani
 
Flow in Salesforce
vikas singh
 
Introduction to apex code
EdwinOstos
 
Salesforce Connect
Jitendra Joysar ☁
 
Record sharing model in salesforce
Sunil kumar
 
Batch Apex in Salesforce
David Helgerson
 
Salesforce asynchronous apex
Badan Singh Pundeer
 
Managing Your Batch and Scheduled Apex Processes with Relax
Salesforce Developers
 
SFDC User Setup
Simeon Tzanev
 
Apex Testing Best Practices
Salesforce Developers
 
Apex collection patterns
Sathishkumar Periyasamy
 

Similar to Learn to Leverage the Power of SOQL (20)

PDF
Developing on the Salesforce Platform With Clicks, Not Code
Salesforce Developers
 
PDF
Einstein Analytics for Developers
Salesforce Developers
 
PPTX
The Power of One by Steve Molis
Salesforce Admins
 
PPTX
The Power of One by Steve Molis
Salesforce Admins
 
PDF
CodeLive with Cynthia Thomas - Refactoring data dependent code.
JackGuo20
 
PPTX
Go Faster with Lightning - Overview
Salesforce Developers
 
PDF
Force.com Friday: Intro to Force.com Slides
Salesforce Developers
 
PDF
Introduction to MuleSoft
Salesforce Developers
 
PDF
Build Your Lightning Rollout Plan - September 2017
Salesforce Admins
 
PDF
Your Lightning Game Plan in 3 Steps
Salesforce Admins
 
PDF
Moving from Solo Admin to Center of Excellence
Salesforce Admins
 
PPTX
Getting Started with Salesforce for Non-Profits by Nik Panter
Salesforce Admins
 
PPTX
Integrating with salesforce
Mark Adcock
 
PDF
#DF17Recap series: Integrate apps easier with the Salesforce platform
Salesforce Developers
 
PDF
Easy No-Code Integrations with External Services and Visual Flow
Salesforce Developers
 
PDF
Introduction to Einstein Bots
Salesforce Developers
 
PPTX
Kitchener Salesforce Developer Group Event - Introduction to dev ops with Sal...
Sudipta Deb ☁
 
PPTX
sf tools from community
Durgesh Dhoot
 
PPTX
Build custom user interfaces for your Salesforce data with the UI API
Salesforce Developers
 
PPTX
Winter '16 Release - Overview and Highlights
Salesforce Developers
 
Developing on the Salesforce Platform With Clicks, Not Code
Salesforce Developers
 
Einstein Analytics for Developers
Salesforce Developers
 
The Power of One by Steve Molis
Salesforce Admins
 
The Power of One by Steve Molis
Salesforce Admins
 
CodeLive with Cynthia Thomas - Refactoring data dependent code.
JackGuo20
 
Go Faster with Lightning - Overview
Salesforce Developers
 
Force.com Friday: Intro to Force.com Slides
Salesforce Developers
 
Introduction to MuleSoft
Salesforce Developers
 
Build Your Lightning Rollout Plan - September 2017
Salesforce Admins
 
Your Lightning Game Plan in 3 Steps
Salesforce Admins
 
Moving from Solo Admin to Center of Excellence
Salesforce Admins
 
Getting Started with Salesforce for Non-Profits by Nik Panter
Salesforce Admins
 
Integrating with salesforce
Mark Adcock
 
#DF17Recap series: Integrate apps easier with the Salesforce platform
Salesforce Developers
 
Easy No-Code Integrations with External Services and Visual Flow
Salesforce Developers
 
Introduction to Einstein Bots
Salesforce Developers
 
Kitchener Salesforce Developer Group Event - Introduction to dev ops with Sal...
Sudipta Deb ☁
 
sf tools from community
Durgesh Dhoot
 
Build custom user interfaces for your Salesforce data with the UI API
Salesforce Developers
 
Winter '16 Release - Overview and Highlights
Salesforce Developers
 
Ad

More from Salesforce Admins (20)

PDF
Admin Best Practices: Dashboards for Every Admin
Salesforce Admins
 
PDF
Admin Best Practices: Building Useful Formulas
Salesforce Admins
 
PDF
Admin Best Practices: 3 Steps to Seamless Deployments
Salesforce Admins
 
PDF
Awesome Admins Automate: Integrate Flow with AI and Chatbots
Salesforce Admins
 
PDF
#AwesomeAdmins Automate: Create Triggered Flows and Batch Jobs
Salesforce Admins
 
PDF
Admin Best Practices: Introducing Einstein Recommendation Builder
Salesforce Admins
 
PDF
Admin Best Practices: Remove Security Risk From Your Org with a User Audit
Salesforce Admins
 
PDF
Essential Habits for New Admins
Salesforce Admins
 
PDF
Essential Habits for Salesforce Admins: Actionable Analytics
Salesforce Admins
 
PDF
Essential Habits for Salesforce Admins: Security
Salesforce Admins
 
PDF
Essential Habits for Salesforce Admins: Data Management
Salesforce Admins
 
PDF
Essential Habits for Salesforce Admins: User Management
Salesforce Admins
 
PPTX
Admin Best Practices: Explore the Power of Data with Tableau
Salesforce Admins
 
PPTX
Essential Habits for New Admins
Salesforce Admins
 
PDF
Admin trailhead Live: Leverage Einstein Search to Increase Productivity
Salesforce Admins
 
PDF
Admin Best Practices: Reports & Dashboards
Salesforce Admins
 
PDF
Trailhead Live: Essential Habits & Core Admin Responsibilities
Salesforce Admins
 
PDF
Build AI-Powered Predictions with Einstein Prediction Builder
Salesforce Admins
 
PDF
Trailhead Live: Build an Awesome Team of Admins
Salesforce Admins
 
PDF
Semper Salesforce: Become a Salesforce Military Champion
Salesforce Admins
 
Admin Best Practices: Dashboards for Every Admin
Salesforce Admins
 
Admin Best Practices: Building Useful Formulas
Salesforce Admins
 
Admin Best Practices: 3 Steps to Seamless Deployments
Salesforce Admins
 
Awesome Admins Automate: Integrate Flow with AI and Chatbots
Salesforce Admins
 
#AwesomeAdmins Automate: Create Triggered Flows and Batch Jobs
Salesforce Admins
 
Admin Best Practices: Introducing Einstein Recommendation Builder
Salesforce Admins
 
Admin Best Practices: Remove Security Risk From Your Org with a User Audit
Salesforce Admins
 
Essential Habits for New Admins
Salesforce Admins
 
Essential Habits for Salesforce Admins: Actionable Analytics
Salesforce Admins
 
Essential Habits for Salesforce Admins: Security
Salesforce Admins
 
Essential Habits for Salesforce Admins: Data Management
Salesforce Admins
 
Essential Habits for Salesforce Admins: User Management
Salesforce Admins
 
Admin Best Practices: Explore the Power of Data with Tableau
Salesforce Admins
 
Essential Habits for New Admins
Salesforce Admins
 
Admin trailhead Live: Leverage Einstein Search to Increase Productivity
Salesforce Admins
 
Admin Best Practices: Reports & Dashboards
Salesforce Admins
 
Trailhead Live: Essential Habits & Core Admin Responsibilities
Salesforce Admins
 
Build AI-Powered Predictions with Einstein Prediction Builder
Salesforce Admins
 
Trailhead Live: Build an Awesome Team of Admins
Salesforce Admins
 
Semper Salesforce: Become a Salesforce Military Champion
Salesforce Admins
 
Ad

Recently uploaded (20)

PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PPTX
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Adobe Premiere Pro Crack / Full Version / Free Download
hashhshs786
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PPTX
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Adobe Premiere Pro Crack / Full Version / Free Download
hashhshs786
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 

Learn to Leverage the Power of SOQL

  • 1. Learn to Leverage the Power of SOQL
  • 2. Louise Lockie Salesforce MVP 11x Certified @LouiseLockie Mike Gerholdt Sr. Director, Admin Evangelism Salesforce @MikeGerholdt Today’s Speakers
  • 3. This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements. Statement under the Private Securities Litigation Reform Act of 1995 Forward-Looking Statement
  • 5. Watch the Recording The video will be posted to YouTube & the webinar recap page: bit.ly/powerofSOQL This webinar is being recorded!
  • 6. Join the Admin Webinar Group for Q&A! Don’t wait until the end to ask your question! • We have team members on hand to answer questions in the webinar group. Stick around for live Q&A at the end! • Speakers will tackle more questions at the end, time-allowing bit.ly/AdminWebinarGroup
  • 7. • What is SOQL? • How do I write a SOQL Query? • Demo • Resources • Q&A Today’s Agenda
  • 9. Salesforce Object Query Language What is SOQL? Use SOQL to read information stored in your org’s database. SOQL is syntactically similar to SQL (Structured Query Language)
  • 10. What’s In It For Me? How Can SOQL Help Admins? q Enables quick and easy data analysis q Extends use of existing tools q Stepping stone to Apex q Adds another marketable skill q Treats your inner geek
  • 11. Have You Used SOQL Logic Before? It May Even Look Familiar Data Loader Report Builder
  • 12. Where Can Admins Use SOQL? DEVELOPER CONSOLE DATA LOADER
  • 13. Find the Developer Console in The Setup Menu
  • 15. How do I write an SOQL Query?
  • 16. SOQL Query Format SELECT(which fields do you want in the results) FROM (which object do these fields come from) Example: SELECT name, id FROM play__c Where to start
  • 17. Sample SOQL Query in Developer Console
  • 18. Filter Your Results with WHERE SELECT name , id FROM play__c WHERE date__c = last_year
  • 19. Add Conditions With AND SELECT name , id FROM play__c WHERE date__c = last_year AND rating__c > 4
  • 20. Add Conditions With OR SELECT name , id FROM play__c WHERE date__c = last_year AND (rating__c > 4 OR cost__c < 20)
  • 21. Demo
  • 22. Other Operators and Tools LIMIT ORDER BY (ASC/DESC) IN = != LIKE % SUM() MIN() MAX() AVG() TODAY LAST_MONTH COUNT() COUNT_DISTINCT() SELECT id, name FROM account ORDER BY name ASC LIMIT 10 SELECT id, name, email FROM contact WHERE firstname LIKE ‘Louis%’ SELECT id, name FROM account WHERE billingstate IN (‘GA’, ‘FL’, ‘NC’) SELECT COUNT_DISTINCT(name) FROM account Examples
  • 23. Every query starts with SELECT and has a FROM Don’t forget to use the API names for objects and fields (__c) Apply single quotes ‘like this’ when looking for text values or picklist results Use INCLUDES and EXCLUDES for Multiselect picklists but IN and NOT IN for standard picklists Wildcard in SOQL is “%” not “*” SELECT * is not available in SOQL (in SQL this returns all fields, in SOQL we must list them out) Tips and Tricks to Remember
  • 25. Resources Blog Posts Women Code Heroes Blog – A Sweet Intro to SOQL Developer Documentation - Introduction to SOQL and SOSL Salesforce Ben – SOQL Cheat Sheet SF99 – Intro to SOQL and why you should learn it Trailhead Modules Database & .Net Basics Apex Basics & Database Developer Console Basics Transform SQL Queries to SOQL Queries in a Lightning App Quick Start: Apex Coding for Admins