gpt4 book ai didi

mysql - 需要帮助理解这段 MySQL 代码

转载 作者:太空宇宙 更新时间:2023-11-03 10:27:07 25 4
gpt4 key购买 nike

CREATE TABLE `users` (
`ID` int(10) unsigned zerofill NOT NULL auto_increment,
`username` varchar(20) NOT NULL,
PRIMARY KEY (`ID`),
KEY `Username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

什么是a) 未签名,在 ID 表中填零?b) KEY Username (username) 是什么意思?

谢谢

最佳答案

zerofill - 左填充 0

For example, for a column declared as INT(4) ZEROFILL, a value of 5 is retrieved as 0005.


无符号数不小于零

If you specify ZEROFILL for a numeric column, MySQL automatically adds the UNSIGNED attribute to the column.

Unsigned type can be used to permit only nonnegative numbers in a column or when you need a larger upper numeric range for the column

详情:http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html


KEY Username (username) ?

是用户名列用户名之后的索引名

详情:http://dev.mysql.com/doc/refman/5.0/en/create-table.html

关于mysql - 需要帮助理解这段 MySQL 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4562031/

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