duminică, 4 aprilie 2010

Test: Quiz: Multiple-Row Subqueries

Section 1

1. The SQL multiple-row subquery extends the capability of the single-row syntax through the use of what three comparison operators? Mark for Review
(1) Points


IN, ANY and EQUAL


IN, ANY and ALL (*)


IN, ANY and EVERY


IN, ALL and EVERY






2. There can be more than one subquery returning information to the outer query. True or False? Mark for Review
(1) Points


True (*)


False






3. The salary column of the f_staffs table contains the following values:
4000
5050
6000
11000
23000

Which of the following statements will return the last_name and first_name of those employees who earn more than 5000.
Mark for Review
(1) Points


SELECT last_name, first_name
FROM f_staffs
WHERE salary = (SELECT salary FROM f_staffs WHERE salary > 5000);



SELECT last_name, first_name
FROM f_staffs
WHERE salary = (SELECT salary FROM f_staffs WHERE salary <>



SELECT last_name, first_name
FROM f_staffs
WHERE salary IN (SELECT salary FROM f_staffs WHERE salary > 5000);

(*)


SELECT last_name, first_name
FROM f_staffs
WHERE salary IN
(SELECT last_name, first_name FROM f_staffs WHERE salary < 5000);







4. Multiple-row subqueries must have NOT, IN or ANY in the WHERE clause of the inner query. True or False? Mark for Review
(1) Points


True


False (*)






5. When a multiple-row subquery uses the NOT IN (<>ALL) operator, if one of the values returned by the inner query is a null value, the entire query returns: Mark for Review
(1) Points


A list of Nulls


All rows that were selected by the inner query including the null value(s)


All rows, minus the null value(s), that were selected by the inner query


No rows returned (*)






6. Group functions, such as HAVING and GROUP BY can be used in multiple-row subqueries. True or False? Mark for Review
(1) Points


True (*)


False






7. In a subquery the ALL operator compares a value to every value returned by the inner query. True or False? Mark for Review
(1) Points


True (*)


False






8. Group functions can be used in subqueries even though they may return many rows. True or False? Mark for Review
(1) Points


True (*)


False





( Vrei sa traduci ceva?Want to translate something? http://translate.google.ro/# )

Niciun comentariu:

Trimiteți un comentariu