Skip to main content Link Menu Expand (external link) Document Search Copy Copied

CREATE TABLE statement

Create a FeatureBase table with the specified columns and data types.

BNF diagrams

expr

COLUMN_LIST

expr

Data types

expr

Table_options

expr

Syntax

CREATE TABLE
  [IF NOT EXISTS]
  <table_name>
  (COLUMN_LIST)
  [WITH COMMENT 'comment'];

Arguments

Argument Description Required? Additional information
<table_name> String literal table identifier Yes Naming standards
IF NOT EXISTS Stop statement execution if a table of the same name already exists Optional  
COLUMN_LIST List of column names, data types and optional constraints with leading _id column that can be ID or STRING data type Yes * _id column
* Naming standards
* ID data type
* STRING data type
WITH COMMENT Optional string literal that describes the table No  

Additional information

Naming standards

FeatureBase identifiers (including object names such as databases, tables and columns) start with a lower-case alphabetic character and can include:

  • lower-case alphabetic characters
  • numbers 0-9
  • dash - and underscore _ characters.

  • table names can be up to 230 characters in length

  • column names can be up to 64 characters in length

_id column

The _id column in each table represents the primary key and supports two data types:

Data type Description Example Advantage Disadvantage
ID data type One or more contiguous blocks of positive integers 7,8,9,10,11,12,...20,21,22,23,... Faster queries Warning: performance and storage are adversely affected if values are non-contiguous
String data type String literal values can be supplied in any order if used as primary key “a23”, “s93kk”, “h82k”, “2023-02-10”,… Automatically mapped to blocks of contiguous integers Higher storage and performance costs

CREATE TABLE examples

Further information