MySQL Subquery


  1. The ALL subquery performs which operation?











  1. 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.


  1. Which operators are used when a subquery returns multiple rows to be evaluated in comparison to the outer query?











  1. 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.



  1. Usage of aggregates in WHERE clause is allowed.











  1. 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.


  1. Which subquery returns a single value?











  1. 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.



  1. The facility that allows nesting one select statement into another is called __________.











  1. 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.