SELECT total_impressions SUM (impressions) AS device_type FROM campaign, supply_source GROUP BY 1,2,3 SELECT campaign, supply_source, SUM (impressions) AS impressions FROM device_type GROUP BY 1,2 SELECT campaign, supply_source, device_type, SUM (impressions) AS impressions FROM dsp_impressions GROUP BY 1,2,3 The correct answer is: SELECT campaign, supply_source, device_type, SUM (impressions) AS impressions FROM dsp_impressions GROUP BY 1,2,3 Explanation: The correct query to get the total impressions delivered per campaign, per supply source, and per device type is: SQL SELECT campaign, supply_source, device_type, SUM(impressions) AS impressions FROM dsp_impressions GROUP BY 1, 2, 3 ✅ Explanation of the Query This is a standard and efficient SQL query structure for use in Amazon Marketing Cloud (AMC) .
Select all correct answers
Correct Answers
SELECT campaign, supply_source, device_type, SUM(impressions) AS impressions : It selects the three dimensions ( campaign , supply_source , and device_type ) that you want to see individually.
It uses the aggregation function SUM(impressions) to calculate the total number of impressions for each unique combination of the three dimensions.
AS impressions gives the aggregated result column a clear name.
FROM dsp_impressions : Impressions for Amazon DSP campaigns are found in the dsp_impressions table in AMC. This table contains the necessary dimensions and the impressions metric.
GROUP BY 1, 2, 3 : This is the essential step for aggregation. The GROUP BY clause groups all rows that have the same values in the specified columns ( campaign , supply_source , device_type ).
Using the ordinal column numbers ( 1, 2, 3 ) is a common and concise way to reference the columns in the SELECT statement in many SQL dialects, including AMC SQL. This ensures the SUM(impressions) calculation is done separately for every unique combination of the three grouping dimensions.
Topics in this question
About the Amazon Marketing Cloud Certification
The Amazon Marketing Cloud Certification covers Amazon's clean-room analytics environment: how AMC data is structured, writing SQL queries against it, and turning results such as overlap and path-to-conversion analysis into audience and media decisions.
Exam guide and all 95 Amazon Marketing Cloud questions →Related Amazon Marketing Cloud questions
- 1SELECT supply_source, SUM (total_cost)/100000000 AS total_cost_dollars, ((SUM (total_cost)/100000000)/SUM (impressions)) *1000 AS avg_cpm, SUM (impressions) AS impressions FROM dsp_inventory GROUP BY 1 SELECT supply_source, SUM (total_cost)/100000 AS total_cost_dollars, ((SUM (total_cost)/100000)/SUM (impressions)) *1000 AS avg_cpm, SUM (impressions) AS impressions FROM dsp_impressions GROUP BY 1,2 SELECT supply_source, SUM (total_cost)/100000 AS total_cost_dollars, ((SUM (total_cost)/100000)/SUM (impressions)) *1000 AS avg_cpm, SUM (impressions) AS impressions FROM dsp_impressions GROUP BY 1 The correct answer is: SELECT supply_source, SUM (total_cost)/100000 AS total_cost_dollars, ((SUM (total_cost)/100000)/SUM (impressions)) *1000 AS avg_cpm, SUM (impressions) AS impressions FROM dsp_impressions GROUP BY 1 Explanation: That’s the correct query. Here is an explanation of the adaptation and why it works: The adapted query focuses on aggregating the desired metrics at the supply_source level, utilizing fields available in the dsp_impressions table: SQL SELECT supply_source, SUM(total_cost) / 100000 AS total_cost_dollars, ((SUM(total_cost) / 100000) / SUM(impressions)) * 1000 AS avg_cpm, SUM(impressions) AS impressions FROM dsp_impressions GROUP BY 1 🔍 Explanation of Changes The core principle of the adaptation is to replace the previous grouping dimensions with the single dimension required: supply_source .Multiple correct
- 2You are writing a query and would like to know the total impressions that have been delivered per campaign, per supply_source, and per device_type. Which of the following represents how you should write the query?
- 3How would you adapt this query to limit results to Sponsored Products keyword targeting only? SELECT ad_product_type, targeting, customer_search_term, match_type, SUM (spend)/100000000 AS total_cost_dollars, ((SUM (spend)/100000000)/SUM (impressions)) *1000 AS avg_cpm, SUM (impressions) AS impressions, SUM (clicks) AS clicks, (SUM (clicks)/SUM (impressions)) AS ctr FROM sponsored_ads_traffic WHERE match_type IN (‘PHRASE’, ‘BROAD’, ‘EXACT’) GROUP BY 1,2,3,4
- 4Which table should you use in a query meant to help you choose new Amazon audiences that may benefit your Amazon DSP campaign performance?
- 5Why would this query fail? SELECT campaign, SUM(impressions) AS impressions FROM dsp_impressions
- 6Which of the following Amazon services can be used to visualize aggregated AMC reports in a dashboard?