SQL Program

The data model of Oracle NoSQL Database supports (a) flat relational data, (b) hierarchical typed (schema-full) data, and (c) schema-less JSON data. SQL for Oracle NoSQL Database is designed to handle all such data in a seamless fashion, without any impedance mismatch among the different sub models.

In the current version, an SQL program consists of a single statement, which can be a non-updating query (read-only DML statement), an updating query (updating DML statement), a data definition command (DDL statement), a user management and security statement, or an informational statement. This is illustrated in the following syntax, which lists all the statements supported by the current SQL version.

program::= 
(
   query | 
   insert_statement | 
   Upsert statement |
   delete_statement | 
   update_statement | 
   create_namespace_statement | 
   show_namespaces_statement | 
   drop_namespace_statement | 
   create_region_statement | 
   show_regions_statement | 
   drop_region_statement | 
   create_table_statement | 
   show_tables_statement | 
   describe_table_statement | 
   alter_table_statement | 
   drop_table_statement | 
   create_index_statement | 
   show_indexes_statement | 
   describe_index_statement | 
   drop_index_statement | 
   create_text_index_statement | 
   create_user_statement | 
   create_role_statement | 
   drop_role_statement | 
   drop_user_statement | 
   alter_user_statement | 
   grant_statement | 
   revoke_statement | 
) EOF

This document is concerned with the first 19 statements in the above list, that is, with read-only queries, insert/delete/update statements, namespace statements, and DDL statements, excluding text indexes. The document describes the syntax and semantics for each statement, and supplies examples. The programmatic APIs available to compile and execute SQL statements and process their results are described in the Java Direct Driver Developer's Guide.