Chapter 1: Performing Queries Using Proc SQL

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: 618 | Questions: 10
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. Which of the clauses below correctly sorts rows by the values of the columns Price and SqFeet?

Explanation

The ORDER BY clause specifies how the rows are to be sorted. You follow the keywords ORDER BY one or more column names or numbers, separated by columns.

Submit
Please wait...
About This Quiz
Chapter 1: Performing Queries Using Proc SQL - Quiz

Structured Query Language is a domain-specific language used in programming and designed for managing data held in a relational database management system or for stream processing in a... see morerelational data stream management system. Do you understand how to perform queries using proc SQL? Take up the quiz blow and get to review what you learn it Chapter 1 in preparation for the advanced SAS certification exam that is coming up.
see less

2. Which of the following clauses in the PROC SQL program below is written incorrectly?

proc sql;
select style sqfeet
bedrooms
from choice.houses
where sqfeet ge 800;

Explanation

The SELECT clause in the program is written incorrectly. Columns that are listen in the clause must be separated by commas, not just blanks.

Submit
3. Which clause below specifies that the two tables Produce and Hardware be queried? Both tables are located in a library to which the libref Sales has been assigned.

Explanation

In the FROM clause, you list the names of the tables to be queried, separated by commas.

Submit
4. Complete the SELECT clause below to create a new column named Profit by subtracting the values of the column Cost from those of the column Price.

select fruit,cost,price, _____________

Explanation

To create a new column and assign a column alias to the column, you specify the following in the SELECT clause, in the order shown here: an expression, (optionally) the keyword AS, and column alias. The case that you use when you create the column name is the one that will be displayed in the output.

Submit
5. Which clause in the following program is incorrect?

proc sql;
select sex, mean(weight) as avgweight
from company.employees company.health  where employees.id=health.id
group by sex;

Explanation

Tables in the from statement must be separated by a comma (,)

Submit
6. What happens if you use a GROUP BY clause in a PROC SQL step without a summary function?

Explanation

The GROUP BY clause is used in queries that include one or more summary functions. If you specify a GrOUP BY clause in a query that does not contain a summary function, it is changed to an ORDER BY clause.

Submit
7. How many statements does the program below contain?

proc sql;
select grapes, oranges, grapes + oranges as
sumsales
from sales.produce
order by sumsales;

Explanation

There are two statements, the PROC SQL statement and the SELECT statement. The SELECT statement contains three clauses.

Submit
8. If you specify a CREATE TABLE statement in your PROC SQL step,

Explanation

The CREATE TABLE statement enables you to store your results in a SAS table instead of displaying the query results as a report.

Submit
9. Which statement is true regarding the use of the PROC SQL step to query data that is stored in two or more tables?

Explanation

When using the PROC SQL step to query data from multiple tables, if there are two tables being joined that have a column with the same name, you must specify the table from which you want to retrieve the column. This is necessary to avoid any ambiguity and ensure that the correct column is selected from the appropriate table.

Submit
10. Complete the following PROC SQL query to select the columns Address and SqFeet from the table List.Size and to select Price from the table List.Proce. (Only the Address column appears in both tables.)

proc sql;
___________ where size.address = price.address; from list.size, list.price;

Explanation

The SELECT clause lists the columns from both tables to be queried. You must use a prefix with the Address column because it appears in both tables. The prefix specifies the table from which you want the column to be read.

Submit
View My Results

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

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

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 04, 2013
    Quiz Created by
    Moxleyv
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which of the clauses below correctly sorts rows by the values of the...
Which of the following clauses in the PROC SQL program below is...
Which clause below specifies that the two tables Produce and Hardware...
Complete the SELECT clause below to create a new column named Profit...
Which clause in the following program is incorrect?...
What happens if you use a GROUP BY clause in a PROC SQL step without a...
How many statements does the program below contain?...
If you specify a CREATE TABLE statement in your PROC SQL step,
Which statement is true regarding the use of the PROC SQL step to...
Complete the following PROC SQL query to select the columns Address...
Alert!

Advertisement