Multiple choice technology programming languages

Which Proc sql will be used to determine the total number of miles traveled by frequent-flyer program members in each of three membership classes (Gold, Silver, and Bronze). Frequent-flyer program information is stored in the table Frequentflyers. MemberType TotalMiles Bronze 908786767 Gold 57665868 Silver 34343656

  1. proc sql; select membertype sum(milestraveled) as TotalMiles from frequentflyers group by membertype;

  2. proc sql; select membertype sum(milestraveled) as TotalMiles from frequentflyers order by membertype;

  3. proc sql; select membertype milestraveled sum(milestraveled) as TotalMiles from sasuser.frequentflyers group by membertype;

  4. proc sql; select membertype sum(milestraveled) from frequentflyers group by membertype;

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

To get total miles by membership type, use SUM(milestraveled) as the aggregate function with GROUP BY membertype. Option A correctly uses both SUM() and GROUP BY to calculate totals for each category. Option B uses ORDER BY instead of GROUP BY, which sorts but doesn't aggregate. Option C includes an unaggregated column, and Option D omits the alias for the calculated column.