MySQL Subquery
- Which of these operators does not perform relative-value comparisons?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The operators =, < >, >, >=, <, and <= perform relative value comparisons in MySQL. ‘==’ is not a valid comparison operator in MySQL. Such operators are useful in filtering information from a table.
- Which subquery cannot be executed by itself as a separate statement?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
An uncorrelated subquery contains references to the values from the outer query. So, it is dependent on it. Therefore, a correlated subquery cannot be executed by itself as a separate statement.
- An uncorrelated subquery does not contain any reference to the values from the outer query.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
MySQL has two kinds of subqueries, namely, uncorrelated subquery and correlated subquery. An uncorrelated subquery does not contain any reference to the values from the outer query.
- Which operators test whether a subquery returns any rows?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
The operators ‘EXISTS’ and ‘NOT EXISTS’ operators only test whether a subquery returns any rows. If it returns a row, ‘EXISTS’ results into true and ‘NOT EXISTS’ results into false.
- Which of these operators perform similar operations like ALL and ANY?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The operators ‘SOME’, ‘ALL’ and ‘ANY’ perform operations on columns. They can filter column results. They are used in conjunction with a comparison operator in order to test the result of a column subquery.