Week 13 Flashcards

Sub-queries and MERGE statements

1
Q

Returns to the outer query one row of results consisting of one column only.

A. Correlated subquery
B. multiple-row subquery
C. single-row subquery
D. multiple-column subquery

A

C. single-row subquery

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What operator is used when you need to compare against individual data?

A

WHERE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What operator is used when the returned value is compared to grouped data?

A

HAVING

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which of the following is NOT used in a multiple-row subquery?

A. Any
B. All
C. In
D. =

A

D. =

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A ____ subquery references one or more columns in the outer query and tests whether the relationship or link is present.

A

correlated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The ____operator is used in a correlated subquery.

A

EXISTS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

T/F: A MERGE statement takes one table and merges it into another table and must include what to do when the data is present and when it is not present.

A

True

Use WHEN MATCHED THEN
and a WHEN NOT MATCHED THEN statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

A subquery must contain at a minimum what two operators?

A

SELECT and FROM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

T/F:

IN is not a valid operator for a multiple-column subquery.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

T/F: A subquery nested in a SELECT clause cannot contain an ORDER BY clause.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

T/F:

A multiple-column subquery cannot be nested in a WHERE clause

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A complete query nested inside another query is called a(n) ____.

A

subquery

How well did you know this?
1
Not at all
2
3
4
5
Perfectly