Salesforce Marketing Cloud

1. Scenario Question

Your marketing team wants to re-engage customers who have not made any purchase in the last 6 months.

Customer details are stored in a Customers Data Extension, and purchase information is stored in an Orders Data Extension.

You need to identify:

  • Customers whose last purchase was more than 6 months ago

  • Customers who have never made a purchase

How would you write an SQL query in Salesforce Marketing Cloud to create this audience?

My Answer

SELECT
    c.CustomerID,
    c.Email,
    MAX(o.OrderDate) AS LastPurchaseDate
FROM Customers c
LEFT JOIN Orders o
    ON c.CustomerID = o.CustomerID
GROUP BY c.CustomerID, c.Email
HAVING
    MAX(o.OrderDate) <= DATEADD(MONTH, -6, GETDATE())
    OR MAX(o.OrderDate) IS NULL

Explanation:

  • LEFT JOIN ensures that customers who never placed an order are also included.

  • MAX(o.OrderDate) returns the most recent purchase date for each customer.

  • GROUP BY is used to aggregate data at the customer level.

  • HAVING filters customers who:

    • Purchased more than 6 months ago, or

    • Have no purchase history (NULL order date).

This query helps create a re-engagement audience that can be used in Journey Builder or Email Studio.

2. Scenario Question

You are building a Journey where users should exit automatically if they have not opened any email in the last 60 days.

How would you create the audience for this requirement using SQL?

My Answer

SELECT
    s.SubscriberKey,
    s.EmailAddress
FROM _Subscribers s
LEFT JOIN _Open o
    ON s.SubscriberKey = o.SubscriberKey
GROUP BY s.SubscriberKey, s.EmailAddress
HAVING
    MAX(o.EventDate) <= DATEADD(DAY, -60, GETDATE())
    OR MAX(o.EventDate) IS NULL

Explanation:
This query identifies subscribers who are inactive or never opened emails, allowing them to be excluded or exited from Journeys.

3. Scenario Question

How can you join two Data Extensions in Salesforce Marketing Cloud using SQL? Explain with a live example.

Live Example Answer

Assume we have two Data Extensions:

1️⃣ Customer_Profile

SubscriberKey

EmailAddress

Country

SK001

India

SK002

USA

2️⃣ Purchase_History

SubscriberKey

OrderID

OrderAmount

SK001

O1001

2500

SK001

O1002

1800

SQL Query

SELECT
  p.SubscriberKey,
  p.EmailAddress,
  p.Country,
  o.OrderID,
  o.OrderAmount
FROM [Customer_Profile] p
INNER JOIN [Purchase_History] o
  ON p.SubscriberKey = o.SubscriberKey

Result Output

SubscriberKey

EmailAddress

Country

OrderID

OrderAmount

SK001

India

O1001

2500

SK001

India

O1002

1800

Interview Insight

  • INNER JOIN returns only matching records

  • Subscribers without purchases (like SK002) are excluded

  • Used commonly to create targeted audiences based on behavior

My Strong Interview Line

“I use INNER JOIN when I want only matching records and LEFT JOIN when I want all subscribers, even if related data is missing.”

By TheSalesforceGuy
🌎 Introducing

⭐️ Crack your next Salesforce Marketing Cloud interviews with confidence.

This guide is specially designed to help you think like an SFMC consultant, not just memorize answers.

If you are preparing for Salesforce Marketing Cloud interviews in 2026, this is the only guide you need.

🔥 Why This Guide Is Different?

Most interview guides give theory-based questions.
But real SFMC interviews are scenario-driven.

This guide focuses on:

- Real interview scenarios
- Practical problem-solving
- How SFMC is used in real projects
- Exactly what interviewers expect from you.

📘 What You’ll Get Inside

100 carefully selected SFMC scenario-based questions
Questions rewritten in easy-to-understand English
Covers real interview situations asked in 2025–2026
Clear explanation of what the interviewer is actually testing

Cheers! 🔥

Keep Reading