James Blair
Test por , creado hace más de 1 año

Moodle Chapter 1 Quiz

33
2
0
James Blair
Creado por James Blair hace más de 9 años
Cerrar

Chapter 1 Quiz

Pregunta 1 de 10

1

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;

Selecciona una de las siguientes respuestas posibles:

  • GROUP BY

  • FROM

  • WHERE

  • SELECT

Explicación

Pregunta 2 de 10

1

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

Selecciona una de las siguientes respuestas posibles:

  • two

  • three

  • four

  • five

Explicación

Pregunta 3 de 10

1

Which of the clauses below correctly sorts rows by the values of the columns Price and SqFeet?

Selecciona una de las siguientes respuestas posibles:

  • a. order by price, sqfeet

  • b. order price, sqfeet

  • c. sort price sqfeet

  • d. sort by price sqfeet

Explicación

Pregunta 4 de 10

1

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.Price. (Only the Address column appears in both tables.)
proc sql;
__________
from list.size, list.price;

Selecciona una de las siguientes respuestas posibles:

  • a. Either select size.address, sqfeet, price or select price.address, sqfeet, price

  • b. select size.address, sqfeet, price

  • c. select price.address, sqfeet, price

  • d. select address, sqfeet, price

Explicación

Pregunta 5 de 10

1

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

Selecciona una de las siguientes respuestas posibles:

  • a. The first numeric column is summed by default.

  • b. The GROUP BY clause is changed to an ORDER BY clause.

  • c. The step does not execute.

  • d. The step executes but does not group or sort data.

Explicación

Pregunta 6 de 10

1

Which of the following will cause PROC SQL to list rows that have no data in the Address column?

Selecciona una de las siguientes respuestas posibles:

  • a. WHERE address is null

  • b. WHERE address not exists

  • c. WHERE address is missing

  • d. Both WHERE address is missing and WHERE address is null

Explicación

Pregunta 7 de 10

1

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?

Selecciona una de las siguientes respuestas posibles:

  • a. 1

  • b. 150

  • c. 4

  • d. 7

Explicación

Pregunta 8 de 10

1

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 that each volunteer currently has checked out. You will use one or both of the following tables:
Library.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 of the following PROC SQL queries will produce your report?

Selecciona una de las siguientes respuestas posibles:

  • a. proc sql;
    select name
    from library.volunteers
    where name, checkedout in
    (select name, checkedout
    from library.circulation);

  • b. proc sql;
    select name, checkedout
    from library.circulation
    where name in
    (select name
    from library.volunteers);

  • c. proc sql;
    select name, checkedout
    from library.circulation
    where name in
    (select name
    from library.volunteers;);

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

Explicación

Pregunta 9 de 10

1

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?

Selecciona una de las siguientes respuestas posibles:

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

  • b. proc sql;
    select name, spent,
    120-spent as calculated 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 Balance
    from Company.Absences
    where calculated balance <= 0;

Explicación

Pregunta 10 de 10

1

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;

Selecciona una de las siguientes respuestas posibles:

  • a. PROC SQL will not execute this query when it is submitted.

  • b. The query syntax is not valid.

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

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

Explicación