SQL Desc Table
Category : TECH Author : Ankur Rastogi Date : Fri Mar 18 2016 Views : 61

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)

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)
Disclaimer: The above content reflect author’s personal views and do not reflect the views of OYEWIKI. Neither OYEWIKI nor any person/organization acting on its behalf is liable to accept any legal liability/responsibility for any error/mislead in this information or any information available on the website. This website in no way accepts the responsibility for any loss, injury, damage, discomfort or inconvenience caused as a result of reliance on any information provided on this website.
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.