MySQL Type Conversion in Expression Evaluation


  1. 0x61 + 0 results in _____________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The hexadecimal constants are treated as binary strings, unless the context indicates a number. In the string contexts, each pair of hexadecimal digits is converted to a character, then the result is used as a string.


  1. Which of the following is the correct order of precedence (high to low)?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    When MySQL evaluates an expression, it looks at the operators to determine the order in which it should group the terms of the expression. Some operators have higher precedence, and evaluated earlier than others.



  1. The number of strings among the following matched with ‘%all%’ is _____________.
    Ball, baller, tall, tallest











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    In MySQL, the wildcard characters may be specified anywhere in a pattern. The ‘%’ wildcard is used to match variable number of characters. Here, the wildcard matches all the four words.


  1. If the operands are non binary strings, LIKE compares them according to their collation.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    In MySQL, the LIKE operator compares its operands as binary strings if either operand is a binary string. If the operands are non binary strings, the LIKE operator compares them according to their collation.



  1. The expression ‘HI’ LIKE NULL results in _____________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    In MySQL, any pattern matching that is performed with the ‘NULL’ operand, fails. Expressions like: ‘abcdef’ LIKE NULL, NULL LIKE ‘%’, all result into the value NULL. NULL is not used to perform comparisons.