SAS_Institute
A00-212 · Question #47
Given the SAS data set ONE: ONE REP COST -------- ------- SMITH 200 SMITH 400 JONES 100 SMITH 600 JONES 100 The following SAS program is submitted: proc sql; select rep, avg(cost) as AVERAGE from…
The correct answer is C. having avg(cost) > (select avg(cost) from one). See the full explanation below for the reasoning.
Question
Given the SAS data set ONE:
ONE REP COST -------- ------- SMITH 200 SMITH 400 JONES 100 SMITH 600 JONES 100 The following SAS program is submitted:
proc sql; select rep, avg(cost) as AVERAGE from one group by rep <insert SQL procedure clause here> quit; The following output is desired:
REP AVERAGE ---------- --------- SMITH 400 Which SQL procedure clause completes the program and generates the desired output?
Options
- Ahaving avg(cost) < select avg(cost) from one);
- Bwhere avg(cost) > (select avg(cost) from one);
- Chaving avg(cost) > (select avg(cost) from one);
- Dwhere calculated average > (select avg(cost) from one);
How the community answered
(33 responses)- A9% (3)
- B3% (1)
- C76% (25)
- D12% (4)
Community Discussion
No community discussion yet for this question.