Deck 12: Subqueries and Merge Statements
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/131
Play
Full screen (f)
Deck 12: Subqueries and Merge Statements
1
When a multiple-column subquery is used in the outer query's FROM clause,it creates a temporary table,called an inline view,that can be referenced by other clauses of the outer query.
True
2
A subquery is a complete query nested inside another query.
True
3
The results of the outer query are passed to the inner query.
False
4
A multiple-column subquery cannot be nested in a WHERE clause.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
5
A group function cannot be included in the SELECT clause of a single-row subquery.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
6
The
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
7
The EXISTS operator can be used with multiple-row subqueries.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
8
When a multiple-column subquery is used in the WHERE clause of the outer query,the column names listed on the left side of the comparison operator must be enclosed in double-quotation marks.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
9
A multiple-row subquery can be nested in a HAVING clause.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
10
When used with a multiple-row subquery,the IN operator indicates that the records processed by the outer query must match one of the values returned by the subquery.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
11
Valid single-row operators include =,>,<,>=,<=.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
12
A correlated subquery references one or more columns in the outer query,and the EXISTS operator is used to test whether the relationship or link is present.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
13
If a subquery is nested in a HAVING clause,the subquery must be on the right side of the comparison operator.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
14
Multiple-row subqueries are nested queries that can return more than one row of results to the parent query.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
15
A single-row subquery can return several columns,but only one row,of results to the outer query.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
16
Single-row operators can be used with multiple-row subqueries that return only one column of results.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
17
The equal sign,=,is a valid single-row operator.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
18
A subquery nested in a SELECT clause cannot contain an ORDER BY clause.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
19
A subquery can only be nested in the WHERE or HAVING clause of the outer query.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
20
A single-row subquery can be nested in the SELECT clause of the outer function.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
21
A(n)single-row subquery can be nested in a(n)SELECT clause._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
22
The
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
23
The greater than operator,>,is a valid operator for multiple-row subqueries._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
24
In Oracle12c,subqueries can be nested to a depth of 255 in a WHERE clause.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
25
A subquery must be enclosed in a set of quotation marks._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
26
A subquery is required when the condition for the inner query is based upon an unknown._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
27
In Oracle12c,a MERGE statement compares data between two tables and can perform a series of DML actions to assist in synchronizing the data of the two tables.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
28
A subquery is required when the condition for the outer query is based upon an unknown.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
29
When the subquery is executed first and the value is passed back as input to the outer query,the subquery is known as an uncorrelated subquery.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
30
IN is a valid multiple-row subquery operator._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
31
The results of the subquery are passed to the inner query._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
32
A(n)outer query is also referred to as a parent query._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
33
A subquery nested in a WHERE clause can only be on the left side of the comparison operator._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
34
A correlated subquery is a subquery that is executed once for each row in the outer query.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
35
Valid multiple-row operators include =,>,<,>=,<=._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
36
A correlated subquery is one in which the inner query is executed first,and then the outer query is executed.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
37
The NVL function can be used in a subquery.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
38
When a multiple-column subquery is included in the outer query's WHERE clause,the column names listed in the WHERE clause must be in the same order as they're listed in the subquery's SELECT clause.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
39
A subquery,except one in the FROM clause,can't have an ORDER BY clause._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
40
IN is not a valid operator for a multiple-column subquery.
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
41
A(n)correlated subquery is when the outer query is executed first,and then the inner query is executed._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
42
The outer query receives its input from the ____.
A) inner view
B) outer view
C) nested function
D) subquery
A) inner view
B) outer view
C) nested function
D) subquery
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
43
A(n)uncorrelated subquery is when the outer query is executed first,then the inner query is executed._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
44
An outer query is also referred to as a(n)____ query.
A) parent query
B) outer view
C) outline view
D) all of the above
A) parent query
B) outer view
C) outline view
D) all of the above
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
45
A(n)GROUP BY clause can be used in a subquery._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
46
The EXISTED operator is used to determine whether a condition is present in a subquery._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
47
A(n)correlated subquery references one or more columns from the outer query._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
48
When a multiple-column subquery is used in the WHERE clause of the outer query,the column names listed on the left side of the comparison operator must be enclosed in single-quotation marks._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
49
The =ANY operator yields the same results as using the IN multiple-row operator._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
50
In Oracle12c,there is no depth limit on the number of subqueries that can be nested in a(n)FROM clause._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
51
Which of the following can be used in a WHERE clause?
A) single-row subquery
B) multiple-column subquery
C) multiple-row subquery
D) all of the above
A) single-row subquery
B) multiple-column subquery
C) multiple-row subquery
D) all of the above
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
52
A multiple-column subquery nested in the SELECT clause of the outer query is known as an inline view._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
53
The IN operator can be used with single-row,multiple-row,or multiple-column subqueries._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
54
You can include multiple subqueries in a SELECT statement._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
55
The IN operator is valid for multiple-row subqueries._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
56
A group function can be used in a(n)inline view._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
57
A complete query nested inside another query is called a(n)____
A) inner view
B) subquery
C) child view
D) all of the above
A) inner view
B) subquery
C) child view
D) all of the above
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
58
Any type of subquery can be used in the ____ clause of a SELECT statement.
A) WHERE
B) HAVING
C) FROM
D) all of the above
A) WHERE
B) HAVING
C) FROM
D) all of the above
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
59
In Oracle12c,subqueries in a WHERE clause can be nested to a depth of 2._________________________
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
60
Which of the following subqueries returns more than one row of results to the outer query?
A) multiple-column subquery
B) single-row subquery
C) multiple-row subquery
D) correlated subquery
A) multiple-column subquery
B) single-row subquery
C) multiple-row subquery
D) correlated subquery
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
61
The results of a subquery are passed back as input to the ____ query.
A) inner
B) outer
C) correlated
D) uncorrelated
A) inner
B) outer
C) correlated
D) uncorrelated
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
62
The > operator is referred to as a(n)____ operator.
A) multiple-row
B) multiple-column
C) single-row
D) none of the above
A) multiple-row
B) multiple-column
C) single-row
D) none of the above
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
63
The following SQL statement contains what type of subqueries?
SELECT isbn,title FROM books WHERE pubid =
(SELECT pubid FROM books WHERE title = 'SHORTEST POEMS')
AND retail-cost >
(SELECT AVG(retail-cost)FROM books);
A) single-row
B) multiple-row
C) multiple-column
D) inline view
SELECT isbn,title FROM books WHERE pubid =
(SELECT pubid FROM books WHERE title = 'SHORTEST POEMS')
AND retail-cost >
(SELECT AVG(retail-cost)FROM books);
A) single-row
B) multiple-row
C) multiple-column
D) inline view
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
64
A subquery,except one in the FROM clause,cannot contain a(n)____ clause.
A) GROUP BY
B) HAVING
C) ORDER BY
D) WHERE
A) GROUP BY
B) HAVING
C) ORDER BY
D) WHERE
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
65
Which of the following operators is used with a multiple-row subquery?
A) IN
B) ANY
C) ALL
D) all of the above
A) IN
B) ANY
C) ALL
D) all of the above
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
66
The operators =,<,>,<=,>=,and <> are referred to as ____ operators.
A) multiple-row
B) single-row
C) correlated
D) correlated
A) multiple-row
B) single-row
C) correlated
D) correlated
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
67
The <> operator is referred to as a(n)____ operator.
A) single-row
B) multiple row
C) multiple-column
D) correlated
A) single-row
B) multiple row
C) multiple-column
D) correlated
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
68
A(n)____ subquery is one that can return several rows of results.
A) correlated
B) single-row
C) multiple-row
D) uncorrelated
A) correlated
B) single-row
C) multiple-row
D) uncorrelated
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
69
Which operators can be combined with other comparison operators to treat the results of a subquery as a set of values,rather than as individual values?
A) IN and ANY
B) IN and ALL
C) ALL and ANY
D) EXISTS and IN
A) IN and ANY
B) IN and ALL
C) ALL and ANY
D) EXISTS and IN
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
70
Which operator will instruct Oracle12c to list all records with a value that is more than the highest value returned by the subquery?
A) B) C) >ALL
D) >ANY
A)
D) >ANY
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
71
The following SQL statement contains which type of subquery?
SELECT title,retail, (SELECT AVG(retail)FROM books)
FROM books;
A) single-row
B) multiple-row
C) multiple-column
D) inline view
SELECT title,retail, (SELECT AVG(retail)FROM books)
FROM books;
A) single-row
B) multiple-row
C) multiple-column
D) inline view
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
72
A subquery must include a(n)____ clause.
A) SELECT
B) FROM
C) WHERE
D) both a and b
A) SELECT
B) FROM
C) WHERE
D) both a and b
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
73
The = operator is referred to as a(n)____ operator.
A) single-row
B) multiple-row
C) correlated
D) uncorrelated
A) single-row
B) multiple-row
C) correlated
D) uncorrelated
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
74
The ____ operator indicates that the records processed by the outer query must match one of the values returned by the subquery.
A) IN
B) >ANY
C) D) >ALL
A) IN
B) >ANY
C)
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
75
The >ALL operator indicates that a value must be ____ value returned by the subquery.query?
A) more than the highest
B) less than the highest
C) more than the lowest
D) less than the lowest
A) more than the highest
B) less than the highest
C) more than the lowest
D) less than the lowest
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
76
The following SQL statement contains which type of subquery?
SELECT title,retail,category FROM books
WHERE retail IN (SELECT MAX(retail)FROM books
GROUP BY category);
A) single-row
B) multiple-row
C) multiple-column
D) correlated
SELECT title,retail,category FROM books
WHERE retail IN (SELECT MAX(retail)FROM books
GROUP BY category);
A) single-row
B) multiple-row
C) multiple-column
D) correlated
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
77
The <= operator is referred to as a(n)____ operator.
A) multiple-row
B) correlated
C) uncorrelated
D) single-row
A) multiple-row
B) correlated
C) uncorrelated
D) single-row
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
78
Which clause is used when the group results of a subquery need to be restricted,based on some condition?
A) GROUP BY
B) HAVING
C) WHERE
D) ORDER BY
A) GROUP BY
B) HAVING
C) WHERE
D) ORDER BY
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
79
If the result returned from a subquery must be compared to a group function,then the inner query must be nested in the outer query's ____ clause.
A) GROUP BY
B) WHERE
C) HAVING
D) FROM
A) GROUP BY
B) WHERE
C) HAVING
D) FROM
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck
80
Which of the following must be used to separate a subquery from the outer query?
A) / /
B) " "
C) | |
D) ( )
A) / /
B) " "
C) | |
D) ( )
Unlock Deck
Unlock for access to all 131 flashcards in this deck.
Unlock Deck
k this deck