T-SQL For Salesforce Marketing Cloud
T-SQL For Salesforce Marketing Cloud
We are all aware that T-SQL plays a major role in retrieving data from various sources to
Salesforce Marketing Cloud, such as Dataviews, sendlog tables, sendable and non-
sendable data extensions. It would be nice if we all spend a good amount of time
learning about T-SQL on Salesforce Marketing Cloud.
Avinash has decided to conduct a session to share knowledge on T-SQL and familiarize
the entire MarTech team with it. I, Parthiban, am seizing this great opportunity to share
my T-SQL knowledge with other team members. This will provide an excellent
opportunity for me to connect with the entire team and discuss T-SQL on Salesforce
Marketing Cloud.
The session will be divided into small pieces, likely 1 hour a week, making it a much
more interactive experience for everyone. I will be creating this document based on
publicly available information and creating a database within our Salesforce Marketing
Cloud. Even though the information is publicly available, it will be used only for
reference purposes. As employees of a publicly traded company, we need to maintain
data documentation and use cases in a much more confidential manner.
I am excited to make use of this opportunity with all of you, and with God's grace, this
session will be a long series in the upcoming days, with takeaways at the end of each
session. With your great support, we aim to make this a more interactive session in the
coming days.
I would like to take this moment to express my gratitude to Avinash for believing in my
skills at the early stage of my career at Gale Partners.
Table of the Content:
1. A primer on databases
1.1. Introduction
1.1.1. Welcome
1.1.2. Tables
1.1.3. Columns and rows
1.1.4. Notation
1.1.5. SQL
1.1.6. Queries
2. Selecting data from one table
2.1. Returning all data from a table
2.1.1. Get all data from a table
2.1.2. Read the result
2.2. Select some columns
2.2.1. Select one column
2.2.2. Select multiple columns
2.3. Filtering rows
2.3.1. Select only a few rows
2.3.2. Conditional operators
2.3.3. The inequality operator (!=)
2.3.4. Conditional operators and selecting columns
2.4. Logic
2.4.1. Logical operators – OR
2.4.2. Logical operators – AND
2.4.3. The BETWEEN operator
2.4.4. The BETWEEN operator
2.4.5. Logical operators – NOT
2.4.6. Join even more conditions
2.5. Text patterns
2.5.1. Use text
2.5.2. Unicode text
2.5.3. The percentage wildcard (%)
2.5.4. The percentage wildcard (%) continued
2.5.5. The underscore wildcard (_)