MySQL建表时,基本字段的含义

552 查看

[intrinsic column flags] (基本字段类型标识)

  • PK: primary key (column is part of a pk) 主键

  • NN: not null (column is nullable) 非空

  • UQ: unique (column is part of a unique key) 唯一

  • AI: auto increment (the column is auto incremented when rows are inserted) 自增

[additional data type flags, depend on used data type] 扩展数据类型标记

  • BIN: Is binary column (if data is a blob or similar, this indicates that is binary data, rather than text) 存放二进制数据的列

  • UN: unsigned (for integer types, see docs: “10.2. Numeric Types”) 无符号整数

  • ZF: Fill up values for that column with 0's if it is numeric (rather a display related flag, see docs: “10.2. Numeric Types”)填充0位(例如指定3位小数,整数18就会变成18.000)