MYSQL Desc Table mysql-desc-table.pdf

Overview

To see description, structure, column names and data types of any existing table you can use command Desc table.

Syntax

Syntax for this is

DESC table_name;

Example

Let us see the table hostel_list that we just created in last step

DESC hostel_list;
+----------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+--------------+------+-----+---------+----------------+
| id | int(2) | NO | PRI | NULL | auto_increment |
| name | varchar(100) | NO | | NULL | |
| occupancy_type | tinyint(1) | NO | | NULL | |
| max_capacity | int(4) | NO | | NULL | |
+----------------+--------------+------+-----+---------+----------------+
4 rows in set (0.01 sec)



This article is contributed by Ankur Rastogi on Sat Apr 16 2016 12:40:36 GMT+0530 (IST)

If you want to add more comments to the article or you see any thing incorrect please write a comment below and we will surely get back to you.