DESCRIBE

Describe 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.

  • This command can be run on any node (see Node Requirements for SingleStore Commands ).

  • 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: March 1, 2023

Was this article helpful?

Verification instructions

Note: You must install cosign to verify the authenticity of the SingleStore file.

Use the following steps to verify the authenticity of singlestoredb-server, singlestoredb-toolbox, singlestoredb-studio, and singlestore-client SingleStore files that have been downloaded.

You may perform the following steps on any computer that can run cosign, such as the main deployment host of the cluster.

  1. (Optional) Run the following command to view the associated signature files.

    curl undefined
  2. Download the signature file from the SingleStore release server.

    • Option 1: Click the Download Signature button next to the SingleStore file.

    • Option 2: Copy and paste the following URL into the address bar of your browser and save the signature file.

    • Option 3: Run the following command to download the signature file.

      curl -O undefined
  3. After the signature file has been downloaded, run the following command to verify the authenticity of the SingleStore file.

    echo -n undefined |
    cosign verify-blob --certificate-oidc-issuer https://oidc.eks.us-east-1.amazonaws.com/id/CCDCDBA1379A5596AB5B2E46DCA385BC \
    --certificate-identity https://kubernetes.io/namespaces/freya-production/serviceaccounts/job-worker \
    --bundle undefined \
    --new-bundle-format -
    Verified OK