Amazon Marketing Cloud Certification
Iris, a consumer electronics brand, would like to modify a query to only include purchase records from the underlying table. Which of the following represents how the query should be written?
SELECT campaign, COUNT(DISTINCT user_id) AS purchasers, SUM(purchases) AS purchases FROM conversions GROUP BY 1
SELECT campaign, COUNT(DISTINCT user_id) AS purchasers, SUM(purchases) AS purchases FROM amazon_attributed_events_by_traffic_time GROUP BY 1
SELECT campaign, COUNT(DISTINCT user_id) AS purchasers, SUM(purchases) AS purchases FROM amazon_attributed_events_by_traffic_time WHERE purchases = 1 GROUP BY 1
Correct Answer
SELECT campaign, COUNT(DISTINCT user_id) AS purchasers, SUM(purchases) AS purchases FROM amazon_attributed_events_by_traffic_time WHERE purchases = 1 GROUP BY 1