QuestionQ12

VerifiedData Modeling and Management

A developer must identify every subscriber in the Customers data extension who has made a purchase during the past 30 days. Purchase information is stored in the Orders data extension, which includes a column named PurchaseDate. Contacts are identified in both data extensions by a column named ContactKey, and the Orders data extension can include multiple instances of the same subscriber.

Which SQL keyword should the developer use to obtain the required result?

Explanation

INNER JOIN returns only records whose ContactKey exists in both the Customers and Orders data extensions. Combined with a PurchaseDate predicate for the last 30 days, it limits the result to customers with a matching recent purchase. Multiple matching order rows can be deduplicated with DISTINCT if one result row per subscriber is required. Salesforce’s SQL Query Activity reference includes INNER JOIN as a supported SQL construct, and Salesforce’s recent-activity query examples use INNER JOIN with a date filter to retrieve matching subscriber activity.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!