Show TOC

Creating TablesLocate this document in the navigation structure

Prerequisites

  • You are logged on to the database as a database user.

  • You have the CREATEIN privilege for the schema in which you want to create the table.

    More information: SQL Reference Manual, Privilege Specification for a Schema (schema_priv_spec)

  • The database is in the ONLINE operational state.

Context

You use the table editor to create a table.

Note

To create tables, you can also use SQL statements instead of the table editor.

More information:

Procedure

  1. In the explorer tree, expand the folders of the database user who is to be the owner of the table.
  2. Select the schema under which you want to create the table.
  3. In the context menu of the schema, choose Start of the navigation path New Next navigation step Table End of the navigation path.

    More information: Table Editor

  4. Enter the name of the table.

    More information: SQL Reference Manual,

    Note

    If you want to use upper and lower case, deactivate the Identifier Upper Case setting in the Database Studio settings.

    More information: Configuring Database Studio

  5. On the Columns page, create columns.

    More information: Creating Columns

  6. Optional: On the Constraints tab page, define constraints for columns.
  7. Optional: On the Indexes tab page, create indexes.

    More information: Creating Indexes

  8. Optional: On the Foreign Keys tab page, define foreign key dependencies.
  9. Optional: On the Miscellaneous tab page, enter further table properties.
  10. To save the table in the database, choose Create Table in the context menu of the table editor.

    The current database user becomes the owner of the table. The user obtains the INSERT, UPDATE, DELETE, and SELECT privileges for this table. If the table is not a temporary table, the owner is also granted the INDEX, REFERENCES, and ALTER privileges.

Next Steps

SQL Tutorial, Tables