Important
New database features are no longer connected to engine versions; features are now enabled independently during scheduled update windows, and “major” and “minor” releases no longer exist in Helios. Please visit the release notes to view the latest features available in your database clusters.
SHOW CREATE TABLE
On this page
The SHOW CREATE TABLE command shows the CREATE TABLE statement that was used to create the table.
Syntax
SHOW CREATE TABLE table_nameArguments
table_
The name of the table.
Remarks
-
Conditional comments are removed by default.
-
See the Permission Matrix for the required permission.
Examples
Example 1
The following example shows the output of SHOW CREATE TABLE for a rowstore table with sparse compression.
Create the table:
CREATE ROWSTORE TABLE table_1(a INT, b DECIMAL) COMPRESSION = SPARSE;
Show the table:
SHOW CREATE TABLE table_1;
Output of the Create Table
column for the table_ row:
CREATE ROWSTORE TABLE `table_1` (
`a` int(11) DEFAULT NULL,
`b` decimal(10,0) DEFAULT NULL
, SHARD KEY ()
) AUTOSTATS_CARDINALITY_MODE=PERIODIC AUTOSTATS_HISTOGRAM_MODE=CREATE SQL_MODE='STRICT_ALL_TABLES'
COMPRESSION=SPARSEExample 2
The following example shows the output of SHOW CREATE TABLE for a columnstore table.
Create the table:
CREATE TABLE table_2(a INT, b VARCHAR(50), SORT KEY(b));
Show the table:
SHOW CREATE TABLE table_2;
Output of the Create Table
column for the table_ row:
CREATE TABLE `table_2` (
`a` int(11) DEFAULT NULL,
`b` varbinary(50) DEFAULT NULL,
KEY `b` (`b`) USING CLUSTERED COLUMNSTORE
, SHARD KEY ()
) AUTOSTATS_CARDINALITY_MODE=INCREMENTAL AUTOSTATS_HISTOGRAM_MODE=CREATE AUTOSTATS_SAMPLING=ON SQL_MODE='STRICT_ALL_TABLES'Last modified: