?????????????????????????????????????????仯????

?????????????????????????????????????????????????????????????????????????????

??????????????????????????μ???????????????????

?????????SQL ????????д??????????????????

????1??LIKE ???????????????????????????????μ????????????????????

????????д??????????????á?

SELECT * FROM employee WHERE lname_pinyin LIKE '%w%';
SELECT * FROM employee WHERE lname_pinyin LIKE '%w';

????2????? IS NOT NULL??<> ???????????????????????£?

SELECT * FROM employee WHERE lname_pinyin IS NOT NULL;
SELECT * FROM employee WHERE lname_pinyin <> 'wang';

????3???????????????????????????£?????????????????£?

SELECT * FROM employee WHERE YEAR(birth) = '1980'; -- ?????????
SELECT * FROM employee WHERE birth >= '1980-01-01' AND birth <= '1980-12-31'; --?????????

????4???????????????У???а????? WHERE ????????У????£?

CREATE INDEX idx_pinyin ON employee(lname_pinyin?? fname_pinyin);
SELECT * FROM employee WHERE lname_pinyin = 'wang' AND fname_pinyin = 'xiao'; --????????
SELECT * FROM employee WHERE lname_pinyin = 'wang'; --????????

SELECT * FROM employee WHERE fname_pinyin = 'xiao'; -- ??????????
SELECT * FROM employee WHERE lname_pinyin = 'wang' OR fname_pinyin = 'xiao'; -- ??????????

???????????????У??????????? EXPLAIN ???????????????????????????????????