Important

Helios features are now enabled during weekly update windows and are no longer directly tied to SingleStore engine releases. Refer to the release notes to view the latest features available in your Helios cluster.

DESCRIBE

The DESCRIBE command describes the specified table.

Syntax

DESCRIBE [<database_name>.]<table_name>;

Remarks

  • <table_name> is the name of a table in a database.

  • <database_name> is the name of a database. Not needed if the table exists in the current database.

  • key has 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. Otherwise you will receive an error.

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:

Was this article helpful?