Exam A00-212 All QuestionsBrowse all questions from this exam
Question 3

Given the following SAS data set ONE:

ONE -

REP COST -

SMITH 200 -

SMITH 400 -

JONES 100 -

SMITH 600 -

JONES 100 -

JONES 200 -

JONES 400 -

SMITH 800 -

JONES 100 -

JONES 300 -

The following SAS program is submitted:

proc sql;

select rep, avg(cost) as AVERAGE

from one

group by rep

having avg(cost) > (select avg(cost) from one);

quit;

Which one of the following reports is generated?

    Correct Answer: C

    To determine the correct result, let's examine the SQL code provided: `proc sql; select rep, avg(cost) as AVERAGE from one group by rep having avg(cost) > (select avg(cost) from one); quit;`. This code calculates the average cost for each representative and includes only those representatives whose average cost is greater than the overall average cost of all records. Calculating the overall average cost: (200 + 400 + 100 + 600 + 100 + 200 + 400 + 800 + 100 + 300) / 10 = 320. Next, we calculate the average cost per representative: SMITH: (200 + 400 + 600 + 800) / 4 = 500, JONES: (100 + 100 + 200 + 400 + 100 + 300) / 6 = 200. Since 500 (Smith's average) is greater than 320 (overall average), and 200 (Jones's average) is not, the correct report will show SMITH with an average of 500.

Discussion
mhminkovOption: C

REP AVERAGE SMITH 500