gpt4 book ai didi

mysql - KEY 关键字是什么意思?

转载 作者:IT老高 更新时间:2023-10-28 12:49:54 29 4
gpt4 key购买 nike

在这个 MySQL 表定义中:

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 创建的这种类型的索引有什么特别之处?

最佳答案

引自 create-table - indexes andkeys

{INDEX|KEY}

所以 KEY 通常是一个 INDEX

KEY is normally a synonym for INDEX. The key attribute PRIMARY KEY canalso be specified as just KEY when given in a column definition. Thiswas implemented for compatibility with other database systems.

关于mysql - KEY 关键字是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/924265/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com