MySQL UNION


  1. SELECT on a MERGE table is like _____________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Performing a ‘SELECT’ operation on a ‘MERGE’ table is like performing ‘UNION ALL’. This means that duplicate row results are not removed. ‘SELECT DISTINCT’ is like ‘UNION’ or ‘UNION DISTINCT’.


  1. Which table is used to run a UNION-type query on MyISAM tables?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    When there is a need to run a ‘UNION type’ operation on a MyISAM table that has the same structures, a ‘MERGE’ table is set up for it. After this, the queries are performed on this table.



  1. Suppose it is desired that UNION operation should return not more than 3 rows. Which keyword is used for this?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    When there is a need to put a limit to the number of rows returned by the ‘UNION’ operation, the statement ‘LIMIT’ is appended to the ‘SELECT’ queries which are joined by the ‘UNION’ operations.


  1. Which clause is used to sort a UNION result as a whole?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The ‘ORDER BY’ clause is used along with the ‘UNION’ statement to sort a ‘UNION’ result as a whole. It is placed after the last ‘SELECT’ statement which is kept in parentheses.



  1. The UNION ALL has a higher precedence than UNION DISTINCT.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    When there is a mixture of ‘UNION’ or ‘UNION DISTINCT’ statements with the ‘UNION ALL’ statements, any distinct union operation takes precedence over any ‘UNION ALL’ operations to its left.