Skip to main content
Tables in the contain various configuration options that can impact performance, reduce storage requirements, or provide extra data safeguards. As some table configuration options cannot be added after data is already loaded, it is important that you take the time to design CREATE TABLE SQL statements with forethought for the queries that you expect to execute frequently. This topic provides examples of CREATE TABLE SQL statements designed for different use cases and describes the configuration choices. For syntax and parameter information, see CREATE TABLE.

Create a Table with All Data Types

This example creates a table with all supported data types in . The intent of this example is to show the required formatting for different data type values, which is shown as the DEFAULT value for each column.
SQL

Create a Table for Real-Time Analysis

This example assumes you plan to ingest large quantities of time series data for rapid querying. The most important columns that you plan to reference in queries frequently include:
  • created_at — A granular timestamp column that represents the primary time reference in the table.
  • user_id — An integer column to identify each unique user.
  • sell_id — An integer column representing each transaction by a user.
SQL
This example table makes use of these Ocient System configurations. For details about using the TimeKey and Clustering Key functionality, see TimeKeys and Clustering Keys. For details about other index types, see Secondary Indexes.

Create a Table for Geospatial Data

This example assumes you plan to ingest geospatial data linked to time series data using . The most important columns that you plan to reference frequently in queries include:
  • route_time — A granular timestamp column that represents the primary time reference in the table.
  • start_point, end_point — The geospatial point values for the start and destination locations.
  • trip_id — An integer column to identify each unique trip.
  • vehicle_id — An integer column that represents each vehicle.
SQL
This example table makes use of these Ocient System configurations. For details about OcientGeo functionality, see Geospatial Functions.

Create a Table With Compression Options

This example table includes multiple compression options to ensure minimal storage for specific columns and extra performance.
Most data types, except arrays, have COMPRESSION DYNAMIC applied by default.
SQL
This example table makes use of these Ocient System configurations. For details about Ocient compression schemes, see Table Compression Options.

Create a Table for Various Container Types

This example table includes complex container data types, including a two-dimensional array, a tuple with variable-length values, and a tuple with various data types.
SQL
This example table makes use of these Ocient System configurations. For details about Ocient container types, see Array, Tuple, and Matrix Overview.

Create a Table With a Retention Policy

This example creates a retention policy that keeps rows only if they are less than one day old, as specified by the last line, RETENTION POLICY AGE 1 DAY. The retention policy depends on the created_at column because it is the TimeKey column. The TimeKey bucket value (1, HOUR) determines how frequently the system checks for any rows to remove.
SQL
For details about configuring table retention, see Table Retention Policies. Data Types Data Definition Language (DDL) Statement Reference Table Compression Options Secondary Indexes
Last modified on May 20, 2026