- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I get the information about a particular column of a table by MySQL EXPLAIN statement?nEXPLAIN statement?
As we know the EXPLAIN statement will provide the information/structure of the whole table. With the help of the EXPLAIN statement along with the table name and the column name, we can get the information about that column.
Syntax
EXPLAIN table_name col_name;
Example1
mysql> EXPLAIN employee ID; +-------+---------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+---------+------+-----+---------+----------------+ | ID | int(11) | NO | PRI | NULL | auto_increment | +-------+---------+------+-----+---------+----------------+ 1 row in set (0.11 sec)
The query above will give the information about the column ‘ID’ of a table named ‘employee’.
Example2
mysql> EXPLAIN employee name; +-------+-------------+------+-----+---------+---------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+---------+ | Name | varchar(20) | YES | | NULL | | +-------+-------------+------+-----+---------+---------+ 1 row in set (0.03 sec)
The query above will give the information about the other column ‘Name’ of a table named ‘employee’.
- Related Articles
- How can I get the information about a particular column of a table by MySQL EXPLAIN statement? EXPLAIN statement?
- How can I get the information about a particular column of a table by MySQL DESCRIBE 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?
- How can we get more details about columns of an existing table than return by MySQL SHOW COLUMNS statement?
- How can I see the CREATE TABLE statement of an existing MySQL table?
- How can I simulate a print statement in MySQL?
- How to check statement of creating a particular MySQL database?
- How to use ALTER TABLE statement for changing the size of a column in MySQL?
- How can I get the records from MySQL table in result set in a particular way?
- The magnification produced by a spherical mirror is -3." List information you can derived from this statement about the mirror/image. Explain your answer also."
- What kind of information is displayed by MySQL DESCRIBE statement?
- Explain about income statement in accounting.
- Get table names using SELECT statement in MySQL?
- How can column data be used within MySQL CASE statement?
- How can I use a SELECT statement as an argument of MySQL IF() function?
- How can we update MySQL table after removing a particular string from the values of column?

Advertisements