## Creating a Database Table

### Use

You can use SQL Studio to create new database tables in the database to which you are currently logged on. You can use existing database tables or stored SQL Studio objects as a template for new database tables.

### Prerequisites

You need to have the necessary user authorizations and the NOT EXCLUSIVE user attribute.

For an explanation of user authorizations and user attributes, see the Database Users section of the Concepts of the Database System documentation and the Authorization section of the SQL Reference Manual.

### Procedure

...

1. Choose Catalog Manager ® New ® Table Definition.
A window for defining tables opens.

2. To use an existing database table or a saved SQL Studio object as a template for your new database table, choose Table Definition ® Get Table. Select the relevant table or the SQL Studio object, and click OK to confirm.

3. Enter a table name.

4. Perform the following steps:

Define columns

Define column constraints

Define foreign key dependencies

Define miscellaneous information

5. To re-use or edit your table draft later, save it as an SQL Studio object by choosing Table Definition ® Save As.

6. Choose Table Definition ® Create Table. The system creates the new table in the database.

7. To export the SQL statement for creating the database table to the SQL dialog, choose Table Definition ® Export to SQL Dialog.

For information on the syntax of CREATE TABLE statements, see the CREATE TABLE Statement section of the SQL Reference Manual.