Advance SAS Certification Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Moxleyv
M
Moxleyv
Community Contributor
Quizzes Created: 38 | Total Attempts: 21,992
| Attempts: 412 | Questions: 10
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. Which of the following will cause PROC SQL to list rows that have no data in the address column?

Explanation

To list rows that have no data (that is, missing data), you can use either of these other conditional operators: IS MISSING or IS NULL. The NOT EXISTS operator is used specifically with a subquery, and resolves to true if the subquery returns no values to the outer query.

Submit
Please wait...
About This Quiz
Advance SAS Certification Quiz - Quiz

This Advanced SAS certification quiz assesses key skills in SQL query formulation within SAS, focusing on data manipulation, query optimization, and understanding of database interactions crucial for advanced... see moredata analysis roles. see less

2. 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

Explanation

In this PROC SQL query, the outer query uses the operator NOT EXISTS with a correlated subquery. The outer query selects all rows from Charity.Donors whose names do not appear in Charity.Current. In other words, this PROC SQL query output lists all donors who did not make a contribution in the current year.

Submit
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?

Explanation

When a WHERE clause references a new column that was defined in the SELECT clause, the WHERE clause must specify the keyword CALCULATED before the column name.

Submit
4. By definition, a noncorrelated subquery is a nested query that

Explanation

A noncorrelated subquery is a nested query that executes independently of the outer query. The outer query passes no values to the subquery.

Submit
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?

Explanation

Your PROC SQL query needs to use data from both tables. The outer query reads the name and number of books checked out from Library.Circulation. The multiple-value noncorrelated subquery selects the names of volunteers from Library.Volunteers and passes these names back to the outer query. The outer query then selects data for only the volunteers whose names match names returned by the subquery. The subquery is indented under the outer query's WHERE clause, is enclosed in parentheses, and does not require a semicolon inside the closing parenthesis.

Submit
6. 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?

Explanation

To determine how PROC SQL calculates and displays output from summary functions, consider the key factors. This PROC SQL query has a GROUP BY clause, and it does not specify any columns that are outside of summary functions. Therefore, PROC SQL calculates and displays the summary function for each group. There are 7 unique values of FlightNumber, but the HAVING clause specifies only the flights that have an average number of boarded passengers greater than 150. Because 4 of the 7 flight numbers meet this condition, the output will contain 4 rows.

Submit
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;

Explanation

The syntax in this PROC SQL query is valid, so the first statement is false. The query contains a correlated subquery, so the second statement is true. The VALIDATE keyword is used after the PROC SQL statement, so the third statement is true. And the last statement correctly indicates that the VALIDATE keyword causes the SAS log to display a special message if the query syntax is valid, or standard error messages if the syntax is not valid.

Submit
8. 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;

Explanation

PROC SQL can execute this query, but the query will not produce the results that you want. If you omit the GROUP BY clause in a query that contains a HAVING clause, then the HAVING clause and any summary functions treat the entire table as one group. Without a GROUP BY clause, the HAVING clause in this example calculates the average circulation for the table as a whole (all books in the library), not for each group (each category of books). The output contains either all the rows in the table (if the average circulation for the entire table is less than 2500) or none of the rows in the table (if the average circulation for the entire table is greater than 2500).

Submit
9. Which statement about data remerging is true?

Explanation

not-available-via-ai

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

Explanation

to remove duplicate values from the PROC SQL output, you specify the DISTINCT keyword before the column name in the SELECT clause.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 20, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 06, 2013
    Quiz Created by
    Moxleyv
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which of the following will cause PROC SQL to list rows that have no...
Consider the following PROC SQL query:...
You are creating a PROC SQL query that will list all employees who...
By definition, a noncorrelated subquery is a nested query that
You are writing a PROC SQL query that will display the names of all...
Consider this PROC SQL query:...
Which statement about the following PROC SQL query is false?...
A public library has several categories of books. Each book in the...
Which statement about data remerging is true?
Which PROC SQL query will remove duplicate values of MemberType from...
Alert!

Advertisement