MySQL Type Conversion in Expression Evaluation
- 0x61 + 0 results in _____________.
-
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.
- Which of the following is the correct order of precedence (high to low)?
-
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.
- The number of strings among the following matched with ‘%all%’ is _____________.
Ball, baller, tall, tallest
-
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.
- If the operands are non binary strings, LIKE compares them according to their collation.
-
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.
- The expression ‘HI’ LIKE NULL results in _____________.
-
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.