Multiple choice technology programming languages

Which PROC SQL query will remove duplicate values of MemberType from the query output, so that only the unique values are listed?

  1. proc sql nodup; select membertype from sasuser.frequentflyers;

  2. proc sql; select distinct(membertype) as MemberType from sasuser.frequentflyers;

  3. proc sql; select unique membertype from sasuser.frequentflyers group by membertype;

  4. proc sql; select distinct membertype from sasuser.frequentflyers;

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

SELECT DISTINCT in PROC SQL removes duplicate values from query output by eliminating rows where all selected columns have identical values. Option A's NODUP syntax is invalid, Option B incorrectly uses DISTINCT as a function, and Option C unnecessarily adds GROUP BY.