Chapter 1: Performing Queries Using Proc SQL

10 Questions | Total Attempts: 271

SettingsSettingsSettings
Please wait...
Chapter 1: Performing Queries Using Proc SQL

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


Questions and Answers
  • 1. 
    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;
    • A. 

      SELECT

    • B. 

      FROM

    • C. 

      WHERE

    • D. 

      Both a and c

  • 2. 
    How many statements does the program below contain? proc sql; select grapes, oranges, grapes + oranges as sumsales from sales.produce order by sumsales;
    • A. 

      Two

    • B. 

      Three

    • C. 

      Four

    • D. 

      Five

  • 3. 
    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;
    • A. 

      Select address, sqfeet, price

    • B. 

      Select size.address, sqfeet, price

    • C. 

      Select price.address, sqfeet, price

    • D. 

      Either B or C

  • 4. 
    Which of the clauses below correctly sorts rows by the values of the columns Price and SqFeet?
    • A. 

      Order price, sqfeet

    • B. 

      Order by price, sqfeet

    • C. 

      Sort by price sqfeet

    • D. 

      Sort price sqfeet

  • 5. 
    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.
    • A. 

      Select sales.produce sales.hardware

    • B. 

      From sales.produce sales.hardware

    • C. 

      From sales.produce, sales.hardware

    • D. 

      Where sales.produce, sales.hardware

  • 6. 
    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, _____________
    • A. 

      Profit=price-cost

    • B. 

      Price-cost as Profit

    • C. 

      Profit= price-cost

    • D. 

      Profit as price-cost

  • 7. 
    What happens if you use a GROUP BY clause in a PROC SQL step without a summary function?
    • A. 

      The step does not execute.

    • B. 

      The first numeric column is summed by default.

    • C. 

      The GROUP BY clause is changed to an ORDER BY clause

    • D. 

      The step executes but does not group or sort data.

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

      the results of the query are displayed, and a new table is created.

    • B. 

      A new table is created, but it does not contain any summarization that was specified in the PROC SQL step.

    • C. 

      A new table is created, but no report is displayed.

    • D. 

      Results are grouped by the value of the summarized column.

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

      When you join multiple tables, the tables must contain a common column.

    • B. 

      You must specify the table from which you want each column to be read.

    • C. 

      The tables that are being joined must be from the same type of data source.

    • D. 

      If two tables that are being joined contain a same-named column, thenn you must specify the table from which you want the column to be read.

  • 10. 
    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;
    • A. 

      SELECT

    • B. 

      FROM

    • C. 

      WHERE

    • D. 

      GROUP BY

Related Topics
Back to Top Back to top