Creating a table

The table is the basic structure to hold user data. You use a SQL command (CREATE TABLE statement) or TableRequest API commands to create a new table.

Guidelines for creating a table:
  • The table definition must include at least one field definition and exactly one primary key definition. For more information on primary key definition, see Create Table.
  • The field definition specifies the name of the column, its data type, whether the column is nullable or not, an optional default value, whether or not the column is an IDENTITY column and an optional comment. All fields (other than the PRIMARY KEY) are nullable by default.
  • The syntax for the primary key specification (key_definition) specifies the primary key columns of the table as an ordered list of field names.
  • The Time-To-Live (TTL) value is used in computing the expiration time of a row. Expired rows are not included in query results and are eventually removed from the table automatically by the Oracle NoSQL Database. If you specify a TTL value while creating the table, it applies as the default TTL for every row inserted into this table.
  • You specify the REGIONS clause if the table being created is a Multi-Region table. The REGIONS clause lists all the regions that the table should span.

Note:

The JSON collection tables have exactly one primary key definition.