Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Fayvor Love: "Sweet! Finally a clean-looking ERD tool that understands the mysql data types, with forward and reverse engineering".
Michael Dunn: "We're good to go though, thank you again, this is by far the best MySQL interface I've had the opportunity to work with".

More

Add your opinion

SQL Maestro for MySQL online help

Prev Return to chapter overview Next

Fields

Table columns are created and edited within the Field Editor.

 

 

To add a new table column, you should either:

 

open the table in Table Editor and the Fields tab there;
press the Insert key or select the Add New Field... item from the popup menu (alternatively, you may use the corresponding link of the Navigation Bar)

or

select the table in the explorer tree and use the Create New Field popup menu item

or

select the table Fields node or any field within the table in the explorer tree and use the Add New Field... popup menu item.

 

 

 

Table fields are edited within the Field Editor dialog window. In order to open the dialog you should either

 

open the table in Table Editor and the Fields tab there;
press the Enter key or select the Edit Field item from the popup menu (alternatively, you may use the corresponding link of the Navigation Bar)

or

select the field to edit in the explorer tree and use the Edit Field popup menu item.

       

You can change the name of the field using the Rename Field dialog. To open the dialog you should either

 

select the field to rename in the explorer tree;
select the Rename Field item from the popup menu

or

open the table in Table Editor and the Fields tab there;
select the field to rename;
select the Rename Field item from the popup menu (alternatively, you may use the corresponding link of the Navigation Bar).

 

 

 

To drop the table field:

 

select the field to drop in the explorer tree;
select the Drop Field item from the popup menu

or

open the table in Table Editor and the Fields tab there;
press the Delete key or select the Drop Field item from the popup menu (alternatively, you may use the corresponding link of the Navigation Bar)

 

and confirm dropping in the dialog window.

 

 

 

To specify the Data Type, select it from the drop-down list or complete the appropriate field manually in case of data type lacking in this list.

 

Note: the name of the object must be unique among all the object names in the table. You can use any identifier that is allowed by MySQL server.

 

Parameters

Use the Size edit box to define the length of the field value for integer, float, char and other data types and use Precision to define the precision of the field value, e.g. for float data type.

 

Field flags

 Not Null

Forbids the NULL values for the field.

 

 Unique

Includes the field into the unique key (index).

 

 Primary Key

With this option checked the field becomes the only field with a primary key. If you check this field, you will not be able to set this attribute for any other field in the table. Hence if you want to create a compound primary key, do not check this field but create a primary key through the Indexes tab of Table Editor or the appropriate step of Create Table Wizard.

 

Autoincrement

For MyISAM tables you can specify the option on a secondary column in a multiple-column index. In this case, the generated value for the Autoincremented column is calculated as MAX(auto_increment_column) + 1 WHERE prefix=given-prefix. This is useful when you want to put data into ordered groups.

 

Zerofill

Check the box to set the default padding of spaces will be replaced with zeros. For example, for a column declared as INT(5) ZEROFILL, a value of 4 is retrieved as 00004.

 

Note: The attribute is stripped when a column is involved in expressions or UNION queries.

 

Note: If you specify the option for a numeric column, MySQL automatically adds the Unsigned attribute to the column

 

Unsigned
If specified, disallows negative values. For example, if the signed range is -128 to 127 the unsigned range is 0 to 255.

 

Set to current timestamp to update

This option is available for timestamp fields (all MySQL versions) as well as for datetime fields starting from MySQL 5.6.5. An auto-updated column is automatically updated to the current timestamp when the value of any other column in the row is changed from its current value.

 

Specify the column character set and collation.

 

Formula

Expression to compute the value of generated columns. If the stored checkbox is turned ON, the value of the column will be persistently stored in the database.

 

Default value

Within the box you can assign a default value for the field column. The action is optional. If the default value was specified during the new row created and no values is specified for some of the columns, the columns will be filled with their respective default values.

 

The Comment box allows you to set optional text describing the field.

 



Prev Return to chapter overview Next