⑤、create index idx_c_info on c(info);
示例代码:
drop table if exists c;
create table if not exists c -- Multiple primary key defined
(
id int key,
age int unique,
name varchar(50),
address varchar(100),
info varchar(1000),
test1 varchar(50),
test2 varchar(50),
key(test1(10)),
index(test2)
);
alter table c add key(name);
alter table c add index(address);
create index idx_c_info on c(info);
show create table c;
CREATE TABLE `c` (
`id` int(11) NOT NULL,
`age` int(11) DEFAULT NULL,
`name` varchar(50) DEFAULT NULL,
`address` varchar(100) DEFAULT NULL,
`info` varchar(1000) DEFAULT NULL,
`test1` varchar(50) DEFAULT NULL,
`test2` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `age` (`age`),
KEY `test1` (`test1`(10)),
KEY `test2` (`test2`),
KEY `name` (`name`),
KEY `address` (`address`),
KEY `idx_c_info` (`info`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8