Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
What kind of information is displayed by MySQL DESCRIBE statement?
The DESCRIBE statement gives information about MySQL table’s structure.
Example
Consider the constructing of the following table name ‘Employee’ with Create Table statement as follows −
mysql> Create table Employee(ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, Name Varchar(20)); Query OK, 0 rows affected (0.20 sec)
Now with the help of ‘DESCRIBE Employee‘ statement, we can get the information about the employee table.
mysql> Describe Employee; +-------+-------------+------+-----+---------+------------------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+------------------+ | ID | int(11) | NO | PRI | NULL | auto_increment | | Name | varchar(20) | YES | | NULL | | +-------+-------------+------+-----+---------+------------------+ 2 rows in set (0.11 sec)
The above description tells us about the name of the column, its data type, whether it can have NULL values or not, by default what kind of values it can store, the key constraint on it, and any other extra information about it like auto_increment.
Advertisements
