(1) 在数据库 index_ test 中创建表 writers, 存储引擎为 MyISAM,创建表的同时 在 w_ id 字段 上添加名称为UniqIdx的唯一索引。
- mysql> create table writers
- -> (
- -> w_id smallint(11) primary key not null auto_increment,
- -> w_name varchar(255) not null,
- -> w_address varchar(255),
- -> w_age char(2) not null,
- -> w_note varchar(255),
- -> unique index uniqidx(w_id))
- -> engine=myisam;
- Query OK, 0 rows affected (0.01 sec)