How to get the names of all MySQL tables ?
How to get the attributes (name, type, etc ...) of a given table in the MySQL database?
How to get the names of all MySQL tables ?
How to get the attributes (name, type, etc ...) of a given table in the MySQL database?
To view the tables in a database:
SHOW TABLES;
To view the table structure with name, type, etc.:
DESC nome_da_tabela;
You can use the query:
SELECT * FROM information_schema.tables WHERE table_schema = 'nome-do-banco';
It shows the names of the tables and also information like the engine used, creation date, etc.
Correct is to query the INFORMATION_SCHEMA database. You'll get data like the type of tables, avg the size of the records, plus the names and the Storage Engine.
DESC INFORMATION_SCHEMA.TABLES;
It will give you a good knowledge of what you can look for per table. Remembering that TODO SHOW command has correlation with tables in INFORMATION_SCHEMA
Taking the data from the columns of a given table:
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '<tabela>';
select * from all_tables where tables like '%tabela desejada%'