I am new to MySql and am using Workbench.
I am confused over the checkboxes PK
, NN
, UQ
, AI
and G
.
Wouldn't a Primary Key mean it must be not null and unique? So why allow a Primary Key that does not have to be unique?
Wouldn't Auto Increment mean it must be Generated? The checkboxes in the upper half of the window treat AI
and G
like radio buttons, checking one uncheck the other. However, the Auto Increment and Generated checkboxes at the bottom half of the window behave differently where Auto Increment is always disabled. Do the acronyms mean what I think they mean?
What settings should I use if I want a column to contain an automatically generated unique int vaue, like the Identity attribute in Microsoft Sql?