????1.1 ????????? ????
????1.1.1 ?????????????

????????????????????????
????create table aaa(id int primary key??name varchar(64) not null default ”);
????????????????????
????create table aaa(id int??name varchar(64) not null default ”);
????alter table aaa add primary key(id);
?????????????????
????1?? ??????????????????
????2?? ????????????????У???????????
????3?? ??????????Ч??????????????????id???id????????
????4?? ??????????????????????????null
????1.1.2 ????????? ???????????????????л???????????
????mysql> create table aaa(id int??name varchar(64) not null default ”??email varchar(64) not null default ” unique);
??????????????????
????1??mysql> create unique index uni_name on aaa (name);
????2??mysql> alter table aaa add unique (email);
?????????????
????1???????п????ж??????
????2??????????????????????????????not null???????????null??????????ж????
????3???????????????????????????????????????
????4??????Ч?????????????????????
????1.1.3 ???????????? ???????????????????л??????????????
????mysql> create table aaa(id int??name varchar(64) not null default ”??namevarchar(64) not null default ” index);
?????????????????????
????1??mysql> create index ind_name on aaa (name);
????2??mysql> alter table aaa add index(name);
???????
????1?? ?????п????ж????????????????????????????????
????2??????????е???????????
????3??Ч?????????
????1.1.4 ????????????
??????????????????????????£?????????????????????????????????е?????????
????CREATE TABLE articles (
????id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY??
????title VARCHAR(200)??
????body TEXT??
????FULLTEXT (title??body)
????) engine myisam charset=utf8;
????????select * from articles where match(body) against(‘????’);
???????
????1??Mysql????????????????myisam?洢??????Ч
????2??Mysql????????????????????
????3????????????????????????????????
????4??????????????????????????????????
??????ν??mysql???????????????????????
????1) ???mysql??????????????? mysqlcft
????2) ?????????????????????? sphinx ????棨coreseek?? 1.2 ????????
????desc????
????show keys from ????G
????show index from ????G
????show indexes from ????G
????1.3 ?????????
??????????????
????1.4 ?????????
????DROP INDEX ??????ON ??;
????ALTERTABLE ????DROP INDEX ??????;
????1.6 ????????????? ????????????????????????????????? ????????β????????????????????????????????? ???·?????????β??????????? ???????WHERE??????β??????????