views:

109

answers:

1

In MySQL Workbench table editor there are 7 column flags available: PK, NN, UQ, BIN, UN, ZF, AI.

PK obviously stands for Primary Key. What about others?

+3  A: 

PK - Primary Key

NN - Not Null

BIN - Binary

UN - Unsigned

UQ - Create/remove Unique Key

ZF - Zero-Filled

AI - Auto Incremenent

vdeych
Now why can't they just say that? Why is the unix world so obsessed with acronyms you have to memorize or look up?
BlueRaja - Danny Pflughoeft
Could you be so kind to explain how does UQ work?
Ivan
@Ivan: A unique constraint ensures that a value can only ever exist in the column *once*. Any attempt to add a duplicate will result in an unique data constraint error. The unique constraint as supports covering more than one column - this is called a composite.
OMG Ponies
@Ivan -- it is a way to help index values while preventing duplicates. For example -- e-mail and SSN fields for a unique list of customers should be a unique index, since you frequently do lookups using those fields and they shouldn't repeat. For arbitrary values used only by your database internally for frequent lookups (such as customer ID), you should use a primary key with an auto-increment option instead.
vdeych