Defining Table Structure

A table contains columns, constraints, and indexes. Besides, a table has options such as owner, tablespace and so on. Defining a table structure means setting up all these elements.

To define table structure, create the table or open existing one from Database Explorer.

Defining Columns

To define columns or rename a table, go to the General tab of the table editor. To add a new column to a table:

  1. Right-click the grid, and then click New Column on the shortcut menu. Alternatively, you can press the INSERT button on the keyboard. The Column Properties dialog box appears.
  2. Enter the column name, its data type, and other parameters if needed.
  3. Click OK. The column appears in the grid.

To edit an existing column:

  1. Right-click a required column, and then click Edit Column on the shortcut menu. The Column Properties dialog box appears.
  2. Change the column’s parameters.
  3. Click OK. The updated column appears in the grid.

To remove a column, right-click a required column, and then click Delete Column on the shortcut menu.

Defining Constraints

To add or alter foreign and primaries keys, go to the Constraints tab.

To add a key to a table:

  1. Right-click the table editor window, and then click either New Foreign Key or New Primary Key on the shortcut menu. The Primary Key Properties (or Foreign Key Properties) windows opens.
  2. Enter the key name.
  3. Select required table columns.
  4. Enter other parameters if needed.
  5. Click OK.

To edit a key, right-click a required one, and then select Edit Constraint on the shortcut menu.

To remove a key, right-click a required one, and then select Delete Constraint on the shortcut menu.

Defining Indexes

To define indexes, go to the Indexes tab. To add an index to a table:

  1. Right-click the table editor window, and then select New Index on the shortcut menu. Alternatively, press the INSERT button on the keyboard. The Index Properties dialog box opens.
  2. Enter the index name.
  3. Select index column.
  4. On the Storage tab, enter other parameters if needed.
  5. Click OK.

Defining Table Storage

Tune up specific options according to your plans for the table in the Storage tab of Table editor. For example, you can set extents and transactions options in this tab. For more information, see Storage, Table Editor.