在这个 MySQL 表定义中:
In this MySQL table definition:
CREATE TABLE groups (
ug_main_grp_id smallint NOT NULL default '0',
ug_uid smallint default NULL,
ug_grp_id smallint default NULL,
KEY (ug_main_grp_id)
);
KEY
关键字是什么意思?它不是主键,也不是外键,那么它只是一个索引吗?如果是这样,使用 KEY
创建的这种类型的索引有什么特别之处?
What does the KEY
keyword mean? It's not a primary key, it's not a foreign key, so is it just an index? If so, what is so special about this type of index created with KEY
?
引用自 create-table - 索引和键
{INDEX|KEY}
所以 KEY
通常是一个 INDEX
KEY 通常是 INDEX 的同义词.键属性 PRIMARY KEY 可以在列定义中给出时,也可以仅指定为 KEY.这个实施是为了与其他数据库系统兼容.
KEY is normally a synonym for INDEX. The key attribute PRIMARY KEY can also be specified as just KEY when given in a column definition. This was implemented for compatibility with other database systems.
这篇关于KEY关键字是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!