Important
The SingleStore 9.1 release candidate (RC) is available now. It will be promoted to general availability (GA) soon and at that time it will be renamed to SingleStore 10.
In the interim, SingleStore 9.1 RC can be used to preview, evaluate, and provide feedback on the new and upcoming features in SingleStore 10, while SingleStore 9.0 is recommended for production workloads.
DESCRIBE
On this page
The DESCRIBE command describes the specified table.
Syntax
DESCRIBE [<database_name>.]<table_name>;Remarks
-
<table_is the name of a table in a database.name> -
<database_is the name of a database.name> Not needed if the table exists in the current database. -
This command can be run on any node (see Node Requirements for SingleStore Commands ).
-
keyhas three possible values, primary (PRI), unique (UNI), and multiple (MUL).-
PRI: A primary key can be one or more columns, but cannot be null.
-
UNI: A unique key is similar to a primary but it can have null values.
-
MUL: A multiple key is neither a primary or unique key.
It can have a null value and multiple occurrences of the same value.
-
Warning
When setting a unique or primary key you need to have a shard key.
Examples
DESCRIBE test;
+-------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| v | varchar(10) | NO | | NULL | |
+-------+-------------+------+-----+---------+----------------+DESCRIBE memsql_demo.customer;+------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+---------------+------+-----+---------+-------+
| custkey | int(11) | NO | PRI | NULL | |
| name | varchar(25) | NO | | NULL | |
| address | varchar(40) | NO | | NULL | |
| nationkey | int(11) | NO | MUL | NULL | |
| phone | char(15) | NO | | NULL | |
| acctbal | decimal(15,2) | NO | | NULL | |
| mktsegment | char(10) | NO | | NULL | |
| comment | varchar(117) | NO | | NULL | |
| zip2 | binary(5) | YES | | NULL | |
| balance | double | YES | | NULL | |
+------------+---------------+------+-----+---------+-------+Last modified: