Which two of the examples above have correct System.debug statements? (Choose two.)

Which two of the examples above have correct System.debug statements? (Choose two.)

Example 1:

AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) FROM

Opportunity GROUP BY CampaignId];

for (AggregateResult ar : groupedResults)

{

System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));

System.debug(‘Average amount’ + ar.get(‘expr0’));

}

Example 2:

AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) theAverage

FROM Opportunity GROUP BY CampaignId];

for (AggregateResult ar : groupedResults)

{

System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));

System.debug(‘Average amount’ + ar.get(‘theAverage’));

}

Example 3:

AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) FROM

Opportunity GROUP BY CampaignId];

for (AggregateResult ar : groupedResults)

{

System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));

System.debug(‘Average amount’ + ar.get.AVG());

}

07B13F58239056B81577933EB624485B

Example 4:

AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) theAverage

FROM Opportunity GROUP BY CampaignId];

for (AggregateResult ar : groupedResults)

{

System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));

System.debug (‘Average amount’ + ar.theAverage);

}
A . Example 1
B . Example 2
C . Example 3
D . Example 4

Answer: AB

Latest PDII Dumps Valid Version with 280 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments