Advance SAS Certification Quiz

10 Questions | Total Attempts: 242

SettingsSettingsSettings
Advance SAS Certification Quiz - Quiz

Practice for the Advance SAS certification exam.


Questions and Answers
  • 1. 
    Which PROC SQL query will remove duplicate values of MemberType from the query output, so that only the unique values are listed?
    • A. 

      Proc sql nodup; select membertype from sasuser.frequentflyers;

    • B. 

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

    • C. 

      Proc sql; select unique membertype from sasuser.frequentflyers group by member type;

    • D. 

      Proc sql; select distinct membertype from sasuser.frequentflyers;

  • 2. 
    Which of the following will cause PROC SQL to list rows that have no data in the address column?
    • A. 

      Where address is missing

    • B. 

      Where address not exists

    • C. 

      Where address is null

    • D. 

      Both a and c

  • 3. 
    You are creating a PROC SQL query that will list all employees who have spent (or overspent) their allotted 120 hours of vacation for the current year. The hours that each employee used are stored in the existing column Spent. Your query defines a new column, Balance, to calculate each employee's balance of vacation hours. Which query will produce the report that you want?
    • A. 

      Proc sql; select name, spent, 120-spent as calculated Balance rom Company.Absences where balance <= 0;

    • B. 

      Proc sql; select name, spent, 120-spent as Balance from Company.Absences where calculated balance <= 0;

    • C. 

      Proc sql; select name, spent, 120-spent as Balance from Company.Absences where balance <= 0;

    • D. 

      Proc sql; select name, spent, 120-spent as calculated Balance from Company.Absences where calculated balance <= 0;

  • 4. 
    Consider this PROC SQL query: proc sql; select flightnumber, count(*) as Flights, avg(boarded) label="Average Boarded" format=3. from sasuser.internationalflights group by flightnumber having avg(boarded) > 150; The table Sasuser.Internationalflights contains 201 rows, 7 unique values of FlightNumber, 115 unique values of Boarded, and 4 different flight numbers that have an average value of Boarded that is greater than 150. How many rows of output will the query generate?
    • A. 

      150

    • B. 

      7

    • C. 

      4

    • D. 

      1

  • 5. 
    You are writing a PROC SQL query that will display the names of all library cardholders who work as volunteers for the library, and the number of books each volunteer currently has checked out. You will use one or both of the following tables: List.Circulation lists the name and contact information for all library cardholders, and the number of books that each cardholder currently has checked out. Library.Volunteers lists the name and contact information for all library volunteers. Assume that the values of Name are unique in both tables. Which query will produce your report?
    • A. 

      Proc sql; select name, checkedout from library.circulation where * in (select * from library.volunteers);

    • B. 

      Proc sql; select name, checkedout from library.circulation where name in (select name from library.volunteers);

    • C. 

      Proc sql; select name from library.volunteers where name, checkedout in (select name, checkedout from library.circulation);

    • D. 

      Proc sql; select name, checkedout from library.circulation where name in (select name from library.volunteers;);

  • 6. 
    By definition, a noncorrelated subquery is a nested query that
    • A. 

      Returns a single value to the outer query.

    • B. 

      Contains at least one summary function.

    • C. 

      Executes independently of the outer query.

    • D. 

      Requires only a single value to be passed to it by the outer query.

  • 7. 
    Which statement about the following PROC SQL query is false? proc sql; validate select name label='Country', rate label='Literacy Rate' from world.literacy where 'Asia' = (select continent from world.continents where literacy.name = continents.country) order by 2;
    • A. 

      The query syntax is not valid.

    • B. 

      The outer query must pass values to the subquery before the subquery can return values to the outer query.

    • C. 

      The outer query must pass values to the subquery before the subquery can return values to the outer query.

    • D. 

      After the query is submitted, the SAS log will indicate whether the query has valid syntax.

  • 8. 
    Consider the following PROC SQL query: proc sql; select lastname, firstname, total, since from charity.donors where not exists (select lastname from charity.current where donors.lastname = current.lastname); The query references two tables: • Charity.Donors lists name and contact information for all donors who have made contributions since the charity was founded. The table also contains these two columns: Total, which shows the total dollars given by each donor, and Since, which stores the first year in which each donor gave money. • Charity.Current lists the names of all donors who have made contributions in the current year, and the total dollars each has given this year (YearTotal). Assume that the values of LastName are unique in both tables. The output of this query displays
    • A. 

      All donors whose rows do not contain any missing values.

    • B. 

      All donors who made a contribution in the current year.

    • C. 

      All donors who did not make a contribution in the current year.

    • D. 

      Ll donors whose current year's donation in Charity.Current has not yet been added to Total in Charity.Donors.

  • 9. 
    Which statement about data remerging is true?
    • A. 

      When PROC SQL remerges data, it combines data from two tables.

    • B. 

      By using data remerging, PROC SQL can avoid making two passes through the data.

    • C. 

      When PROC SQL remerges data, it displays a related message in the SAS log.

    • D. 

      PROC SQL does not attempt to remerge data unless a subquery is used.

  • 10. 
    A public library has several categories of books. Each book in the library is assigned to only one category. The table Library.Inventory contains one row for each book in the library. The Checkouts column indicates the number of times that each book has been checked out. You want to display only the categories that have an average circulation (number of checkouts) that is less than 2500.  Does the following PROC SQL query produce the results that you want? proc sql; title 'Categories with Average Circulation'; title2 'Less Than 2500'; select category, avg(checkouts) as AvgCheckouts from library.inventory having avg(checkouts) < 2500 order by 1;
    • A. 

      No. This query will not run because a HAVING clause cannot contain a summary function.

    • B. 

      No. This query will not run because the HAVING clause must include the CALCULATED keyword before the summary function.

    • C. 

      No. Because there is no GROUP BY clause, the HAVING clause treats the entire table as one group.

    • D. 

      Yes

Related Topics
Back to Top Back to top