@@ -708,6 +708,55 @@ new columns (see `ALTER TABLE`) is a constant time operation. There is
708708thus no need to try to anticipate future usage (or to cry when you
709709haven’t) when creating a table.
710710
711+ [[copyTableStmt]]
712+ === CREATE TABLE LIKE
713+
714+ _Syntax:_
715+
716+ [source,bnf]
717+ include::cassandra:example$BNF/create_table_like.bnf[]
718+
719+ _Sample:_
720+
721+ [source,sql]
722+ ----
723+ include::cassandra:example$CQL/create_table_like.cql[]
724+ ----
725+
726+ The `CREATE TABLE LIKE` statement creates a new empty table based on
727+ the definition of an already existing table. By default, the new table
728+ will have the same schema as the existing table.
729+
730+ The statement allows changing the new table's options using the `WITH`
731+ keyword. Additionally, the new table can create indexes with the same
732+ schema as the existing table's indexes if the `INDEXES` keyword is specified.
733+ However, only SAI and legacy secondary indexes are supported. TRIGGER
734+ and MATERIALIZED VIEW are not supported at this time.
735+
736+ Attempting to create a table that already exists will return an error
737+ unless the IF NOT EXISTS option is used. If this option is used, the
738+ statement will have no effect if the table already exists.
739+
740+ [[copyTableStmt]]
741+ ==== `<tablename>`
742+
743+ Valid the newly created table names are the same as valid
744+ link:#createTableStmt[table names] (up to 32 characters long
745+ alphanumerical identifiers). If the table name is provided alone, the
746+ table is created within the current keyspace (see `USE`), but if it is
747+ prefixed by an existing keyspace name (see
748+ link:#copyTableStmt[`<tablename>`] grammar), it is created in the specified
749+ keyspace (but does *not* change the current keyspace).
750+
751+ [[createTableLikeOptions]]
752+ ==== `<like option>`
753+
754+ The table options specified by `CREATE TABLE LIKE` statement are the same
755+ as the supported link:#createTableOptions[supported `<option>`] in the
756+ `CREATE TABLE` statement. And both are set throught keyword `WITH`.
757+
758+ Indexs will be created together with table if `INDEXES` keyword is used.
759+
711760[[alterTableStmt]]
712761==== ALTER TABLE
713762
0 commit comments