Collections:
Show All Columns of an Existing Table in MySQL
How To Get a List of Columns in an Existing Table in MySQL?
✍: FYIcenter.com
If you have an existing table, but you don't remember what are the columns used in the table, you can use the "SHOW COLUMNS FROM tableName" command to get a list of all columns of the specified table. You can also use the "DESCRIBE tableName" command, which gives you the same output as "SHOW COLUMNS" command. The following tutorial script shows you a good example:
mysql> SHOW COLUMNS FROM tip; +-------------+--------------+------+-----+---------+------- | Field | Type | Null | Key | Default | Extra +-------------+--------------+------+-----+---------+------- | id | int(11) | NO | PRI | | | subject | varchar(80) | NO | | | | description | varchar(256) | NO | | | | create_date | date | YES | | NULL | +-------------+--------------+------+-----+---------+------- 4 rows in set (0.04 sec)
⇒ Show CREATE TABLE Statements of Existing Tables in MySQL
⇐ Show All Tables in a Database in MySQL
2018-03-10, 3648🔥, 0💬
Popular Posts:
How To Start the Command-Line SQL*Plus in Oracle? If you Oracle server or client installed on your w...
How To Connect ASP Pages to Oracle Servers in Oracle? If you are running Windows IIS Web server and ...
What Privilege Is Needed for a User to Delete Rows from Tables in Another Schema in Oracle? For a us...
What Are the Basic Features of a Trigger in SQL Server? Since a SQL Server trigger is a really an ev...
What Is the Difference Between GETDATE() and GETUTCDATE() in SQL Server Transact-SQL? The difference...