docs/mindsdb_sql/syntax.mdx
In general, MindsDB SQL attempts to follow the syntax conventions of MySQL and PostgreSQL. The following sections describe some common conventions of MindsDB SQL.
We adopt the following notation to describe our commands:
[] indicate optional clauses{} indicate logical or choices with the options separated by |. For examples {x | y | z}identifier [, ...] denotes a comma separated list of identifiers.Identifiers (databases, tables, and column names) with special characters or reserved words must be enclosed with backticks "`":
SELECT * FROM `select` WHERE `select`.id > 100;
SELECT * FROM `select-DATABASE` WHERE `select-DATABASE`.id > 100;
String values are represented by single and double quotes:
SELECT * FROM table_name WHERE table_name.column_name = 'string';
SELECT * FROM table_name WHERE table_name.column_name = "string";
SQL statements can be nested with parentheses:
SELECT * FROM (SELECT * FROM table_name WHERE table_name.column_name = 'string') ;