Skip to content

CoraDB SQL reference

View as Markdown

This part of the manual describes the SQL that CoraDB accepts: how statements are written, the data types, the statements that define and change data, the operators and functions, and the features around them. Most examples run on the e-commerce sample database, whose relational tables (orders, order_items, countries) and graph tables (vertices such as product, customer, city; edges such as likes) are described in Sample database: e-commerce. Graph data is not a separate language: vertex and edge tables are tables, and MATCH is a clause of SELECT that can be combined with relational tables in the same statement, as shown in Relational and graph in one query.

Topic Contents
Relational and graph in one query Vertex tables are tables, Graph patterns next to tables, JOIN … ON with a graph pattern, Rows and edges in one transaction
Writing rules Identifiers, Reserved words, Comments, Literals
Data types Numeric, Date/time, String, LOB, Collection, JSON, Graph, Type conversion
Data definition statements Tables, Indexes, Views, Serials
Data manipulation statements SELECT, INSERT, UPDATE, DELETE, MERGE, REPLACE, TRUNCATE, Common table expressions, Hierarchical queries, Prepared statements
MATCH clause Node and edge patterns, Variable-length paths, Shortest paths, Path variables, Joining patterns and tables
Operators and functions Arithmetic, Comparison, String, Date/time, JSON, Graph, Aggregate and analytic, All operators and functions
Query optimization Statistics, Query plans, Hints, Special indexes, Index optimizations
Partitioning Range, Hash, List, Partition management
Globalization Charsets and collations, Locales, Time zones
Transactions & locking COMMIT and ROLLBACK, Savepoints, MVCC, Locking, Isolation levels
Triggers Actions run automatically on inserts, updates, deletes and transaction ends
Java stored procedures Stored functions and procedures written in Java
Methods Functions attached to tables, called with CALL
Table inheritance Tables created UNDER other tables
Database administration Users and privileges, SET, SHOW, KILL
System catalog System tables, System views