MySQL Subquery


  1. Which of these operators does not perform relative-value comparisons?











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


  1. Which subquery cannot be executed by itself as a separate statement?











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



  1. An uncorrelated subquery does not contain any reference to the values from the outer query.











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


  1. Which operators test whether a subquery returns any rows?











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



  1. Which of these operators perform similar operations like ALL and ANY?











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