

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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.
- Related Questions & Answers
- How can I get the information about a particular column of a table by MySQL DESCRIBE statement?
- What kind of output is produced by UNIX_TIMESTAMP() function?
- What kind of output is returned by MySQL scalar subquery? What are the restrictions on using it with MySQL query?
- What are the synonym statements of MySQL DESCRIBE?
- How can I get the information about a particular column of a table by MySQL EXPLAIN statement? EXPLAIN statement?
- What kind of string comparison, case-sensitive or not, can be performed by MySQL?
- What is MySQL LOAD DATA statement?
- How we can get more information about columns of a table than the information we got by DESCRIBE, EXPLAIN and SHOW COLUMNS MySQL statements?
- What is the use of MySQL IGNORE INSERT statement?
- What kind of color is black? Is it all bad?
- What is the use of FLUSH PRIVILEGES statement in MySQL?
- MySQL's DESCRIBE command?
- MySQL order by field using CASE Statement
- What kind of tragedy is depicted in the book King Lear?
- How can I describe all tables in the database through a single statement in MySQL?
Advertisements