Similar to MSSQL – Table/View Column Information, this post will help with MySQL tables and columns.
This query is a quick query to give you the pertinent information about a specific table.
DESCRIBE <Table Name>;
select * from `information_schema`.`columns` WHERE table_name = '<Table Name>';
SELECT
table_name,
Replace(GROUP_CONCAT(CONCAT(column_name, ', ', table_name)),CONCAT(', ', table_name), '')
FROM
`information_schema`.`columns`
WHERE
WHERE table_schema = '<DatabaseName>'
GROUP BY table_name;
Originally Posted on March 1, 2014
Last Updated on October 26, 2015
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.