Describe the column structure of a MySQL table

Contributor Icon Contributed by qmchenry  
Tag Icon Tagged: MySQL  

The SQL command ‘describe’ allows you to view the column structure of a MySQL table. It provides a listing of the columns of a table, the type of each column, and additional information on each column.

To view the structure of a MySQL table called ‘recipes’ use the following SQL command:

describe recipes;

The command can be issued from any SQL source including an application with database connectivity (i.e., PHP, Java, etc.) or directly from mysql command (see Connect to a MySQL server using the mysql command for more information).

 

6 Comments -


  1. Niladri said on January 7, 2009

    What is the alternate command of describe ??

  2. Anonymous said on January 11, 2010

    Thanks Dude,
    Thats what I was looking for all day :)

  3. Ankit Singhania said on May 18, 2010

    Thanks a lot for this..

  4. Michael de Silva said on February 20, 2011

    desc table_name

    This works too :)

  5. M D said on June 20, 2011

    waste

  6. aRGon said on October 1, 2011

    can also do,

    show columns from table;

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -