Skip to content

16.1.1 SQL Syntax Dictionary

The SQL Syntax Dictionary provides BNF notation and minimal examples for all SQL statements supported by Machbase.

Supported SQL Statements

StatementCategoryDescription
CREATE TABLEDDLCreate LOG/TAG/LOOKUP/VOLATILE/TRANSACTION tables
DROP TABLEDDLDrop tables
ALTER TABLEDDLChange schemas: add/drop/modify/rename columns
TRUNCATE TABLEDDLDelete all table data
CREATE INDEXDDLConditional creation and index support by table type
DROP INDEXDDLDrop indexes
CREATE ROLLUPDDLCreate TAG ROLLUP definitions
DROP ROLLUP / ALTER ROLLUPDDLDelete and control ROLLUPs
CREATE RETENTIONDDLCreate retention policies
CREATE VIEW / DROP VIEWDDLCreate and drop stored views
CREATE TABLESPACEDDLCreate tablespaces
INSERT INTODMLInsert single or multiple rows
INSERT SELECTDMLInsert query results into another table
UPDATEDMLModify TRANSACTION/LOOKUP/VOLATILE rows and correct TAG data with restricted predicates
DELETEDMLDelete table data
LOAD DATA INFILEDMLLoad CSV files directly
SELECTSELECTQuery data with JOIN, GROUP BY, ORDER BY, and LIMIT
WITH / CTESELECTNonrecursive common table expressions in Standard Edition
Named Bind ParameterCommon SQLValue parameters in :name form
CASTSQL expressionExplicitly convert values to a specified type
SAVE DATA INTOSELECTSave query results to CSV
BACKUPOperationsBack up databases or tables
RESTOREOperationsLogical database restore and offline restore using machadmin -r
MOUNT / UMOUNT DATABASEOperationsMount/unmount backup databases
CREATE USER / DROP USER / ALTER USERUsersCreate/drop users and change passwords
GRANT / REVOKEUsersGrant and revoke privileges
AUTH KEY ManagementUsersRegister/manage public-key authentication keys
ALTER SYSTEMSystemSession control, PVO Cache flush, license installation, and more
ALTER SESSIONSessionConfigure session parameters
PIVOTAnalysisConvert rows to columns
WINDOW FUNCTION (OVER)AnalysisWindow functions and OVER
SERIES BYAnalysisGroup consecutive records meeting conditions
SEARCH / ESEARCH / REGEXPSearchKeyword-index-based text search
ROLLUP REBUILDOperationsRecalculate ROLLUP results
DATABASEDDL/sessionCreate/select/drop logical databases and check status
AUTO_INCREMENTDDLGenerate 64-bit PRIMARY KEY values automatically
EXEC procedure / SHOW ROLLUPGAPControlTable flush/refresh and ROLLUP control/status

BNF Conventions

This dictionary uses the following Backus–Naur Form (BNF) conventions.

NotationMeaning
'keyword'SQL reserved word, case-insensitive
nameUser-defined name
( A | B )Either A or B
[ ... ]Optional element
( ... )*Zero or more repetitions
( ... )+One or more repetitions
( ... )?Zero or one occurrence
Last updated on