???????????
????MySQL??????????????????????к????????
????????????????????????????
????CREATE TABLE `myIndex` (
????`i_testID` INT NOT NULL AUTO_INCREMENT?? 
????`vc_Name` VARCHAR(50) NOT NULL?? 
????`vc_City` VARCHAR(50) NOT NULL?? 
????`i_Age` INT NOT NULL?? 
????`i_SchoolID` INT NOT NULL?? 
????PRIMARY KEY (`i_testID`) 
????);
???????????????1000??????????? 10000 ????????? 7 ?? 8 ?μ????? 5 ?? vc_Name=”erquan” ??????????? city??age??school ????????????????????? T-SQL??
????SELECT `i_testID` FROM `myIndex` WHERE `vc_Name`='erquan' AND `vc_City`='???' AND `i_Age`=25; -- ????????;
????????????MySQL??????????
?????? vc_Name ?????????????????? T-SQL ???MYSQL ?????????????? vc_Name=erquan ?? 5 ??????????????????м?????????????????????????? vc_City ??????”???”??????????? i_Age ?????? 25 ???????????????????????????????? vc_Name ?????????????????MYSQL?????????????Ч???????????????????????????????????????? vc_City ?? i_Age ???????MySQL??????????Ч???????
????????????? MySQL ??Ч??????????????????????? vc_Name??vc_City??i_Age ?????????????
????ALTER TABLE `myIndex` ADD INDEX `name_city_age` (vc_Name(10)??vc_City??i_Age);
???????????vc_Name ????? 50??????????? 10 ????????????????????????????????????????????????? 10???????????????????????????????????????С????? INSERT ?????????
??????? T-SQL ???MySQL ????????κμ???????????!!
???????????? vc_Name??vc_City??i_Age ????????????????????? 3 ???????????????????????????????Ч?????????????????????????????????????????????????????????? ?? MySQL ?????????е????????????????Ч???????????????????????ò??????????????????????????? ??
??????????????????????????????????????
????vc_Name??vc_City??i_Age
????vc_Name??vc_City
????vc_Name
?????????????????????!?????? vc_City??i_Age ????????????????????????? mysql ??????? “????” ??????????????????????????????????????????????е????????????????????????????? T-SQL ???????
????SELECT * FROM myIndex WHREE vc_Name=”erquan” AND vc_City=”???” SELECT * FROM myIndex WHREE vc_Name=”erquan”
?????????漸???????????
????SELECT * FROM myIndex WHREE i_Age=20 AND vc_City=”???” SELECT * FROM myIndex WHREE vc_City=”???”
????????name_city_age(vc_Name(10)??vc_City??i_Age) ????????????????????????????Mysql????????????
??????????
????????????г???????????????????????????????????????????????????????????????????????????????????????????????????????0.31????????(???????????????)
????SELECT COUNT(DISTINCT(LEFT(`title`??10)))/COUNT(*) FROM Arctic; — ????????0.31???????????????Distinct???? ALTER TABLE `user` ADD INDEX `uname`(title(10)); — ??????????SQL????????????????????10??????????????????????С???????????????
??????????sql????????
???????????????Щ??????????sql
????SELECT `sname` FROM `stu` WHERE `age`+10=30;-- ?????????????????????????в????????
????SELECT `sname` FROM `stu` WHERE LEFT(`date`??4) <1990; -- ????????????????????????????????????????
????SELECT * FROM `houdunwang` WHERE `uname` LIKE'???%' -- ??????
????SELECT * FROM `houdunwang` WHERE `uname` LIKE "%???%" -- ????????
????-- ??????????????????????ú??????????????SQL?к??????regexp?????????
????-- ?????????????????????;
????CREATE TABLE `a` (`a` char(10));
????EXPLAIN SELECT * FROM `a` WHERE `a`="1" -- ??????
????EXPLAIN SELECT * FROM `a` WHERE `a`=1 -- ????????
????select * from dept where dname='xxx' or loc='xx' or deptno=45 --???????????or????????????????????????????á???????????????????????Σ??????????????? ???????????????????or ?????
????-- ???mysql??????????????????????????????????
?????????????????Ч??
????SELECT `sname` FROM `stu` WHERE LEFT(`date`??4) <1990; — ????????????????????????????????????????
????SELECT * FROM `houdunwang` WHERE `uname` LIKE’???%’ — ??????
????SELECT * FROM `houdunwang` WHERE `uname` LIKE “%???%” — ????????

?????????????????????б??type?all????????????;???6 6 6?????????????216??;
????????????????????(???????????????????)????????range(??????????)?????6+1+1+1???????????9?μ???;
???????????????????join?????????join????????????С?????????????????????裬????????????龡?????left join???????????.??????join ???????????????????????????????????????????????.
????????????
???????????????????????????????????д?????????????????????????????????????????????????????????2?????????????????Щ??????????????????????????????????;
????????????????????У???????????????DML????????????????80%~90%??????????????????????????????????????????????????????????????????????????