Home » MYSQL » Mysql Query Optimization » Question
  1. What are the results of the following queries if col is an integer column?
    1. SELECT * FROM student WHERE id = '6';
    2. SELECT * FROM student WHERE id = 6;
    1. 1 is an error
    2. 2 is an error
    3. same
    4. different
    5. None of these
Correct Option: C

The first query invokes a type conversion. The conversion operation involves some performance penalty for converting the integer and string to double to perform the comparison.



Your comments will be displayed only after manual approval.