The previous time received a friend's e-mail, recommended to participate in a forum of the answer activity.
Active Address: http://bbs.phpthinking.com/thread-305-1-1.html
The final result is a wrong answer, and the forum in charge of discussion, and was accused of "impossible the whole world is wrong, you are right."
Cause the mood is very bad, had to run 51 to spit a trough. The
now sends the wrong question:
The "Radio" user table creates a normal index for the field name (varchar type), and the following query statement can use the index?
A. SELECT * from users where name is not in (' A ', ' B ');
B. SELECT * from the users where name like '%a% ';
C. SELECT * from users where name between ' a ' and ' B ';
D. SELECT * from the users where name = age;
According to the analysis, we generally choose c ha.
In most cases, Test1:
Create TABLE user (
ID int (one) auto_increment,
name varchar () not NULL,
PRIMARY key (ID )
);
ALTER TABLE user add index Idx_name (name);
and insert a few data, explain4 the option to find that only C is the "perfect" answer.
However, this topic does not mention the existence of other fields, nor does it specify whether other primary keys are allowed to be created, and whether other fields and primary keys will affect the test results?
Next, let's do test2:
CREATE table User2 (
name varchar () not null
);
ALTER TABLE User2 add index idx_name (name);
Continue explain ...
All right, dear friends, after testing, you will find that a-c even use the index, of course, d as always the grammatical error.
The person in charge has emphasized to me how the C is correct in most cases, but I would like to say that it is sufficient to prove that a problem is problematic and that only one counter-example is needed.
Finally, learned that the topic is still a well-known company's face test, the issue of the person is through the million annual salary manager's hand.
I think, a company, the spirit of respect for the interview attitude, or the first perfect under the topic it!
----answer is generally true for most people, and truth is often in the hands of a few.
Maybe not the whole world is wrong, maybe I am wrong, but the problem is wrong