The world's most popular open source database
The Columns tab is used to display and edit
all the column information for a table. Using this tab, you can
add, drop, and alter columns.
You can also use the column tab to change the name, data type, default value, and other properties of your table's columns.
To add a column simply click the Column Name
field in an empty row and enter an appropriate value. Select a
data type from the Datatype drop down list
box . Check the check box under the NN
column to disallow a null value and check the
AI column if you are defining an
autoincrement field.
Right clicking a row under the Column Name
column opens a pop-up window with the following options:
Move Up – Move the selected column up.
Move Down – Move the selected column down.
Delete Selected Columns – Select multiple contiguous columns by right clicking and pressing the Shift key. Use the Ctrl key to select noncontiguous columns.
Refresh Grid – Update all
information in the Columns tab.
To change the name, data type, default value, or comment of a column, double click on the value you wish to change. The content then becomes editable.
To modify the flags on a column (PRIMARY KEY,
UNSIGNED, ZEROFILL) check
the desired value in the Flags frame. Note
that values only display in the flags frame when a column is
selected.The ZEROFILL option only appears if
the column type is numeric.
You can also add column comments to the Column
Comment text area.
To the left of the column name is an icon that indicates whether
the column is a member of the primary key. If the icon is a
small key, that column belongs to the primary key, otherwise the
icon is a blue diamond. To add or remove a column from the
primary key, double click on the icon. You can also add a
primary key by checking the PRIMARY KEY
checkbox in the Column Details section of the
table editor.
When entering default values, in the case of
CHAR and VARCHAR data
types MySQL Workbench will attempt to automatically add quote
marks, if the user does not start their entry with one. For
other data types the user must manage quoting if required, as
it will not be handled automatically by MySQL Workbench.

