Tuesday, November 13, 2012

What column flags represent in MySQL Workbench

In the MySQL Workbench table editor, column behavior is controlled using a set of predefined flags. These flags map directly to column attributes in the underlying MySQL table definition.

Column flags

  • PK — Primary Key
    Marks the column as part of the table’s primary key. Enforces uniqueness and implicit indexing.
  • NN — Not Null
    Prevents the column from accepting NULL values.
  • BIN — Binary
    For string types, forces binary comparison semantics instead of collation-based comparison.
  • UN — Unsigned
    Applies to numeric types, allowing only non-negative values and extending the upper range.
  • UQ — Unique
    Creates or removes a unique index for the column, enforcing value uniqueness.
  • ZF — Zero-Filled
    Pads numeric values with leading zeros when displayed. Often used together with UNSIGNED.
  • AI — Auto Increment
    Automatically assigns sequential values, typically used for surrogate primary keys.

Notes

These flags are a convenience layer provided by MySQL Workbench and correspond directly to column attributes defined in CREATE TABLE statements. Actual enforcement occurs at the MySQL server level.

MySQL Workbench combines schema design, SQL development, and administrative tooling into a single interface, replacing earlier standalone utilities such as MySQL Query Browser and MySQL Administrator.