MySQL Subquery
- The ALL subquery performs which operation?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
The operators ‘ALL’ and ‘ANY’ are used to perform operations on columns. They are used in conjunction with a comparison operator in order to test the result of a column subquery.
- Which operators are used when a subquery returns multiple rows to be evaluated in comparison to the outer query?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
When there is a need to evaluate multiple rows in comparison to the outer query, the ‘IN’ and ‘NOT IN’ operators are used. They are used for testing whether a comparison value is present in a set of values.
- Usage of aggregates in WHERE clause is allowed.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
The usage of aggregates inside ‘WHERE’ clauses is not allowed. For example, the following statement will not work : ‘SELECT * FROM my_table WHERE attribute_name = MAX(attribute_name)’, because the MAX value is not known yet.
- Which subquery returns a single value?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The subqueries in MySQL can return different types of information. A scalar query returns a single value. Column subquery return a single column and row subquery returns a single row.
- The facility that allows nesting one select statement into another is called __________.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The ‘subquerying’ support provided by MySQL is a capability that allows writing one ‘SELECT’ statement within parentheses and nesting within another. This allows logically selecting content from tables.