TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

MySQL

MySQL DESCRIBE Statement

Overview

In this tutorial, we will learn about MySQL DESCRIBE statement with examples. This statement shows a list of columns describing the structure of the specified table.

DESCRIBE Command

We can check the structure of a table with the help of DESCRIBE command. The command lets you view a table structure.

Syntax

The general syntax for the statement is as follows:

mysql> DESC | DESCRIBE <table_name>

Examples

mysql> DESCRIBE department;

The DESC command is synonymous with the DESCRIBE command. For example, to know the table structure of the City table from the world MySQL database.

mysql> DESC City;

MySQL DESCRIBE Statement

Let’s understand the output of the command. The output is in a tabular form. The most important fields of the output are as follows:

Field – the Filed column displays the table column names.

Type – the data type of the column, describes the data type of the values that the column holds.

Null – The null ability of the column. The NOT NULL columns are displayed as NO value.

Key – This indicates if the column is a key or index. The value PRI is the PRIMARY KEY for the table. For example, ID is the PRIMARY KEY for the City table.

Default – The default value of the column.

The DESCRIBE or the DESC keyword and EXPLAIN statements are synonyms in MySQL. However, the
DESCRIBE  is often used to obtain table structure information. The EXPLAIN keyword is used to obtain the SQL Query execution plan. Execution plan is the information and explanation on how the MySQL would execute the SQL Query.

—

MySQL Tutorials

MySQL Tutorials on this website:

https://www.testingdocs.com/mysql-tutorials-for-beginners/

For more information on MySQL Database:

https://www.mysql.com/

Related Posts

DataGrip Desktop Shortcut

MySQL /

Launch DataGrip on Windows

DataGrip Download

MySQL /

Install DataGrip IDE on Windows 11

MySQL Workbench Windows 11

MySQL /

New MySQL Connection in Workbench

MySQL Command-line Client

MySQL /

Command-Line MySQL Client

Start MySQL Client

MySQL /

Start MySQL Client on Windows 11

‹ MySQL IN Operator› MySQL STRCMP Function

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version