- 积分
- 35
- UID
- 20621
- 阅读权限
- 10
- 注册时间
- 2015-12-23
- 精华
- 在线时间
- 小时
- 最后登录
- 1970-1-1
- 职业
- 1
|
我在学习过程中遇到这样的一个问题:
创建索引:CREATE UNIQUE INDEX index_name ON example7 (name);
然后查看:
Table: example7
Create Table: CREATE TABLE `example7` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`stu_id` int(11) DEFAULT NULL,
`name` varchar(20) NOT NULL,
`English` varchar(20) DEFAULT 'zero',
`Math` float DEFAULT '0',
`Computer` float DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `index_name` (`name`),
UNIQUE KEY `stu_id` (`stu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
其中红色部分写的都是唯一性KEY,那么我怎么区分哪个是索引,哪个是唯一性约束的字段?
其中 stu_id 是我的在创建表的时候建立的唯一性约束字段,name是我上面创建的索引,请问如何进行区分?
|
|