What do column flags mean in MySQL Workbench?

MySQLMySQLi Database

In MySQL Workbench, column flags can be used with a column to maintain integrity. The column flags are as follows −

  • PK − Primary Key

  • NN − NOT NULL

  • BIN − Binary

  • UN − Unsigned

  • UQ − Unique

  • ZF − Zero Filled

  • G − Generate Column

  • AI − Auto Increment

Let us learn about them one by one −

PK

This stands for the primary key. It can be used to make the column as a primary key.

NN

It is for NOT NULL. Used to enforce the column that it will not insert a NULL value.

BIN

This stands for Binary. This can be used to store data as a binary string.

UN

It is for Unsigned and can be used to store an only positive value which can be started from 0.

UQ

UQ is for Unique. This can be used to enforce the column to insert only unique value for a specific column.

ZF

ZF is for Zero Filled. Suppose, we have declared int(3) and you want to store 21, then zero filled would output the result 021.

G

G stands for Generated column.

AI

AI is for AutoIncrement.

Here is the snapshot of column flags visible under MySQL workbench.

raja
Updated on 26-Jun-2020 12:38:03

Advertisements