Below Mysql query is very useful to Get list of column name from table with its datatype.
You can get list of all the tables name and all the fields count with help of this query.
In below query just change <–YoursDatabaseName–> to your database and <–YoursTableName–> to your table name where you just want Field values of DESCRIBE statement
1 2 3 |
SELECT COUNT(*) AS totalTables FROM information_schema.tables WHERE TABLE_SCHEMA = 'YoursDatabaseName' |
1 2 3 |
SELECT COUNT(*) AS totalDBColumns FROM information_schema.columns WHERE TABLE_SCHEMA = 'YoursDatabaseName' |
1 2 3 4 |
SELECT COUNT(*) totalTableColumns FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'YoursTableName' AND TABLE_SCHEMA = 'YoursDatabaseName' |
1 2 3 4 |
SELECT `COLUMN_NAME`, `DATA_TYPE` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`='YoursDatabaseName' AND `TABLE_NAME`='YoursTableName'; |
1 2 3 |
SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_SCHEMA`='YoursDatabaseName' |