Back to Yugabyte Db

Grammar diagrams YCQL

docs/content/stable/api/ycql/grammar_diagrams.md

2026.1.0.0-b2586.8 KB
Original Source

alter_table

alter_table ::= ALTER TABLE table_name 
                { ADD { column_name column_type } [ , ... ]
                  | DROP { column_name [ , ... ] }
                  | RENAME { column_name TO column_name } [ , ... ]
                  | WITH { property_name = property_literal } 
                    [ AND ... ] } [ ... ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="743" height="260" viewbox="0 0 743 260"><path class="connector" d="M0 67h15m58 0h10m58 0h10m95 0h30m-5 0q-5 0-5-5v-47q0-5 5-5h442q5 0 5 5v47q0 5-5 5m-437 0h20m46 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h101m24 0h102q5 0 5 5v20q0 5-5 5m-115 0h10m100 0h119m-422 55q0 5 5 5h5m55 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h46m24 0h47q5 0 5 5v20q0 5-5 5m-5 0h205q5 0 5-5m-412 60q0 5 5 5h5m71 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h128m24 0h129q5 0 5 5v20q0 5-5 5m-169 0h10m37 0h10m107 0h25q5 0 5-5m-417-115q5 0 5 5v170q0 5 5 5h5m54 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h123m46 0h124q5 0 5 5v20q0 5-5 5m-171 0h10m29 0h10m117 0h30q5 0 5-5v-170q0-5 5-5m5 0h35"/><polygon points="0,74 5,67 0,60" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="50" width="58" height="25" rx="7"/><text class="text" x="25" y="67">ALTER</text><rect class="literal" x="83" y="50" width="58" height="25" rx="7"/><text class="text" x="93" y="67">TABLE</text><a xlink:href="../grammar_diagrams#table-name"><rect class="rule" x="151" y="50" width="95" height="25"/><text class="text" x="161" y="67">table_name</text></a><rect class="literal" x="296" y="50" width="46" height="25" rx="7"/><text class="text" x="306" y="67">ADD</text><rect class="literal" x="468" y="20" width="24" height="25" rx="7"/><text class="text" x="478" y="37">,</text><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="372" y="50" width="107" height="25"/><text class="text" x="382" y="67">column_name</text></a><a xlink:href="../grammar_diagrams#column-type"><rect class="rule" x="489" y="50" width="100" height="25"/><text class="text" x="499" y="67">column_type</text></a><rect class="literal" x="296" y="110" width="55" height="25" rx="7"/><text class="text" x="306" y="127">DROP</text><rect class="literal" x="422" y="80" width="24" height="25" rx="7"/><text class="text" x="432" y="97">,</text><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="381" y="110" width="107" height="25"/><text class="text" x="391" y="127">column_name</text></a><rect class="literal" x="296" y="170" width="71" height="25" rx="7"/><text class="text" x="306" y="187">RENAME</text><rect class="literal" x="520" y="140" width="24" height="25" rx="7"/><text class="text" x="530" y="157">,</text><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="397" y="170" width="107" height="25"/><text class="text" x="407" y="187">column_name</text></a><rect class="literal" x="514" y="170" width="37" height="25" rx="7"/><text class="text" x="524" y="187">TO</text><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="561" y="170" width="107" height="25"/><text class="text" x="571" y="187">column_name</text></a><rect class="literal" x="296" y="230" width="54" height="25" rx="7"/><text class="text" x="306" y="247">WITH</text><rect class="literal" x="498" y="200" width="46" height="25" rx="7"/><text class="text" x="508" y="217">AND</text><a xlink:href="../grammar_diagrams#property-name"><rect class="rule" x="380" y="230" width="117" height="25"/><text class="text" x="390" y="247">property_name</text></a><rect class="literal" x="507" y="230" width="29" height="25" rx="7"/><text class="text" x="517" y="247">=</text><a xlink:href="../grammar_diagrams#property-literal"><rect class="rule" x="546" y="230" width="117" height="25"/><text class="text" x="556" y="247">property_literal</text></a><polygon points="739,74 743,74 743,60 739,60" style="fill:black;stroke-width:0"/></svg>

column_type

column_type ::= '<type>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="96" height="35" viewbox="0 0 96 35"><path class="connector" d="M0 22h15m66 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="66" height="25" rx="7"/><text class="text" x="25" y="22"><type></text><polygon points="92,29 96,29 96,15 92,15" style="fill:black;stroke-width:0"/></svg>

create_index

output.ebnf
create_index ::= CREATE [ UNIQUE ] [ DEFERRED ] INDEX 
                 [ IF NOT EXISTS ] index_name ON  table_name ( 
                 partition_key_columns , [ clustering_key_columns ] )  
                 [ covering_columns ] [ index_properties ] 
                 [ WHERE index_predicate ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="790" height="150" viewbox="0 0 790 150"><path class="connector" d="M0 22h15m68 0h30m70 0h20m-105 0q5 0 5 5v8q0 5 5 5h80q5 0 5-5v-8q0-5 5-5m5 0h30m85 0h20m-120 0q5 0 5 5v8q0 5 5 5h95q5 0 5-5v-8q0-5 5-5m5 0h10m59 0h30m32 0h10m46 0h10m64 0h20m-197 0q5 0 5 5v8q0 5 5 5h172q5 0 5-5v-8q0-5 5-5m5 0h10m97 0h10m39 0h7m2 0h2m2 0h2m-790 50h2m2 0h2m2 0h7m95 0h10m25 0h10m162 0h10m24 0h30m170 0h20m-205 0q5 0 5 5v8q0 5 5 5h180q5 0 5-5v-8q0-5 5-5m5 0h10m25 0h7m2 0h2m2 0h2m-621 50h2m2 0h2m2 0h27m132 0h20m-167 0q5 0 5 5v8q0 5 5 5h142q5 0 5-5v-8q0-5 5-5m5 0h30m127 0h20m-162 0q5 0 5 5v8q0 5 5 5h137q5 0 5-5v-8q0-5 5-5m5 0h30m66 0h10m121 0h20m-232 0q5 0 5 5v8q0 5 5 5h207q5 0 5-5v-8q0-5 5-5m5 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="68" height="25" rx="7"/><text class="text" x="25" y="22">CREATE</text><rect class="literal" x="113" y="5" width="70" height="25" rx="7"/><text class="text" x="123" y="22">UNIQUE</text><rect class="literal" x="233" y="5" width="85" height="25" rx="7"/><text class="text" x="243" y="22">DEFERRED</text><rect class="literal" x="348" y="5" width="59" height="25" rx="7"/><text class="text" x="358" y="22">INDEX</text><rect class="literal" x="437" y="5" width="32" height="25" rx="7"/><text class="text" x="447" y="22">IF</text><rect class="literal" x="479" y="5" width="46" height="25" rx="7"/><text class="text" x="489" y="22">NOT</text><rect class="literal" x="535" y="5" width="64" height="25" rx="7"/><text class="text" x="545" y="22">EXISTS</text><a xlink:href="../grammar_diagrams#index-name"><rect class="rule" x="629" y="5" width="97" height="25"/><text class="text" x="639" y="22">index_name</text></a><rect class="literal" x="736" y="5" width="39" height="25" rx="7"/><text class="text" x="746" y="22">ON</text><a xlink:href="../grammar_diagrams#table-name"><rect class="rule" x="15" y="55" width="95" height="25"/><text class="text" x="25" y="72">table_name</text></a><rect class="literal" x="120" y="55" width="25" height="25" rx="7"/><text class="text" x="130" y="72">(</text><a xlink:href="../grammar_diagrams#partition-key-columns"><rect class="rule" x="155" y="55" width="162" height="25"/><text class="text" x="165" y="72">partition_key_columns</text></a><rect class="literal" x="327" y="55" width="24" height="25" rx="7"/><text class="text" x="337" y="72">,</text><a xlink:href="../grammar_diagrams#clustering-key-columns"><rect class="rule" x="381" y="55" width="170" height="25"/><text class="text" x="391" y="72">clustering_key_columns</text></a><rect class="literal" x="581" y="55" width="25" height="25" rx="7"/><text class="text" x="591" y="72">)</text><a xlink:href="../grammar_diagrams#covering-columns"><rect class="rule" x="35" y="105" width="132" height="25"/><text class="text" x="45" y="122">covering_columns</text></a><a xlink:href="../grammar_diagrams#index-properties"><rect class="rule" x="217" y="105" width="127" height="25"/><text class="text" x="227" y="122">index_properties</text></a><rect class="literal" x="394" y="105" width="66" height="25" rx="7"/><text class="text" x="404" y="122">WHERE</text><a xlink:href="../grammar_diagrams#index-predicate"><rect class="rule" x="470" y="105" width="121" height="25"/><text class="text" x="480" y="122">index_predicate</text></a><polygon points="622,129 626,129 626,115 622,115" style="fill:black;stroke-width:0"/></svg>

partition_key_columns

partition_key_columns ::= index_column | ( index_column [ , ... ] )

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="286" height="95" viewbox="0 0 286 95"><path class="connector" d="M0 22h35m106 0h130m-251 0q5 0 5 5v50q0 5 5 5h5m25 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h46m24 0h46q5 0 5 5v20q0 5-5 5m-5 0h30m25 0h5q5 0 5-5v-50q0-5 5-5m5 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><a xlink:href="../grammar_diagrams#index-column"><rect class="rule" x="35" y="5" width="106" height="25"/><text class="text" x="45" y="22">index_column</text></a><rect class="literal" x="35" y="65" width="25" height="25" rx="7"/><text class="text" x="45" y="82">(</text><rect class="literal" x="131" y="35" width="24" height="25" rx="7"/><text class="text" x="141" y="52">,</text><a xlink:href="../grammar_diagrams#index-column"><rect class="rule" x="90" y="65" width="106" height="25"/><text class="text" x="100" y="82">index_column</text></a><rect class="literal" x="226" y="65" width="25" height="25" rx="7"/><text class="text" x="236" y="82">)</text><polygon points="282,29 286,29 286,15 282,15" style="fill:black;stroke-width:0"/></svg>

clustering_key_columns

clustering_key_columns ::= index_column [ , ... ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="176" height="65" viewbox="0 0 176 65"><path class="connector" d="M0 52h35m-5 0q-5 0-5-5v-20q0-5 5-5h46m24 0h46q5 0 5 5v20q0 5-5 5m-5 0h35"/><polygon points="0,59 5,52 0,45" style="fill:black;stroke-width:0"/><rect class="literal" x="76" y="5" width="24" height="25" rx="7"/><text class="text" x="86" y="22">,</text><a xlink:href="../grammar_diagrams#index-column"><rect class="rule" x="35" y="35" width="106" height="25"/><text class="text" x="45" y="52">index_column</text></a><polygon points="172,59 176,59 176,45 172,45" style="fill:black;stroke-width:0"/></svg>

index_properties

index_properties ::= WITH 
                     { property_name = property_literal
                       | CLUSTERING ORDER BY ( 
                         { index_column [ ASC | DESC ] } [ , ... ] ) } 
                     [ AND ... ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="721" height="160" viewbox="0 0 721 160"><path class="connector" d="M0 52h15m54 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h275m46 0h276q5 0 5 5v20q0 5-5 5m-592 0h20m117 0h10m29 0h10m117 0h284m-582 0q5 0 5 5v50q0 5 5 5h5m99 0h10m63 0h10m35 0h10m25 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h98m24 0h98q5 0 5 5v20q0 5-5 5m-109 0h30m45 0h29m-84 25q0 5 5 5h5m54 0h5q5 0 5-5m-79-25q5 0 5 5v33q0 5 5 5h64q5 0 5-5v-33q0-5 5-5m5 0h30m25 0h5q5 0 5-5v-50q0-5 5-5m5 0h35"/><polygon points="0,59 5,52 0,45" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="35" width="54" height="25" rx="7"/><text class="text" x="25" y="52">WITH</text><rect class="literal" x="369" y="5" width="46" height="25" rx="7"/><text class="text" x="379" y="22">AND</text><a xlink:href="../grammar_diagrams#property-name"><rect class="rule" x="119" y="35" width="117" height="25"/><text class="text" x="129" y="52">property_name</text></a><rect class="literal" x="246" y="35" width="29" height="25" rx="7"/><text class="text" x="256" y="52">=</text><a xlink:href="../grammar_diagrams#property-literal"><rect class="rule" x="285" y="35" width="117" height="25"/><text class="text" x="295" y="52">property_literal</text></a><rect class="literal" x="119" y="95" width="99" height="25" rx="7"/><text class="text" x="129" y="112">CLUSTERING</text><rect class="literal" x="228" y="95" width="63" height="25" rx="7"/><text class="text" x="238" y="112">ORDER</text><rect class="literal" x="301" y="95" width="35" height="25" rx="7"/><text class="text" x="311" y="112">BY</text><rect class="literal" x="346" y="95" width="25" height="25" rx="7"/><text class="text" x="356" y="112">(</text><rect class="literal" x="494" y="65" width="24" height="25" rx="7"/><text class="text" x="504" y="82">,</text><a xlink:href="../grammar_diagrams#index-column"><rect class="rule" x="401" y="95" width="106" height="25"/><text class="text" x="411" y="112">index_column</text></a><rect class="literal" x="537" y="95" width="45" height="25" rx="7"/><text class="text" x="547" y="112">ASC</text><rect class="literal" x="537" y="125" width="54" height="25" rx="7"/><text class="text" x="547" y="142">DESC</text><rect class="literal" x="641" y="95" width="25" height="25" rx="7"/><text class="text" x="651" y="112">)</text><polygon points="717,59 721,59 721,45 717,45" style="fill:black;stroke-width:0"/></svg>

index_column

index_column ::= column_name | jsonb_attribute

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="188" height="65" viewbox="0 0 188 65"><path class="connector" d="M0 22h35m107 0h31m-153 0q5 0 5 5v20q0 5 5 5h5m118 0h5q5 0 5-5v-20q0-5 5-5m5 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="35" y="5" width="107" height="25"/><text class="text" x="45" y="22">column_name</text></a><a xlink:href="../grammar_diagrams#jsonb-attribute"><rect class="rule" x="35" y="35" width="118" height="25"/><text class="text" x="45" y="52">jsonb_attribute</text></a><polygon points="184,29 188,29 188,15 184,15" style="fill:black;stroke-width:0"/></svg>

jsonb_attribute

jsonb_attribute ::= column_name [ -> ''attribute_name'' [ ... ] ] ->> 
                    ''attribute_name''

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="582" height="65" viewbox="0 0 582 65"><path class="connector" d="M0 37h15m107 0h50m-5 0q-5 0-5-5v-17q0-5 5-5h178q5 0 5 5v17q0 5-5 5m-139 0h10m124 0h40m-243 0q5 0 5 5v8q0 5 5 5h218q5 0 5-5v-8q0-5 5-5m5 0h10m43 0h10m124 0h15"/><polygon points="0,44 5,37 0,30" style="fill:black;stroke-width:0"/><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="15" y="20" width="107" height="25"/><text class="text" x="25" y="37">column_name</text></a><rect class="literal" x="172" y="20" width="34" height="25" rx="7"/><text class="text" x="182" y="37">-></text><rect class="literal" x="216" y="20" width="124" height="25" rx="7"/><text class="text" x="226" y="37">'attribute_name'</text><rect class="literal" x="390" y="20" width="43" height="25" rx="7"/><text class="text" x="400" y="37">->></text><rect class="literal" x="443" y="20" width="124" height="25" rx="7"/><text class="text" x="453" y="37">'attribute_name'</text><polygon points="578,44 582,44 582,30 578,30" style="fill:black;stroke-width:0"/></svg>

covering_columns

covering_columns ::= { COVERING | INCLUDE } ( column_name [ , ... ] )

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="383" height="95" viewbox="0 0 383 95"><path class="connector" d="M0 52h35m86 0h20m-121 0q5 0 5 5v20q0 5 5 5h5m76 0h15q5 0 5-5v-20q0-5 5-5m5 0h10m25 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h46m24 0h47q5 0 5 5v20q0 5-5 5m-5 0h30m25 0h15"/><polygon points="0,59 5,52 0,45" style="fill:black;stroke-width:0"/><rect class="literal" x="35" y="35" width="86" height="25" rx="7"/><text class="text" x="45" y="52">COVERING</text><rect class="literal" x="35" y="65" width="76" height="25" rx="7"/><text class="text" x="45" y="82">INCLUDE</text><rect class="literal" x="151" y="35" width="25" height="25" rx="7"/><text class="text" x="161" y="52">(</text><rect class="literal" x="247" y="5" width="24" height="25" rx="7"/><text class="text" x="257" y="22">,</text><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="206" y="35" width="107" height="25"/><text class="text" x="216" y="52">column_name</text></a><rect class="literal" x="343" y="35" width="25" height="25" rx="7"/><text class="text" x="353" y="52">)</text><polygon points="379,59 383,59 383,45 379,45" style="fill:black;stroke-width:0"/></svg>

index_predicate

index_predicate ::= where_expression

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="158" height="35" viewbox="0 0 158 35"><path class="connector" d="M0 22h15m128 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><a xlink:href="../grammar_diagrams#where-expression"><rect class="rule" x="15" y="5" width="128" height="25"/><text class="text" x="25" y="22">where_expression</text></a><polygon points="154,29 158,29 158,15 154,15" style="fill:black;stroke-width:0"/></svg>

create_keyspace

create_keyspace ::= CREATE { KEYSPACE | SCHEMA } [ IF NOT EXISTS ] 
                    keyspace_name keyspace_properties

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="738" height="65" viewbox="0 0 738 65"><path class="connector" d="M0 22h15m68 0h30m84 0h20m-119 0q5 0 5 5v20q0 5 5 5h5m72 0h17q5 0 5-5v-20q0-5 5-5m5 0h30m32 0h10m46 0h10m64 0h20m-197 0q5 0 5 5v8q0 5 5 5h172q5 0 5-5v-8q0-5 5-5m5 0h10m122 0h10m152 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="68" height="25" rx="7"/><text class="text" x="25" y="22">CREATE</text><rect class="literal" x="113" y="5" width="84" height="25" rx="7"/><text class="text" x="123" y="22">KEYSPACE</text><rect class="literal" x="113" y="35" width="72" height="25" rx="7"/><text class="text" x="123" y="52">SCHEMA</text><rect class="literal" x="247" y="5" width="32" height="25" rx="7"/><text class="text" x="257" y="22">IF</text><rect class="literal" x="289" y="5" width="46" height="25" rx="7"/><text class="text" x="299" y="22">NOT</text><rect class="literal" x="345" y="5" width="64" height="25" rx="7"/><text class="text" x="355" y="22">EXISTS</text><a xlink:href="../grammar_diagrams#keyspace-name"><rect class="rule" x="439" y="5" width="122" height="25"/><text class="text" x="449" y="22">keyspace_name</text></a><a xlink:href="../grammar_diagrams#keyspace-properties"><rect class="rule" x="571" y="5" width="152" height="25"/><text class="text" x="581" y="22">keyspace_properties</text></a><polygon points="734,29 738,29 738,15 734,15" style="fill:black;stroke-width:0"/></svg>

keyspace_properties

keyspace_properties ::= [ WITH REPLICATION = { keyspace_property 
                          [ , ... ] } ] 
                        [ AND DURABLE_WRITES = { 'true' | 'false' } ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="923" height="110" viewbox="0 0 923 110"><path class="connector" d="M0 52h35m54 0h10m104 0h10m29 0h10m28 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h63m24 0h64q5 0 5 5v20q0 5-5 5m-5 0h30m28 0h20m-509 0q5 0 5 5v8q0 5 5 5h484q5 0 5-5v-8q0-5 5-5m5 0h30m46 0h10m134 0h10m29 0h30m46 0h24m-85 0q5 0 5 5v20q0 5 5 5h5m50 0h5q5 0 5-5v-20q0-5 5-5m5 0h20m-364 0q5 0 5 5v38q0 5 5 5h339q5 0 5-5v-38q0-5 5-5m5 0h15"/><polygon points="0,59 5,52 0,45" style="fill:black;stroke-width:0"/><rect class="literal" x="35" y="35" width="54" height="25" rx="7"/><text class="text" x="45" y="52">WITH</text><rect class="literal" x="99" y="35" width="104" height="25" rx="7"/><text class="text" x="109" y="52">REPLICATION</text><rect class="literal" x="213" y="35" width="29" height="25" rx="7"/><text class="text" x="223" y="52">=</text><rect class="literal" x="252" y="35" width="28" height="25" rx="7"/><text class="text" x="262" y="52">{</text><rect class="literal" x="368" y="5" width="24" height="25" rx="7"/><text class="text" x="378" y="22">,</text><a xlink:href="../grammar_diagrams#keyspace-property"><rect class="rule" x="310" y="35" width="141" height="25"/><text class="text" x="320" y="52">keyspace_property</text></a><rect class="literal" x="481" y="35" width="28" height="25" rx="7"/><text class="text" x="491" y="52">}</text><rect class="literal" x="559" y="35" width="46" height="25" rx="7"/><text class="text" x="569" y="52">AND</text><rect class="literal" x="615" y="35" width="134" height="25" rx="7"/><text class="text" x="625" y="52">DURABLE_WRITES</text><rect class="literal" x="759" y="35" width="29" height="25" rx="7"/><text class="text" x="769" y="52">=</text><rect class="literal" x="818" y="35" width="46" height="25" rx="7"/><text class="text" x="828" y="52">true</text><rect class="literal" x="818" y="65" width="50" height="25" rx="7"/><text class="text" x="828" y="82">false</text><polygon points="919,59 923,59 923,45 919,45" style="fill:black;stroke-width:0"/></svg>

keyspace_property

keyspace_property ::= property_name = property_literal

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="313" height="35" viewbox="0 0 313 35"><path class="connector" d="M0 22h15m117 0h10m29 0h10m117 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><a xlink:href="../grammar_diagrams#property-name"><rect class="rule" x="15" y="5" width="117" height="25"/><text class="text" x="25" y="22">property_name</text></a><rect class="literal" x="142" y="5" width="29" height="25" rx="7"/><text class="text" x="152" y="22">=</text><a xlink:href="../grammar_diagrams#property-literal"><rect class="rule" x="181" y="5" width="117" height="25"/><text class="text" x="191" y="22">property_literal</text></a><polygon points="309,29 313,29 313,15 309,15" style="fill:black;stroke-width:0"/></svg>

create_table

create_table ::= CREATE TABLE [ IF NOT EXISTS ] table_name ( 
                 table_schema ) [ table_properties ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="846" height="50" viewbox="0 0 846 50"><path class="connector" d="M0 22h15m68 0h10m58 0h30m32 0h10m46 0h10m64 0h20m-197 0q5 0 5 5v8q0 5 5 5h172q5 0 5-5v-8q0-5 5-5m5 0h10m95 0h10m25 0h10m108 0h10m25 0h30m125 0h20m-160 0q5 0 5 5v8q0 5 5 5h135q5 0 5-5v-8q0-5 5-5m5 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="68" height="25" rx="7"/><text class="text" x="25" y="22">CREATE</text><rect class="literal" x="93" y="5" width="58" height="25" rx="7"/><text class="text" x="103" y="22">TABLE</text><rect class="literal" x="181" y="5" width="32" height="25" rx="7"/><text class="text" x="191" y="22">IF</text><rect class="literal" x="223" y="5" width="46" height="25" rx="7"/><text class="text" x="233" y="22">NOT</text><rect class="literal" x="279" y="5" width="64" height="25" rx="7"/><text class="text" x="289" y="22">EXISTS</text><a xlink:href="../grammar_diagrams#table-name"><rect class="rule" x="373" y="5" width="95" height="25"/><text class="text" x="383" y="22">table_name</text></a><rect class="literal" x="478" y="5" width="25" height="25" rx="7"/><text class="text" x="488" y="22">(</text><a xlink:href="../grammar_diagrams#table-schema"><rect class="rule" x="513" y="5" width="108" height="25"/><text class="text" x="523" y="22">table_schema</text></a><rect class="literal" x="631" y="5" width="25" height="25" rx="7"/><text class="text" x="641" y="22">)</text><a xlink:href="../grammar_diagrams#table-properties"><rect class="rule" x="686" y="5" width="125" height="25"/><text class="text" x="696" y="22">table_properties</text></a><polygon points="842,29 846,29 846,15 842,15" style="fill:black;stroke-width:0"/></svg>

table_schema

table_schema ::= { column_name column_type 
                   { PRIMARY KEY | STATIC } [ ... ]
                   | PRIMARY KEY ( ( column_name [ , ... ] ) 
                     [ , column_name [ ... ] ] ) } [ , ... ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="765" height="185" viewbox="0 0 765 185"><path class="connector" d="M0 67h35m-5 0q-5 0-5-5v-35q0-5 5-5h340m24 0h341q5 0 5 5v35q0 5-5 5m-700 0h20m107 0h10m100 0h30m-5 0q-5 0-5-5v-17q0-5 5-5h177q5 0 5 5v17q0 5-5 5m-172 0h20m74 0h10m43 0h20m-162 0q5 0 5 5v20q0 5 5 5h5m64 0h68q5 0 5-5v-20q0-5 5-5m5 0h261m-690 0q5 0 5 5v80q0 5 5 5h5m74 0h10m43 0h10m25 0h10m25 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h46m24 0h47q5 0 5 5v20q0 5-5 5m-5 0h30m25 0h50m-5 0q-5 0-5-5v-17q0-5 5-5h151q5 0 5 5v17q0 5-5 5m-122 0h10m107 0h40m-216 0q5 0 5 5v8q0 5 5 5h191q5 0 5-5v-8q0-5 5-5m5 0h10m25 0h5q5 0 5-5v-80q0-5 5-5m5 0h35"/><polygon points="0,74 5,67 0,60" style="fill:black;stroke-width:0"/><rect class="literal" x="370" y="5" width="24" height="25" rx="7"/><text class="text" x="380" y="22">,</text><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="55" y="50" width="107" height="25"/><text class="text" x="65" y="67">column_name</text></a><a xlink:href="../grammar_diagrams#column-type"><rect class="rule" x="172" y="50" width="100" height="25"/><text class="text" x="182" y="67">column_type</text></a><rect class="literal" x="322" y="50" width="74" height="25" rx="7"/><text class="text" x="332" y="67">PRIMARY</text><rect class="literal" x="406" y="50" width="43" height="25" rx="7"/><text class="text" x="416" y="67">KEY</text><rect class="literal" x="322" y="80" width="64" height="25" rx="7"/><text class="text" x="332" y="97">STATIC</text><rect class="literal" x="55" y="140" width="74" height="25" rx="7"/><text class="text" x="65" y="157">PRIMARY</text><rect class="literal" x="139" y="140" width="43" height="25" rx="7"/><text class="text" x="149" y="157">KEY</text><rect class="literal" x="192" y="140" width="25" height="25" rx="7"/><text class="text" x="202" y="157">(</text><rect class="literal" x="227" y="140" width="25" height="25" rx="7"/><text class="text" x="237" y="157">(</text><rect class="literal" x="323" y="110" width="24" height="25" rx="7"/><text class="text" x="333" y="127">,</text><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="282" y="140" width="107" height="25"/><text class="text" x="292" y="157">column_name</text></a><rect class="literal" x="419" y="140" width="25" height="25" rx="7"/><text class="text" x="429" y="157">)</text><rect class="literal" x="494" y="140" width="24" height="25" rx="7"/><text class="text" x="504" y="157">,</text><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="528" y="140" width="107" height="25"/><text class="text" x="538" y="157">column_name</text></a><rect class="literal" x="685" y="140" width="25" height="25" rx="7"/><text class="text" x="695" y="157">)</text><polygon points="761,74 765,74 765,60 761,60" style="fill:black;stroke-width:0"/></svg>

table_properties

table_properties ::= WITH 
                     { property_name = property_literal
                       | CLUSTERING ORDER BY ( 
                         { column_name [ ASC | DESC ] } [ , ... ] )
                       | COMPACT STORAGE } [ AND ... ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="722" height="190" viewbox="0 0 722 190"><path class="connector" d="M0 52h15m54 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h276m46 0h276q5 0 5 5v20q0 5-5 5m-593 0h20m117 0h10m29 0h10m117 0h285m-578 55q0 5 5 5h5m99 0h10m63 0h10m35 0h10m25 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h98m24 0h99q5 0 5 5v20q0 5-5 5m-109 0h30m45 0h29m-84 25q0 5 5 5h5m54 0h5q5 0 5-5m-79-25q5 0 5 5v33q0 5 5 5h64q5 0 5-5v-33q0-5 5-5m5 0h30m25 0h5q5 0 5-5m-573-55q5 0 5 5v115q0 5 5 5h5m81 0h10m78 0h384q5 0 5-5v-115q0-5 5-5m5 0h35"/><polygon points="0,59 5,52 0,45" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="35" width="54" height="25" rx="7"/><text class="text" x="25" y="52">WITH</text><rect class="literal" x="370" y="5" width="46" height="25" rx="7"/><text class="text" x="380" y="22">AND</text><a xlink:href="../grammar_diagrams#property-name"><rect class="rule" x="119" y="35" width="117" height="25"/><text class="text" x="129" y="52">property_name</text></a><a xlink:href="../grammar_diagrams#="><rect class="rule" x="246" y="35" width="29" height="25"/><text class="text" x="256" y="52">=</text></a><a xlink:href="../grammar_diagrams#property-literal"><rect class="rule" x="285" y="35" width="117" height="25"/><text class="text" x="295" y="52">property_literal</text></a><rect class="literal" x="119" y="95" width="99" height="25" rx="7"/><text class="text" x="129" y="112">CLUSTERING</text><rect class="literal" x="228" y="95" width="63" height="25" rx="7"/><text class="text" x="238" y="112">ORDER</text><rect class="literal" x="301" y="95" width="35" height="25" rx="7"/><text class="text" x="311" y="112">BY</text><rect class="literal" x="346" y="95" width="25" height="25" rx="7"/><text class="text" x="356" y="112">(</text><rect class="literal" x="494" y="65" width="24" height="25" rx="7"/><text class="text" x="504" y="82">,</text><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="401" y="95" width="107" height="25"/><text class="text" x="411" y="112">column_name</text></a><rect class="literal" x="538" y="95" width="45" height="25" rx="7"/><text class="text" x="548" y="112">ASC</text><rect class="literal" x="538" y="125" width="54" height="25" rx="7"/><text class="text" x="548" y="142">DESC</text><rect class="literal" x="642" y="95" width="25" height="25" rx="7"/><text class="text" x="652" y="112">)</text><rect class="literal" x="119" y="160" width="81" height="25" rx="7"/><text class="text" x="129" y="177">COMPACT</text><rect class="literal" x="210" y="160" width="78" height="25" rx="7"/><text class="text" x="220" y="177">STORAGE</text><polygon points="718,59 722,59 722,45 718,45" style="fill:black;stroke-width:0"/></svg>

create_type

create_type ::= CREATE TYPE [ IF NOT EXISTS ] type_name ( 
                { field_name field_type } [ , ... ] )

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="772" height="80" viewbox="0 0 772 80"><path class="connector" d="M0 52h15m68 0h10m50 0h30m32 0h10m46 0h10m64 0h20m-197 0q5 0 5 5v8q0 5 5 5h172q5 0 5-5v-8q0-5 5-5m5 0h10m91 0h10m25 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h83m24 0h84q5 0 5 5v20q0 5-5 5m-97 0h10m82 0h30m25 0h15"/><polygon points="0,59 5,52 0,45" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="35" width="68" height="25" rx="7"/><text class="text" x="25" y="52">CREATE</text><rect class="literal" x="93" y="35" width="50" height="25" rx="7"/><text class="text" x="103" y="52">TYPE</text><rect class="literal" x="173" y="35" width="32" height="25" rx="7"/><text class="text" x="183" y="52">IF</text><rect class="literal" x="215" y="35" width="46" height="25" rx="7"/><text class="text" x="225" y="52">NOT</text><rect class="literal" x="271" y="35" width="64" height="25" rx="7"/><text class="text" x="281" y="52">EXISTS</text><a xlink:href="../grammar_diagrams#type-name"><rect class="rule" x="365" y="35" width="91" height="25"/><text class="text" x="375" y="52">type_name</text></a><rect class="literal" x="466" y="35" width="25" height="25" rx="7"/><text class="text" x="476" y="52">(</text><rect class="literal" x="599" y="5" width="24" height="25" rx="7"/><text class="text" x="609" y="22">,</text><a xlink:href="../grammar_diagrams#field-name"><rect class="rule" x="521" y="35" width="89" height="25"/><text class="text" x="531" y="52">field_name</text></a><a xlink:href="../grammar_diagrams#field-type"><rect class="rule" x="620" y="35" width="82" height="25"/><text class="text" x="630" y="52">field_type</text></a><rect class="literal" x="732" y="35" width="25" height="25" rx="7"/><text class="text" x="742" y="52">)</text><polygon points="768,59 772,59 772,45 768,45" style="fill:black;stroke-width:0"/></svg>

field_type

field_type ::= '<type>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="96" height="35" viewbox="0 0 96 35"><path class="connector" d="M0 22h15m66 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="66" height="25" rx="7"/><text class="text" x="25" y="22"><type></text><polygon points="92,29 96,29 96,15 92,15" style="fill:black;stroke-width:0"/></svg>

drop_keyspace

drop_keyspace ::= DROP { KEYSPACE | SCHEMA } [ IF EXISTS ] 
                  keyspace_name

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="507" height="65" viewbox="0 0 507 65"><path class="connector" d="M0 22h15m55 0h30m84 0h20m-119 0q5 0 5 5v20q0 5 5 5h5m72 0h17q5 0 5-5v-20q0-5 5-5m5 0h30m32 0h10m64 0h20m-141 0q5 0 5 5v8q0 5 5 5h116q5 0 5-5v-8q0-5 5-5m5 0h10m122 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="55" height="25" rx="7"/><text class="text" x="25" y="22">DROP</text><rect class="literal" x="100" y="5" width="84" height="25" rx="7"/><text class="text" x="110" y="22">KEYSPACE</text><rect class="literal" x="100" y="35" width="72" height="25" rx="7"/><text class="text" x="110" y="52">SCHEMA</text><rect class="literal" x="234" y="5" width="32" height="25" rx="7"/><text class="text" x="244" y="22">IF</text><rect class="literal" x="276" y="5" width="64" height="25" rx="7"/><text class="text" x="286" y="22">EXISTS</text><a xlink:href="../grammar_diagrams#keyspace-name"><rect class="rule" x="370" y="5" width="122" height="25"/><text class="text" x="380" y="22">keyspace_name</text></a><polygon points="503,29 507,29 507,15 503,15" style="fill:black;stroke-width:0"/></svg>

drop_table

drop_table ::= DROP TABLE [ IF EXISTS ] table_name

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="414" height="50" viewbox="0 0 414 50"><path class="connector" d="M0 22h15m55 0h10m58 0h30m32 0h10m64 0h20m-141 0q5 0 5 5v8q0 5 5 5h116q5 0 5-5v-8q0-5 5-5m5 0h10m95 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="55" height="25" rx="7"/><text class="text" x="25" y="22">DROP</text><rect class="literal" x="80" y="5" width="58" height="25" rx="7"/><text class="text" x="90" y="22">TABLE</text><rect class="literal" x="168" y="5" width="32" height="25" rx="7"/><text class="text" x="178" y="22">IF</text><rect class="literal" x="210" y="5" width="64" height="25" rx="7"/><text class="text" x="220" y="22">EXISTS</text><a xlink:href="../grammar_diagrams#table-name"><rect class="rule" x="304" y="5" width="95" height="25"/><text class="text" x="314" y="22">table_name</text></a><polygon points="410,29 414,29 414,15 410,15" style="fill:black;stroke-width:0"/></svg>

drop_type

drop_type ::= DROP TYPE [ IF EXISTS ] type_name

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="402" height="50" viewbox="0 0 402 50"><path class="connector" d="M0 22h15m55 0h10m50 0h30m32 0h10m64 0h20m-141 0q5 0 5 5v8q0 5 5 5h116q5 0 5-5v-8q0-5 5-5m5 0h10m91 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="55" height="25" rx="7"/><text class="text" x="25" y="22">DROP</text><rect class="literal" x="80" y="5" width="50" height="25" rx="7"/><text class="text" x="90" y="22">TYPE</text><rect class="literal" x="160" y="5" width="32" height="25" rx="7"/><text class="text" x="170" y="22">IF</text><rect class="literal" x="202" y="5" width="64" height="25" rx="7"/><text class="text" x="212" y="22">EXISTS</text><a xlink:href="../grammar_diagrams#type-name"><rect class="rule" x="296" y="5" width="91" height="25"/><text class="text" x="306" y="22">type_name</text></a><polygon points="398,29 402,29 402,15 398,15" style="fill:black;stroke-width:0"/></svg>

use_keyspace

use_keyspace ::= USE keyspace_name

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="207" height="35" viewbox="0 0 207 35"><path class="connector" d="M0 22h15m45 0h10m122 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="45" height="25" rx="7"/><text class="text" x="25" y="22">USE</text><a xlink:href="../grammar_diagrams#keyspace-name"><rect class="rule" x="70" y="5" width="122" height="25"/><text class="text" x="80" y="22">keyspace_name</text></a><polygon points="203,29 207,29 207,15 203,15" style="fill:black;stroke-width:0"/></svg>

delete

delete ::= DELETE FROM table_name 
               [ USING TIMESTAMP timestamp_expression ] WHERE 
               where_expression [ IF { [ NOT ] EXISTS | if_expression } ] 
               [ RETURNS STATUS AS ROW ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="1372" height="95" viewbox="0 0 1372 95"><path class="connector" d="M0 22h15m67 0h10m54 0h10m91 0h30m60 0h10m90 0h10m155 0h20m-360 0q5 0 5 5v8q0 5 5 5h335q5 0 5-5v-8q0-5 5-5m5 0h10m65 0h10m128 0h30m32 0h50m45 0h20m-80 0q5 0 5 5v8q0 5 5 5h55q5 0 5-5v-8q0-5 5-5m5 0h10m64 0h20m-194 0q5 0 5 5v35q0 5 5 5h5m98 0h66q5 0 5-5v-35q0-5 5-5m5 0h20m-276 0q5 0 5 5v53q0 5 5 5h251q5 0 5-5v-53q0-5 5-5m5 0h30m181 0h20m-216 0q5 0 5 5v8q0 5 5 5h191q5 0 5-5v-8q0-5 5-5m5 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="67" height="25" rx="7"/><text class="text" x="25" y="22">DELETE</text><rect class="literal" x="92" y="5" width="54" height="25" rx="7"/><text class="text" x="102" y="22">FROM</text><a xlink:href="../grammar_diagrams#table-name"><rect class="rule" x="156" y="5" width="91" height="25"/><text class="text" x="166" y="22">table_name</text></a><rect class="literal" x="277" y="5" width="60" height="25" rx="7"/><text class="text" x="287" y="22">USING</text><rect class="literal" x="347" y="5" width="90" height="25" rx="7"/><text class="text" x="357" y="22">TIMESTAMP</text><a xlink:href="../grammar_diagrams#timestamp-expression"><rect class="rule" x="447" y="5" width="155" height="25"/><text class="text" x="457" y="22">timestamp_expression</text></a><rect class="literal" x="632" y="5" width="65" height="25" rx="7"/><text class="text" x="642" y="22">WHERE</text><a xlink:href="../grammar_diagrams#where-expression"><rect class="rule" x="707" y="5" width="128" height="25"/><text class="text" x="717" y="22">where_expression</text></a><rect class="literal" x="865" y="5" width="32" height="25" rx="7"/><text class="text" x="875" y="22">IF</text><rect class="literal" x="947" y="5" width="45" height="25" rx="7"/><text class="text" x="957" y="22">NOT</text><rect class="literal" x="1022" y="5" width="64" height="25" rx="7"/><text class="text" x="1032" y="22">EXISTS</text><a xlink:href="../grammar_diagrams#if-expression"><rect class="rule" x="927" y="50" width="98" height="25"/><text class="text" x="937" y="67">if_expression</text></a><rect class="literal" x="1156" y="5" width="181" height="25" rx="7"/><text class="text" x="1166" y="22">RETURNS STATUS AS ROW</text><polygon points="1368,29 1372,29 1372,15 1368,15" style="fill:black;stroke-width:0"/></svg>

where_expression

where_expression ::= { column_name { < | <=
                                     | = | >=
                                     | > | IN
                                     | NOT IN } expression } 
                     [ AND ... ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="390" height="245" viewbox="0 0 390 245"><path class="connector" d="M0 52h35m-5 0q-5 0-5-5v-20q0-5 5-5h142m46 0h142q5 0 5 5v20q0 5-5 5m-218 0h30m29 0h55m-94 25q0 5 5 5h5m38 0h31q5 0 5-5m-84 30q0 5 5 5h5m29 0h40q5 0 5-5m-84 30q0 5 5 5h5m38 0h31q5 0 5-5m-84 30q0 5 5 5h5m29 0h40q5 0 5-5m-84 30q0 5 5 5h5m34 0h35q5 0 5-5m-89-145q5 0 5 5v170q0 5 5 5h5m64 0h5q5 0 5-5v-170q0-5 5-5m5 0h10m89 0h35"/><polygon points="0,59 5,52 0,45" style="fill:black;stroke-width:0"/><rect class="literal" x="172" y="5" width="46" height="25" rx="7"/><text class="text" x="182" y="22">AND</text><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="35" y="35" width="107" height="25"/><text class="text" x="45" y="52">column_name</text></a><rect class="literal" x="172" y="35" width="29" height="25" rx="7"/><text class="text" x="182" y="52"><</text><rect class="literal" x="172" y="65" width="38" height="25" rx="7"/><text class="text" x="182" y="82"><=</text><rect class="literal" x="172" y="95" width="29" height="25" rx="7"/><text class="text" x="182" y="112">=</text><rect class="literal" x="172" y="125" width="38" height="25" rx="7"/><text class="text" x="182" y="142">>=</text><rect class="literal" x="172" y="155" width="29" height="25" rx="7"/><text class="text" x="182" y="172">></text><rect class="literal" x="172" y="185" width="34" height="25" rx="7"/><text class="text" x="182" y="202">IN</text><rect class="literal" x="172" y="215" width="64" height="25" rx="7"/><text class="text" x="182" y="232">NOT IN</text><a xlink:href="../grammar_diagrams#expression"><rect class="rule" x="266" y="35" width="89" height="25"/><text class="text" x="276" y="52">expression</text></a><polygon points="386,59 390,59 390,45 386,45" style="fill:black;stroke-width:0"/></svg>

if_expression

if_expression ::= { column_name { < | <= | = | >= | > | IN | NOT IN } 
                  expression } [ AND ... ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="390" height="245" viewbox="0 0 390 245"><path class="connector" d="M0 52h35m-5 0q-5 0-5-5v-20q0-5 5-5h142m46 0h142q5 0 5 5v20q0 5-5 5m-218 0h30m29 0h55m-94 25q0 5 5 5h5m38 0h31q5 0 5-5m-84 30q0 5 5 5h5m29 0h40q5 0 5-5m-84 30q0 5 5 5h5m38 0h31q5 0 5-5m-84 30q0 5 5 5h5m29 0h40q5 0 5-5m-84 30q0 5 5 5h5m34 0h35q5 0 5-5m-89-145q5 0 5 5v170q0 5 5 5h5m64 0h5q5 0 5-5v-170q0-5 5-5m5 0h10m89 0h35"/><polygon points="0,59 5,52 0,45" style="fill:black;stroke-width:0"/><rect class="literal" x="172" y="5" width="46" height="25" rx="7"/><text class="text" x="182" y="22">AND</text><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="35" y="35" width="107" height="25"/><text class="text" x="45" y="52">column_name</text></a><rect class="literal" x="172" y="35" width="29" height="25" rx="7"/><text class="text" x="182" y="52"><</text><rect class="literal" x="172" y="65" width="38" height="25" rx="7"/><text class="text" x="182" y="82"><=</text><rect class="literal" x="172" y="95" width="29" height="25" rx="7"/><text class="text" x="182" y="112">=</text><rect class="literal" x="172" y="125" width="38" height="25" rx="7"/><text class="text" x="182" y="142">>=</text><rect class="literal" x="172" y="155" width="29" height="25" rx="7"/><text class="text" x="182" y="172">></text><rect class="literal" x="172" y="185" width="34" height="25" rx="7"/><text class="text" x="182" y="202">IN</text><rect class="literal" x="172" y="215" width="64" height="25" rx="7"/><text class="text" x="182" y="232">NOT IN</text><a xlink:href="../grammar_diagrams#expression"><rect class="rule" x="266" y="35" width="89" height="25"/><text class="text" x="276" y="52">expression</text></a><polygon points="386,59 390,59 390,45 386,45" style="fill:black;stroke-width:0"/></svg>

insert

insert ::= INSERT INTO table_name ( column_name [ , ... ] ) VALUES ( 
           expression [ , ... ] )  
           [ IF { [ NOT ] EXISTS | if_expression } ] 
           [ USING using_expression ] 
           [ RETURNS STATUS AS ROW ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="785" height="160" viewbox="0 0 785 160"><path class="connector" d="M0 52h15m65 0h10m50 0h10m91 0h10m25 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h46m24 0h46q5 0 5 5v20q0 5-5 5m-5 0h30m25 0h10m68 0h10m25 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h34m24 0h35q5 0 5 5v20q0 5-5 5m-5 0h30m25 0h7m2 0h2m2 0h2m-763 35h2m2 0h2m2 0h27m32 0h50m45 0h20m-80 0q5 0 5 5v8q0 5 5 5h55q5 0 5-5v-8q0-5 5-5m5 0h10m64 0h20m-194 0q5 0 5 5v35q0 5 5 5h5m98 0h66q5 0 5-5v-35q0-5 5-5m5 0h20m-276 0q5 0 5 5v53q0 5 5 5h251q5 0 5-5v-53q0-5 5-5m5 0h30m60 0h10m123 0h20m-228 0q5 0 5 5v8q0 5 5 5h203q5 0 5-5v-8q0-5 5-5m5 0h30m181 0h20m-216 0q5 0 5 5v8q0 5 5 5h191q5 0 5-5v-8q0-5 5-5m5 0h15"/><polygon points="0,59 5,52 0,45" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="35" width="65" height="25" rx="7"/><text class="text" x="25" y="52">INSERT</text><rect class="literal" x="90" y="35" width="50" height="25" rx="7"/><text class="text" x="100" y="52">INTO</text><a xlink:href="../grammar_diagrams#table-name"><rect class="rule" x="150" y="35" width="91" height="25"/><text class="text" x="160" y="52">table_name</text></a><rect class="literal" x="251" y="35" width="25" height="25" rx="7"/><text class="text" x="261" y="52">(</text><rect class="literal" x="347" y="5" width="24" height="25" rx="7"/><text class="text" x="357" y="22">,</text><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="306" y="35" width="106" height="25"/><text class="text" x="316" y="52">column_name</text></a><rect class="literal" x="442" y="35" width="25" height="25" rx="7"/><text class="text" x="452" y="52">)</text><rect class="literal" x="477" y="35" width="68" height="25" rx="7"/><text class="text" x="487" y="52">VALUES</text><rect class="literal" x="555" y="35" width="25" height="25" rx="7"/><text class="text" x="565" y="52">(</text><rect class="literal" x="639" y="5" width="24" height="25" rx="7"/><text class="text" x="649" y="22">,</text><a xlink:href="../grammar_diagrams#expression"><rect class="rule" x="610" y="35" width="83" height="25"/><text class="text" x="620" y="52">expression</text></a><rect class="literal" x="723" y="35" width="25" height="25" rx="7"/><text class="text" x="733" y="52">)</text><rect class="literal" x="35" y="70" width="32" height="25" rx="7"/><text class="text" x="45" y="87">IF</text><rect class="literal" x="117" y="70" width="45" height="25" rx="7"/><text class="text" x="127" y="87">NOT</text><rect class="literal" x="192" y="70" width="64" height="25" rx="7"/><text class="text" x="202" y="87">EXISTS</text><a xlink:href="../grammar_diagrams#if-expression"><rect class="rule" x="97" y="115" width="98" height="25"/><text class="text" x="107" y="132">if_expression</text></a><rect class="literal" x="326" y="70" width="60" height="25" rx="7"/><text class="text" x="336" y="87">USING</text><a xlink:href="../grammar_diagrams#using-expression"><rect class="rule" x="396" y="70" width="123" height="25"/><text class="text" x="406" y="87">using_expression</text></a><rect class="literal" x="569" y="70" width="181" height="25" rx="7"/><text class="text" x="579" y="87">RETURNS STATUS AS ROW</text><polygon points="781,94 785,94 785,80 781,80" style="fill:black;stroke-width:0"/></svg>

using_expression

using_expression ::= ttl_or_timestamp_expression [ AND ... ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="275" height="65" viewbox="0 0 275 65"><path class="connector" d="M0 52h35m-5 0q-5 0-5-5v-20q0-5 5-5h84m46 0h85q5 0 5 5v20q0 5-5 5m-5 0h35"/><polygon points="0,59 5,52 0,45" style="fill:black;stroke-width:0"/><rect class="literal" x="114" y="5" width="46" height="25" rx="7"/><text class="text" x="124" y="22">AND</text><a xlink:href="../grammar_diagrams#ttl-or-timestamp-expression"><rect class="rule" x="35" y="35" width="205" height="25"/><text class="text" x="45" y="52">ttl_or_timestamp_expression</text></a><polygon points="271,59 275,59 275,45 271,45" style="fill:black;stroke-width:0"/></svg>

ttl_or_timestamp_expression

ttl_or_timestamp_expression ::= TTL ttl_expression
                                | TIMESTAMP timestamp_expression

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="334" height="65" viewbox="0 0 334 65"><path class="connector" d="M0 22h35m41 0h10m110 0h123m-299 0q5 0 5 5v20q0 5 5 5h5m91 0h10m163 0h5q5 0 5-5v-20q0-5 5-5m5 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="35" y="5" width="41" height="25" rx="7"/><text class="text" x="45" y="22">TTL</text><a xlink:href="../grammar_diagrams#ttl-expression"><rect class="rule" x="86" y="5" width="110" height="25"/><text class="text" x="96" y="22">ttl_expression</text></a><rect class="literal" x="35" y="35" width="91" height="25" rx="7"/><text class="text" x="45" y="52">TIMESTAMP</text><a xlink:href="../grammar_diagrams#timestamp-expression"><rect class="rule" x="136" y="35" width="163" height="25"/><text class="text" x="146" y="52">timestamp_expression</text></a><polygon points="330,29 334,29 334,15 330,15" style="fill:black;stroke-width:0"/></svg>

expression

expression ::= '<expression>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="137" height="35" viewbox="0 0 137 35"><path class="connector" d="M0 22h15m107 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="107" height="25" rx="7"/><text class="text" x="25" y="22"><expression></text><polygon points="133,29 137,29 137,15 133,15" style="fill:black;stroke-width:0"/></svg>

select

select ::= SELECT [ DISTINCT ] { * | column_name [ , ... ] } FROM 
           table_name  [ WHERE where_expression [ ALLOW FILTERING ] ]  
           [ IF if_expression ]  [ ORDER BY order_expression ]  
           [ LIMIT limit_expression ] [ OFFSET offset_expression ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="593" height="310" viewbox="0 0 593 310"><path class="connector" d="M0 22h15m67 0h30m79 0h20m-114 0q5 0 5 5v8q0 5 5 5h89q5 0 5-5v-8q0-5 5-5m5 0h30m28 0h139m-182 0q5 0 5 5v50q0 5 5 5h25m-5 0q-5 0-5-5v-20q0-5 5-5h46m24 0h47q5 0 5 5v20q0 5-5 5m-5 0h25q5 0 5-5v-50q0-5 5-5m5 0h10m55 0h10m95 0h7m2 0h2m2 0h2m-593 95h2m2 0h2m2 0h27m66 0h10m137 0h30m134 0h20m-169 0q5 0 5 5v8q0 5 5 5h144q5 0 5-5v-8q0-5 5-5m5 0h20m-432 0q5 0 5 5v23q0 5 5 5h407q5 0 5-5v-23q0-5 5-5m5 0h7m2 0h2m2 0h2m-467 65h2m2 0h2m2 0h27m32 0h10m104 0h20m-181 0q5 0 5 5v8q0 5 5 5h156q5 0 5-5v-8q0-5 5-5m5 0h7m2 0h2m2 0h2m-216 50h2m2 0h2m2 0h27m82 0h10m131 0h20m-258 0q5 0 5 5v8q0 5 5 5h233q5 0 5-5v-8q0-5 5-5m5 0h7m2 0h2m2 0h2m-293 50h2m2 0h2m2 0h27m54 0h10m122 0h20m-221 0q5 0 5 5v8q0 5 5 5h196q5 0 5-5v-8q0-5 5-5m5 0h30m67 0h10m133 0h20m-245 0q5 0 5 5v8q0 5 5 5h220q5 0 5-5v-8q0-5 5-5m5 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="67" height="25" rx="7"/><text class="text" x="25" y="22">SELECT</text><rect class="literal" x="112" y="5" width="79" height="25" rx="7"/><text class="text" x="122" y="22">DISTINCT</text><rect class="literal" x="241" y="5" width="28" height="25" rx="7"/><text class="text" x="251" y="22">*</text><rect class="literal" x="302" y="35" width="24" height="25" rx="7"/><text class="text" x="312" y="52">,</text><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="261" y="65" width="107" height="25"/><text class="text" x="271" y="82">column_name</text></a><rect class="literal" x="418" y="5" width="55" height="25" rx="7"/><text class="text" x="428" y="22">FROM</text><a xlink:href="../grammar_diagrams#table-name"><rect class="rule" x="483" y="5" width="95" height="25"/><text class="text" x="493" y="22">table_name</text></a><rect class="literal" x="35" y="100" width="66" height="25" rx="7"/><text class="text" x="45" y="117">WHERE</text><a xlink:href="../grammar_diagrams#where-expression"><rect class="rule" x="111" y="100" width="137" height="25"/><text class="text" x="121" y="117">where_expression</text></a><rect class="literal" x="278" y="100" width="134" height="25" rx="7"/><text class="text" x="288" y="117">ALLOW FILTERING</text><rect class="literal" x="35" y="165" width="32" height="25" rx="7"/><text class="text" x="45" y="182">IF</text><a xlink:href="../grammar_diagrams#if-expression"><rect class="rule" x="77" y="165" width="104" height="25"/><text class="text" x="87" y="182">if_expression</text></a><rect class="literal" x="35" y="215" width="82" height="25" rx="7"/><text class="text" x="45" y="232">ORDER BY</text><a xlink:href="../grammar_diagrams#order-expression"><rect class="rule" x="127" y="215" width="131" height="25"/><text class="text" x="137" y="232">order_expression</text></a><rect class="literal" x="35" y="265" width="54" height="25" rx="7"/><text class="text" x="45" y="282">LIMIT</text><a xlink:href="../grammar_diagrams#limit-expression"><rect class="rule" x="99" y="265" width="122" height="25"/><text class="text" x="109" y="282">limit_expression</text></a><rect class="literal" x="271" y="265" width="67" height="25" rx="7"/><text class="text" x="281" y="282">OFFSET</text><a xlink:href="../grammar_diagrams#offset-expression"><rect class="rule" x="348" y="265" width="133" height="25"/><text class="text" x="358" y="282">offset_expression</text></a><polygon points="512,289 516,289 516,275 512,275" style="fill:black;stroke-width:0"/></svg>

order_expression

order_expression ::= ( { column_name [ ASC | DESC ] } [ , ... ] )

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="351" height="100" viewbox="0 0 351 100"><path class="connector" d="M0 52h15m25 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h98m24 0h99q5 0 5 5v20q0 5-5 5m-109 0h30m45 0h29m-84 25q0 5 5 5h5m54 0h5q5 0 5-5m-79-25q5 0 5 5v33q0 5 5 5h64q5 0 5-5v-33q0-5 5-5m5 0h30m25 0h15"/><polygon points="0,59 5,52 0,45" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="35" width="25" height="25" rx="7"/><text class="text" x="25" y="52">(</text><rect class="literal" x="163" y="5" width="24" height="25" rx="7"/><text class="text" x="173" y="22">,</text><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="70" y="35" width="107" height="25"/><text class="text" x="80" y="52">column_name</text></a><rect class="literal" x="207" y="35" width="45" height="25" rx="7"/><text class="text" x="217" y="52">ASC</text><rect class="literal" x="207" y="65" width="54" height="25" rx="7"/><text class="text" x="217" y="82">DESC</text><rect class="literal" x="311" y="35" width="25" height="25" rx="7"/><text class="text" x="321" y="52">)</text><polygon points="347,59 351,59 351,45 347,45" style="fill:black;stroke-width:0"/></svg>

update

update ::= UPDATE table_name [ USING using_expression ] SET assignment 
           [ , ... ]  WHERE where_expression 
           [ IF { if_expression
                  | [ NOT ] EXISTS
                  | if_expression OR [ NOT ] EXISTS } ] 
           [ RETURNS STATUS AS ROW ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="930" height="220" viewbox="0 0 930 220"><path class="connector" d="M0 52h15m69 0h10m95 0h30m60 0h10m131 0h20m-236 0q5 0 5 5v8q0 5 5 5h211q5 0 5-5v-8q0-5 5-5m5 0h10m43 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h39m24 0h40q5 0 5 5v20q0 5-5 5m-5 0h27m2 0h2m2 0h2m-651 50h2m2 0h2m2 0h7m66 0h10m137 0h30m32 0h30m104 0h238m-352 25q0 5 5 5h25m46 0h20m-81 0q5 0 5 5v8q0 5 5 5h56q5 0 5-5v-8q0-5 5-5m5 0h10m64 0h167q5 0 5-5m-347-25q5 0 5 5v65q0 5 5 5h5m104 0h10m38 0h30m46 0h20m-81 0q5 0 5 5v8q0 5 5 5h56q5 0 5-5v-8q0-5 5-5m5 0h10m64 0h5q5 0 5-5v-65q0-5 5-5m5 0h20m-439 0q5 0 5 5v98q0 5 5 5h414q5 0 5-5v-98q0-5 5-5m5 0h30m183 0h20m-218 0q5 0 5 5v8q0 5 5 5h193q5 0 5-5v-8q0-5 5-5m5 0h15"/><polygon points="0,59 5,52 0,45" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="35" width="69" height="25" rx="7"/><text class="text" x="25" y="52">UPDATE</text><a xlink:href="../grammar_diagrams#table-name"><rect class="rule" x="94" y="35" width="95" height="25"/><text class="text" x="104" y="52">table_name</text></a><rect class="literal" x="219" y="35" width="60" height="25" rx="7"/><text class="text" x="229" y="52">USING</text><a xlink:href="../grammar_diagrams#using-expression"><rect class="rule" x="289" y="35" width="131" height="25"/><text class="text" x="299" y="52">using_expression</text></a><rect class="literal" x="450" y="35" width="43" height="25" rx="7"/><text class="text" x="460" y="52">SET</text><rect class="literal" x="557" y="5" width="24" height="25" rx="7"/><text class="text" x="567" y="22">,</text><a xlink:href="../grammar_diagrams#assignment"><rect class="rule" x="523" y="35" width="93" height="25"/><text class="text" x="533" y="52">assignment</text></a><rect class="literal" x="15" y="85" width="66" height="25" rx="7"/><text class="text" x="25" y="102">WHERE</text><a xlink:href="../grammar_diagrams#where-expression"><rect class="rule" x="91" y="85" width="137" height="25"/><text class="text" x="101" y="102">where_expression</text></a><rect class="literal" x="258" y="85" width="32" height="25" rx="7"/><text class="text" x="268" y="102">IF</text><a xlink:href="../grammar_diagrams#if-expression"><rect class="rule" x="320" y="85" width="104" height="25"/><text class="text" x="330" y="102">if_expression</text></a><rect class="literal" x="340" y="115" width="46" height="25" rx="7"/><text class="text" x="350" y="132">NOT</text><rect class="literal" x="416" y="115" width="64" height="25" rx="7"/><text class="text" x="426" y="132">EXISTS</text><a xlink:href="../grammar_diagrams#if-expression"><rect class="rule" x="320" y="160" width="104" height="25"/><text class="text" x="330" y="177">if_expression</text></a><rect class="literal" x="434" y="160" width="38" height="25" rx="7"/><text class="text" x="444" y="177">OR</text><rect class="literal" x="502" y="160" width="46" height="25" rx="7"/><text class="text" x="512" y="177">NOT</text><rect class="literal" x="578" y="160" width="64" height="25" rx="7"/><text class="text" x="588" y="177">EXISTS</text><rect class="literal" x="712" y="85" width="183" height="25" rx="7"/><text class="text" x="722" y="102">RETURNS STATUS AS ROW</text><polygon points="926,109 930,109 930,95 926,95" style="fill:black;stroke-width:0"/></svg>

transaction_block

transaction_block ::= BEGIN TRANSACTION  
                      { { insert | update | delete } ; } [ ... ]  END 
                      TRANSACTION ;

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="229" height="180" viewbox="0 0 229 180"><path class="connector" d="M0 22h15m59 0h10m108 0h7m2 0h2m2 0h2m-207 50h2m2 0h2m2 0h27m-5 0q-5 0-5-5v-17q0-5 5-5h150q5 0 5 5v17q0 5-5 5m-145 0h20m56 0h29m-95 25q0 5 5 5h5m65 0h5q5 0 5-5m-90-25q5 0 5 5v50q0 5 5 5h5m60 0h10q5 0 5-5v-50q0-5 5-5m5 0h10m25 0h27m2 0h2m2 0h2m-210 95h2m2 0h2m2 0h7m46 0h10m108 0h10m25 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="59" height="25" rx="7"/><text class="text" x="25" y="22">BEGIN</text><rect class="literal" x="84" y="5" width="108" height="25" rx="7"/><text class="text" x="94" y="22">TRANSACTION</text><a xlink:href="../grammar_diagrams#insert"><rect class="rule" x="55" y="55" width="56" height="25"/><text class="text" x="65" y="72">insert</text></a><a xlink:href="../grammar_diagrams#update"><rect class="rule" x="55" y="85" width="65" height="25"/><text class="text" x="65" y="102">update</text></a><a xlink:href="../grammar_diagrams#delete"><rect class="rule" x="55" y="115" width="60" height="25"/><text class="text" x="65" y="132">delete</text></a><rect class="literal" x="150" y="55" width="25" height="25" rx="7"/><text class="text" x="160" y="72">;</text><rect class="literal" x="15" y="150" width="46" height="25" rx="7"/><text class="text" x="25" y="167">END</text><rect class="literal" x="71" y="150" width="108" height="25" rx="7"/><text class="text" x="81" y="167">TRANSACTION</text><rect class="literal" x="189" y="150" width="25" height="25" rx="7"/><text class="text" x="199" y="167">;</text><polygon points="225,174 229,174 229,160 225,160" style="fill:black;stroke-width:0"/></svg>

truncate

truncate ::= TRUNCATE [ TABLE ] table_name

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="328" height="50" viewbox="0 0 328 50"><path class="connector" d="M0 22h15m85 0h30m58 0h20m-93 0q5 0 5 5v8q0 5 5 5h68q5 0 5-5v-8q0-5 5-5m5 0h10m95 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="85" height="25" rx="7"/><text class="text" x="25" y="22">TRUNCATE</text><rect class="literal" x="130" y="5" width="58" height="25" rx="7"/><text class="text" x="140" y="22">TABLE</text><a xlink:href="../grammar_diagrams#table-name"><rect class="rule" x="218" y="5" width="95" height="25"/><text class="text" x="228" y="22">table_name</text></a><polygon points="324,29 328,29 328,15 324,15" style="fill:black;stroke-width:0"/></svg>

assignment

assignment ::= column_name = expression

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="275" height="35" viewbox="0 0 275 35"><path class="connector" d="M0 22h15m107 0h10m29 0h10m89 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><a xlink:href="../grammar_diagrams#column-name"><rect class="rule" x="15" y="5" width="107" height="25"/><text class="text" x="25" y="22">column_name</text></a><rect class="literal" x="132" y="5" width="29" height="25" rx="7"/><text class="text" x="142" y="22">=</text><a xlink:href="../grammar_diagrams#expression"><rect class="rule" x="171" y="5" width="89" height="25"/><text class="text" x="181" y="22">expression</text></a><polygon points="271,29 275,29 275,15 271,15" style="fill:black;stroke-width:0"/></svg>

ttl_expression

ttl_expression ::= '<Integer Literal>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="158" height="35" viewbox="0 0 158 35"><path class="connector" d="M0 22h15m128 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="128" height="25" rx="7"/><text class="text" x="25" y="22"><Integer Literal></text><polygon points="154,29 158,29 158,15 154,15" style="fill:black;stroke-width:0"/></svg>

timestamp_expression

timestamp_expression ::= '<Integer Literal>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="158" height="35" viewbox="0 0 158 35"><path class="connector" d="M0 22h15m128 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="128" height="25" rx="7"/><text class="text" x="25" y="22"><Integer Literal></text><polygon points="154,29 158,29 158,15 154,15" style="fill:black;stroke-width:0"/></svg>

limit_expression

limit_expression ::= '<Integer Literal>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="158" height="35" viewbox="0 0 158 35"><path class="connector" d="M0 22h15m128 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="128" height="25" rx="7"/><text class="text" x="25" y="22"><Integer Literal></text><polygon points="154,29 158,29 158,15 154,15" style="fill:black;stroke-width:0"/></svg>

offset_expression

offset_expression ::= '<Integer Literal>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="158" height="35" viewbox="0 0 158 35"><path class="connector" d="M0 22h15m128 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="128" height="25" rx="7"/><text class="text" x="25" y="22"><Integer Literal></text><polygon points="154,29 158,29 158,15 154,15" style="fill:black;stroke-width:0"/></svg>

keyspace_name

keyspace_name ::= '<Text Literal>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="138" height="35" viewbox="0 0 138 35"><path class="connector" d="M0 22h15m108 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="108" height="25" rx="7"/><text class="text" x="25" y="22"><Text Literal></text><polygon points="134,29 138,29 138,15 134,15" style="fill:black;stroke-width:0"/></svg>

property_name

property_name ::= '<Text Literal>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="138" height="35" viewbox="0 0 138 35"><path class="connector" d="M0 22h15m108 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="108" height="25" rx="7"/><text class="text" x="25" y="22"><Text Literal></text><polygon points="134,29 138,29 138,15 134,15" style="fill:black;stroke-width:0"/></svg>

property_literal

property_literal ::= '<Text Literal>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="138" height="35" viewbox="0 0 138 35"><path class="connector" d="M0 22h15m108 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="108" height="25" rx="7"/><text class="text" x="25" y="22"><Text Literal></text><polygon points="134,29 138,29 138,15 134,15" style="fill:black;stroke-width:0"/></svg>

table_name

table_name ::= [ keyspace_name . ] '<Text Literal>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="344" height="50" viewbox="0 0 344 50"><path class="connector" d="M0 22h35m122 0h10m24 0h20m-191 0q5 0 5 5v8q0 5 5 5h166q5 0 5-5v-8q0-5 5-5m5 0h10m108 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><a xlink:href="../grammar_diagrams#keyspace-name"><rect class="rule" x="35" y="5" width="122" height="25"/><text class="text" x="45" y="22">keyspace_name</text></a><rect class="literal" x="167" y="5" width="24" height="25" rx="7"/><text class="text" x="177" y="22">.</text><rect class="literal" x="221" y="5" width="108" height="25" rx="7"/><text class="text" x="231" y="22"><Text Literal></text><polygon points="340,29 344,29 344,15 340,15" style="fill:black;stroke-width:0"/></svg>

index_name

index_name ::= '<Text Literal>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="138" height="35" viewbox="0 0 138 35"><path class="connector" d="M0 22h15m108 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="108" height="25" rx="7"/><text class="text" x="25" y="22"><Text Literal></text><polygon points="134,29 138,29 138,15 134,15" style="fill:black;stroke-width:0"/></svg>

column_name

column_name ::= '<Text Literal>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="138" height="35" viewbox="0 0 138 35"><path class="connector" d="M0 22h15m108 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="108" height="25" rx="7"/><text class="text" x="25" y="22"><Text Literal></text><polygon points="134,29 138,29 138,15 134,15" style="fill:black;stroke-width:0"/></svg>

type_name

type_name ::= [ keyspace_name . ] '<Text Literal>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="344" height="50" viewbox="0 0 344 50"><path class="connector" d="M0 22h35m122 0h10m24 0h20m-191 0q5 0 5 5v8q0 5 5 5h166q5 0 5-5v-8q0-5 5-5m5 0h10m108 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><a xlink:href="../grammar_diagrams#keyspace-name"><rect class="rule" x="35" y="5" width="122" height="25"/><text class="text" x="45" y="22">keyspace_name</text></a><rect class="literal" x="167" y="5" width="24" height="25" rx="7"/><text class="text" x="177" y="22">.</text><rect class="literal" x="221" y="5" width="108" height="25" rx="7"/><text class="text" x="231" y="22"><Text Literal></text><polygon points="340,29 344,29 344,15 340,15" style="fill:black;stroke-width:0"/></svg>

field_name

field_name ::= '<Text Literal>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="138" height="35" viewbox="0 0 138 35"><path class="connector" d="M0 22h15m108 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="108" height="25" rx="7"/><text class="text" x="25" y="22"><Text Literal></text><polygon points="134,29 138,29 138,15 134,15" style="fill:black;stroke-width:0"/></svg>

alter_role

alter_role ::= ALTER ROLE role_name WITH role_property [ AND ... ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="468" height="65" viewbox="0 0 468 65"><path class="connector" d="M0 52h15m58 0h10m53 0h10m87 0h10m54 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h35m46 0h35q5 0 5 5v20q0 5-5 5m-5 0h35"/><polygon points="0,59 5,52 0,45" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="35" width="58" height="25" rx="7"/><text class="text" x="25" y="52">ALTER</text><rect class="literal" x="83" y="35" width="53" height="25" rx="7"/><text class="text" x="93" y="52">ROLE</text><a xlink:href="../grammar_diagrams#role-name"><rect class="rule" x="146" y="35" width="87" height="25"/><text class="text" x="156" y="52">role_name</text></a><rect class="literal" x="243" y="35" width="54" height="25" rx="7"/><text class="text" x="253" y="52">WITH</text><rect class="literal" x="357" y="5" width="46" height="25" rx="7"/><text class="text" x="367" y="22">AND</text><a xlink:href="../grammar_diagrams#role-property"><rect class="rule" x="327" y="35" width="106" height="25"/><text class="text" x="337" y="52">role_property</text></a><polygon points="464,59 468,59 468,45 464,45" style="fill:black;stroke-width:0"/></svg>

create_role

create_role ::= CREATE ROLE [ IF NOT EXISTS ] role_name 
                [ WITH role_property [ AND ... ] ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="730" height="80" viewbox="0 0 730 80"><path class="connector" d="M0 52h15m68 0h10m53 0h30m32 0h10m46 0h10m64 0h20m-197 0q5 0 5 5v8q0 5 5 5h172q5 0 5-5v-8q0-5 5-5m5 0h10m87 0h30m54 0h30m-5 0q-5 0-5-5v-20q0-5 5-5h35m46 0h35q5 0 5 5v20q0 5-5 5m-5 0h40m-245 0q5 0 5 5v8q0 5 5 5h220q5 0 5-5v-8q0-5 5-5m5 0h15"/><polygon points="0,59 5,52 0,45" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="35" width="68" height="25" rx="7"/><text class="text" x="25" y="52">CREATE</text><rect class="literal" x="93" y="35" width="53" height="25" rx="7"/><text class="text" x="103" y="52">ROLE</text><rect class="literal" x="176" y="35" width="32" height="25" rx="7"/><text class="text" x="186" y="52">IF</text><rect class="literal" x="218" y="35" width="46" height="25" rx="7"/><text class="text" x="228" y="52">NOT</text><rect class="literal" x="274" y="35" width="64" height="25" rx="7"/><text class="text" x="284" y="52">EXISTS</text><a xlink:href="../grammar_diagrams#role-name"><rect class="rule" x="368" y="35" width="87" height="25"/><text class="text" x="378" y="52">role_name</text></a><rect class="literal" x="485" y="35" width="54" height="25" rx="7"/><text class="text" x="495" y="52">WITH</text><rect class="literal" x="599" y="5" width="46" height="25" rx="7"/><text class="text" x="609" y="22">AND</text><a xlink:href="../grammar_diagrams#role-property"><rect class="rule" x="569" y="35" width="106" height="25"/><text class="text" x="579" y="52">role_property</text></a><polygon points="726,59 730,59 730,45 726,45" style="fill:black;stroke-width:0"/></svg>

role_property

role_property ::= PASSWORD = '<Text Literal>'
                  | LOGIN = '<Boolean Literal>'
                  | SUPERUSER = '<Boolean Literal>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="345" height="95" viewbox="0 0 345 95"><path class="connector" d="M0 22h35m92 0h10m29 0h10m108 0h46m-305 25q0 5 5 5h5m60 0h10m29 0h10m132 0h39q5 0 5-5m-300-25q5 0 5 5v50q0 5 5 5h5m94 0h10m29 0h10m132 0h5q5 0 5-5v-50q0-5 5-5m5 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="35" y="5" width="92" height="25" rx="7"/><text class="text" x="45" y="22">PASSWORD</text><rect class="literal" x="137" y="5" width="29" height="25" rx="7"/><text class="text" x="147" y="22">=</text><rect class="literal" x="176" y="5" width="108" height="25" rx="7"/><text class="text" x="186" y="22"><Text Literal></text><rect class="literal" x="35" y="35" width="60" height="25" rx="7"/><text class="text" x="45" y="52">LOGIN</text><rect class="literal" x="105" y="35" width="29" height="25" rx="7"/><text class="text" x="115" y="52">=</text><rect class="literal" x="144" y="35" width="132" height="25" rx="7"/><text class="text" x="154" y="52"><Boolean Literal></text><rect class="literal" x="35" y="65" width="94" height="25" rx="7"/><text class="text" x="45" y="82">SUPERUSER</text><rect class="literal" x="139" y="65" width="29" height="25" rx="7"/><text class="text" x="149" y="82">=</text><rect class="literal" x="178" y="65" width="132" height="25" rx="7"/><text class="text" x="188" y="82"><Boolean Literal></text><polygon points="341,29 345,29 345,15 341,15" style="fill:black;stroke-width:0"/></svg>

drop_role

drop_role ::= DROP ROLE [ IF EXISTS ] role_name

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="401" height="50" viewbox="0 0 401 50"><path class="connector" d="M0 22h15m55 0h10m53 0h30m32 0h10m64 0h20m-141 0q5 0 5 5v8q0 5 5 5h116q5 0 5-5v-8q0-5 5-5m5 0h10m87 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="55" height="25" rx="7"/><text class="text" x="25" y="22">DROP</text><rect class="literal" x="80" y="5" width="53" height="25" rx="7"/><text class="text" x="90" y="22">ROLE</text><rect class="literal" x="163" y="5" width="32" height="25" rx="7"/><text class="text" x="173" y="22">IF</text><rect class="literal" x="205" y="5" width="64" height="25" rx="7"/><text class="text" x="215" y="22">EXISTS</text><a xlink:href="../grammar_diagrams#role-name"><rect class="rule" x="299" y="5" width="87" height="25"/><text class="text" x="309" y="22">role_name</text></a><polygon points="397,29 401,29 401,15 397,15" style="fill:black;stroke-width:0"/></svg>

grant_role

grant_role ::= GRANT role_name TO role_name

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="332" height="35" viewbox="0 0 332 35"><path class="connector" d="M0 22h15m61 0h10m87 0h10m37 0h10m87 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="61" height="25" rx="7"/><text class="text" x="25" y="22">GRANT</text><a xlink:href="../grammar_diagrams#role-name"><rect class="rule" x="86" y="5" width="87" height="25"/><text class="text" x="96" y="22">role_name</text></a><rect class="literal" x="183" y="5" width="37" height="25" rx="7"/><text class="text" x="193" y="22">TO</text><a xlink:href="../grammar_diagrams#role-name"><rect class="rule" x="230" y="5" width="87" height="25"/><text class="text" x="240" y="22">role_name</text></a><polygon points="328,29 332,29 332,15 328,15" style="fill:black;stroke-width:0"/></svg>

revoke_role

revoke_role ::= REVOKE role_name FROM role_name

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="359" height="35" viewbox="0 0 359 35"><path class="connector" d="M0 22h15m70 0h10m87 0h10m55 0h10m87 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="70" height="25" rx="7"/><text class="text" x="25" y="22">REVOKE</text><a xlink:href="../grammar_diagrams#role-name"><rect class="rule" x="95" y="5" width="87" height="25"/><text class="text" x="105" y="22">role_name</text></a><rect class="literal" x="192" y="5" width="55" height="25" rx="7"/><text class="text" x="202" y="22">FROM</text><a xlink:href="../grammar_diagrams#role-name"><rect class="rule" x="257" y="5" width="87" height="25"/><text class="text" x="267" y="22">role_name</text></a><polygon points="355,29 359,29 359,15 355,15" style="fill:black;stroke-width:0"/></svg>

grant_permission

grant_permission ::= GRANT { all_permissions | permission } ON 
                     resource TO role_name

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="536" height="65" viewbox="0 0 536 65"><path class="connector" d="M0 22h15m61 0h30m117 0h20m-152 0q5 0 5 5v20q0 5 5 5h5m88 0h34q5 0 5-5v-20q0-5 5-5m5 0h10m39 0h10m75 0h10m37 0h10m87 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="61" height="25" rx="7"/><text class="text" x="25" y="22">GRANT</text><a xlink:href="../grammar_diagrams#all-permissions"><rect class="rule" x="106" y="5" width="117" height="25"/><text class="text" x="116" y="22">all_permissions</text></a><a xlink:href="../grammar_diagrams#permission"><rect class="rule" x="106" y="35" width="88" height="25"/><text class="text" x="116" y="52">permission</text></a><rect class="literal" x="253" y="5" width="39" height="25" rx="7"/><text class="text" x="263" y="22">ON</text><a xlink:href="../grammar_diagrams#resource"><rect class="rule" x="302" y="5" width="75" height="25"/><text class="text" x="312" y="22">resource</text></a><rect class="literal" x="387" y="5" width="37" height="25" rx="7"/><text class="text" x="397" y="22">TO</text><a xlink:href="../grammar_diagrams#role-name"><rect class="rule" x="434" y="5" width="87" height="25"/><text class="text" x="444" y="22">role_name</text></a><polygon points="532,29 536,29 536,15 532,15" style="fill:black;stroke-width:0"/></svg>

revoke_permission

revoke_permission ::= REVOKE { all_permissions | permission } ON 
                      resource FROM role_name

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="563" height="65" viewbox="0 0 563 65"><path class="connector" d="M0 22h15m70 0h30m117 0h20m-152 0q5 0 5 5v20q0 5 5 5h5m88 0h34q5 0 5-5v-20q0-5 5-5m5 0h10m39 0h10m75 0h10m55 0h10m87 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="70" height="25" rx="7"/><text class="text" x="25" y="22">REVOKE</text><a xlink:href="../grammar_diagrams#all-permissions"><rect class="rule" x="115" y="5" width="117" height="25"/><text class="text" x="125" y="22">all_permissions</text></a><a xlink:href="../grammar_diagrams#permission"><rect class="rule" x="115" y="35" width="88" height="25"/><text class="text" x="125" y="52">permission</text></a><rect class="literal" x="262" y="5" width="39" height="25" rx="7"/><text class="text" x="272" y="22">ON</text><a xlink:href="../grammar_diagrams#resource"><rect class="rule" x="311" y="5" width="75" height="25"/><text class="text" x="321" y="22">resource</text></a><rect class="literal" x="396" y="5" width="55" height="25" rx="7"/><text class="text" x="406" y="22">FROM</text><a xlink:href="../grammar_diagrams#role-name"><rect class="rule" x="461" y="5" width="87" height="25"/><text class="text" x="471" y="22">role_name</text></a><polygon points="559,29 563,29 563,15 559,15" style="fill:black;stroke-width:0"/></svg>

all_permissions

all_permissions ::= ALL [ PERMISSIONS ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="229" height="50" viewbox="0 0 229 50"><path class="connector" d="M0 22h15m42 0h30m107 0h20m-142 0q5 0 5 5v8q0 5 5 5h117q5 0 5-5v-8q0-5 5-5m5 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="42" height="25" rx="7"/><text class="text" x="25" y="22">ALL</text><rect class="literal" x="87" y="5" width="107" height="25" rx="7"/><text class="text" x="97" y="22">PERMISSIONS</text><polygon points="225,29 229,29 229,15 225,15" style="fill:black;stroke-width:0"/></svg>

role_name

role_name ::= '<Text Literal>'

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="138" height="35" viewbox="0 0 138 35"><path class="connector" d="M0 22h15m108 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="108" height="25" rx="7"/><text class="text" x="25" y="22"><Text Literal></text><polygon points="134,29 138,29 138,15 134,15" style="fill:black;stroke-width:0"/></svg>

permission

permission ::= { CREATE
                 | ALTER
                 | DROP
                 | SELECT
                 | MODIFY
                 | AUTHORIZE
                 | DESCRIBE
                 | EXECUTE } [ PERMISSION ]

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="311" height="245" viewbox="0 0 311 245"><path class="connector" d="M0 22h35m68 0h44m-122 25q0 5 5 5h5m58 0h39q5 0 5-5m-112 30q0 5 5 5h5m55 0h42q5 0 5-5m-112 30q0 5 5 5h5m67 0h30q5 0 5-5m-112 30q0 5 5 5h5m68 0h29q5 0 5-5m-112 30q0 5 5 5h5m92 0h5q5 0 5-5m-112 30q0 5 5 5h5m83 0h14q5 0 5-5m-117-175q5 0 5 5v200q0 5 5 5h5m77 0h20q5 0 5-5v-200q0-5 5-5m5 0h30m99 0h20m-134 0q5 0 5 5v8q0 5 5 5h109q5 0 5-5v-8q0-5 5-5m5 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="35" y="5" width="68" height="25" rx="7"/><text class="text" x="45" y="22">CREATE</text><rect class="literal" x="35" y="35" width="58" height="25" rx="7"/><text class="text" x="45" y="52">ALTER</text><rect class="literal" x="35" y="65" width="55" height="25" rx="7"/><text class="text" x="45" y="82">DROP</text><rect class="literal" x="35" y="95" width="67" height="25" rx="7"/><text class="text" x="45" y="112">SELECT</text><rect class="literal" x="35" y="125" width="68" height="25" rx="7"/><text class="text" x="45" y="142">MODIFY</text><rect class="literal" x="35" y="155" width="92" height="25" rx="7"/><text class="text" x="45" y="172">AUTHORIZE</text><rect class="literal" x="35" y="185" width="83" height="25" rx="7"/><text class="text" x="45" y="202">DESCRIBE</text><rect class="literal" x="35" y="215" width="77" height="25" rx="7"/><text class="text" x="45" y="232">EXECUTE</text><rect class="literal" x="177" y="5" width="99" height="25" rx="7"/><text class="text" x="187" y="22">PERMISSION</text><polygon points="307,29 311,29 311,15 307,15" style="fill:black;stroke-width:0"/></svg>

resource

resource ::= ALL { KEYSPACES | ROLES }
             | KEYSPACE keyspace_name
             | [ TABLE ] table_name
             | ROLE role_name

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="286" height="170" viewbox="0 0 286 170"><path class="connector" d="M0 22h35m42 0h30m92 0h20m-127 0q5 0 5 5v20q0 5 5 5h5m61 0h36q5 0 5-5v-20q0-5 5-5m5 0h52m-246 55q0 5 5 5h5m84 0h10m122 0h5q5 0 5-5m-236 30q0 5 5 5h25m58 0h20m-93 0q5 0 5 5v8q0 5 5 5h68q5 0 5-5v-8q0-5 5-5m5 0h10m95 0h18q5 0 5-5m-241-85q5 0 5 5v125q0 5 5 5h5m53 0h10m87 0h71q5 0 5-5v-125q0-5 5-5m5 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="35" y="5" width="42" height="25" rx="7"/><text class="text" x="45" y="22">ALL</text><rect class="literal" x="107" y="5" width="92" height="25" rx="7"/><text class="text" x="117" y="22">KEYSPACES</text><rect class="literal" x="107" y="35" width="61" height="25" rx="7"/><text class="text" x="117" y="52">ROLES</text><rect class="literal" x="35" y="65" width="84" height="25" rx="7"/><text class="text" x="45" y="82">KEYSPACE</text><a xlink:href="../grammar_diagrams#keyspace-name"><rect class="rule" x="129" y="65" width="122" height="25"/><text class="text" x="139" y="82">keyspace_name</text></a><rect class="literal" x="55" y="95" width="58" height="25" rx="7"/><text class="text" x="65" y="112">TABLE</text><a xlink:href="../grammar_diagrams#table-name"><rect class="rule" x="143" y="95" width="95" height="25"/><text class="text" x="153" y="112">table_name</text></a><rect class="literal" x="35" y="140" width="53" height="25" rx="7"/><text class="text" x="45" y="157">ROLE</text><a xlink:href="../grammar_diagrams#role-name"><rect class="rule" x="98" y="140" width="87" height="25"/><text class="text" x="108" y="157">role_name</text></a><polygon points="282,29 286,29 286,15 282,15" style="fill:black;stroke-width:0"/></svg>

alter_keyspace

alter_keyspace ::= ALTER { KEYSPACE | SCHEMA } keyspae_name 
                   keyspace_properties

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="510" height="65" viewbox="0 0 510 65"><path class="connector" d="M0 22h15m58 0h30m84 0h20m-119 0q5 0 5 5v20q0 5 5 5h5m72 0h17q5 0 5-5v-20q0-5 5-5m5 0h10m116 0h10m152 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="58" height="25" rx="7"/><text class="text" x="25" y="22">ALTER</text><rect class="literal" x="103" y="5" width="84" height="25" rx="7"/><text class="text" x="113" y="22">KEYSPACE</text><rect class="literal" x="103" y="35" width="72" height="25" rx="7"/><text class="text" x="113" y="52">SCHEMA</text><a xlink:href="../grammar_diagrams#keyspae-name"><rect class="rule" x="217" y="5" width="116" height="25"/><text class="text" x="227" y="22">keyspae_name</text></a><a xlink:href="../grammar_diagrams#keyspace-properties"><rect class="rule" x="343" y="5" width="152" height="25"/><text class="text" x="353" y="22">keyspace_properties</text></a><polygon points="506,29 510,29 510,15 506,15" style="fill:black;stroke-width:0"/></svg>

explain

explain ::= EXPLAIN { select | update | insert | delete }

<svg class="rrdiagram" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" width="213" height="125" viewbox="0 0 213 125"><path class="connector" d="M0 22h15m72 0h30m54 0h27m-91 25q0 5 5 5h5m61 0h5q5 0 5-5m-81 30q0 5 5 5h5m54 0h12q5 0 5-5m-86-55q5 0 5 5v80q0 5 5 5h5m56 0h10q5 0 5-5v-80q0-5 5-5m5 0h15"/><polygon points="0,29 5,22 0,15" style="fill:black;stroke-width:0"/><rect class="literal" x="15" y="5" width="72" height="25" rx="7"/><text class="text" x="25" y="22">EXPLAIN</text><a xlink:href="../grammar_diagrams#select"><rect class="rule" x="117" y="5" width="54" height="25"/><text class="text" x="127" y="22">select</text></a><a xlink:href="../grammar_diagrams#update"><rect class="rule" x="117" y="35" width="61" height="25"/><text class="text" x="127" y="52">update</text></a><a xlink:href="../grammar_diagrams#insert"><rect class="rule" x="117" y="65" width="54" height="25"/><text class="text" x="127" y="82">insert</text></a><a xlink:href="../grammar_diagrams#delete"><rect class="rule" x="117" y="95" width="56" height="25"/><text class="text" x="127" y="112">delete</text></a><polygon points="209,29 213,29 213,15 209,15" style="fill:black;stroke-width:0"/></svg>