Creating or Modifying a Field from GUI

To add a field to a table, open that table, switch to the Fields page of the Table window, and click Add Field button. To modify an existing field, click Edit Field button. Note: If Edit Field button is inactive or invisible, such a function is not supported for this table or database type.

When adding or editing the field, specify the field name and type, choose other needed options, and click OK:

Adding a field in Database Tour

Notes

Creating or Modifying Field Options

Field nameSpecify a name for the field (when adding the field).
Data typeSpecify the data type for the field (if your database is not SQL-based database).
SQL data typeSpecify the SQL data type for the field (if your database is SQL-based database).
Size / PrecisionSpecify the field size (for text compatible and some other field types like BLOB etc.) or field precision (for numeric fields).
ScaleSpecify the field scale for fields to hold floating-point numbers. This is the number of digits allowed after the decimal point.
Default valueSpecify default value for the field.
RequiredSpecify either the field is required (i.e. does not allow NULL values).
DescriptionSpecify the field description (for databases which support this).

Creating or Modifying a Field by SQL

Alternatively, you can create or modify fields by SQL means (except a few types of databases which does not support this).

For example, the next SQL command adds a new text field to a table (check the correct syntax for your database):

ALTER TABLE clients ADD middle_name VARCHAR(30)

This command sets the default value for a column in Firebird database:

ALTER TABLE clients ALTER COLUMN added SET DEFAULT current_date

And this command changes the column type in PostgreSQL database:

ALTER TABLE clients ALTER COLUMN middle_name TYPE TEXT

In some databases, you should type and execute a separate command to add a column comment (if you need this and the database supports this).

Please read your database documentation to learn the correct syntax and possible options.

See also

 Adding Table Index

 Adding Table Constraint

 Adding Table Foreign Key

 Adding Table Partition

 Viewing and Editing Table Structure