开发者

MySQL row declarations?

What do these mean in MySQL? I'm using MySQL workbench and I see I can specify a new column as these... (I noted my guesses)

  • PK – (primary key)
  • NN – (non null)
  • BIN – (binary?)
  • UN – (Unicode?)
  • ZF- (???)
  • AI – (autoincrement?)

Is AI 开发者_如何学Goexactly like an Identity specification in MSSQL? (Can I insert a record without specifying the value and it will insert the next available int?)


ZF is probably ZEROFILL:

CREATE TABLE zf (id INT(5) ZEROFILL NOT NULL DEFAULT 0);

INSERT
INTO    zf
VALUES  (1);

SELECT  *
FROM    zf;

--
00001

UN is not UNICODE, but UNSIGNED (ZEROFILL implies it)


NN means not null,

Is AI exactly like an Identity specification in MSSQL? (Can I insert a record without specifying the value and it will insert the next available int?)

Yes you can insert that way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜