MySQL DESCRIBE Statement

MySQL | DESCRIBE: Learn about the MySQL DESCRIBE Statement, with its explanation, syntax, and query examples.
Submitted by Apurva Mathur, on September 20, 2022

DESCRIBE Statement / DESCRIBE Table

The DESCRIBE statement in MySQL helps us to see the entire structure of the table. Here structure means what type of constraints are applied on the columns, what data type is used for the column etc. We can view the structure with this command.

DESCRIBE Statement Syntax

DESCRIBE table_name;

For this first thing is to select the database using USE database_name command, after selecting the database use the describe command with the specified table name.

Suppose I have the following databases,

describe statement step 1

From all the databases I have to USE new_schooldb, and then I will simply write,

describe statement step 2

After selecting the particular database, now I will see the tables inside this database, using the following command,

describe statement step 3

Now if I want to know the entire structure of the table named as student details in such case I will write,

DESCRIBE student_details;
describe statement step 4

As you can see the structure of the table is displayed which gives us information about everything.

DESCRIBE Table / Getting Table Structure in MYSQL Workbench

Step 1: Select the schema, under the schemas section.

describe statement step 5

Step 2: After selecting the table, select the table (here I am selecting the student_details table).

describe statement step 6

Step 3: After this go to the information (i) option, as shown in the picture.

describe statement step 7

Step 4: Then click on columns, and the table structure will be visible.

describe statement step 8



Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.