How to Show Columns in a MySQL Table


MySQL is a relational database that is available for all operating systems. It is often used in conjunction with web servers to create dynamic web pages. When a database administrator creates a table in MySQL, he must provide information such as the name and data type for each column in the table. Once the table is created, the administrator and users, with the appropriate permissions, can view the column information with the "show columns" statement.

Things You'll Need

  • MySQL database
  • Log into the MySQL database. You will be presented with the "mysql>" command prompt. This is where you will type the following commands.

  • Type the command "show columns from TABLE;" to show the columns of a particular table within the database. Replace the word "TABLE" with the correct name of the table. The columns will be presented in a table which will show the column name (Field), column type (Type), whether the column accepts null values (Null), whether the column is a key or not (Key), what the default value is (Default) and any extra information (Extra).

  • Type the command "quit" to exit the database.

Related Searches


Promoted By Zergnet



You May Also Like

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

Is DIY in your DNA? Become part of our maker community.
Submit Your Work!