To create a table in SQL Worksheet

Note

This section is not applicable for MySQL database services.

This topic describes how to create a table in SQL Worksheet.

  1. Open the navigation menu and click Developer Services.
  2. In the Database Tools section, click SQL Worksheet. You can also access SQL Worksheet from the Connection Details page of a specific database connection.
  3. On the SQL Worksheet page, use the Connection menu to select a database connection. Optionally, click the Change Compartment link to select a database connection in a different compartment. If there are no connections available, you can select the Create Connection option in the Connection menu to create a database connection. See Using the Oracle Cloud Infrastructure Console for more information.
  4. In the left pane, click Object submenu, and then select Create Object.
    The Table Properties panel appears.
  5. In the Name field, enter a name for the table.
  6. In the Columns pane, under General, click + to add a column.
    A row is added to the table below. Click the cell to enter name, data type, comments and so on. To add another column, click + again and enter the relevant details. Repeat this step for each column that is added.
  7. In the Primary Key pane, in the Name field, enter a name for the primary key for this table. The primary key column is automatically prefilled in this pane.
    Optionally, enter details as required in other panes such as Foreign Keys, Unique Keys, Indexes, Table Constraints, Comments and so on. For a description of the various panes, see Creating a Table.
  8. In the DDL pane, under Create tab, the DDL statements for the generated table is displayed. Click Create to create the table.
    In the Output pane, the result is displayed. If there are any errors, then you can go to the relevant pane and make the required changes.