33
How to get the names of all tables in the database Mysql?
How to get the attributes (name, type, etc...) of a given table in the Mysql database?
33
How to get the names of all tables in the database Mysql?
How to get the attributes (name, type, etc...) of a given table in the Mysql database?
44
To view tables in a database:
SHOW TABLES;
To view table structure with name, type, etc.:
DESC nome_da_tabela;
17
You can use the query:
SELECT * FROM information_schema.tables WHERE table_schema = 'nome-do-banco';
It shows the table names and also information like the engine used, creation date, etc.
7
Taking the column data from a given table:
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '<tabela>';
7
The correct is to make a query in the INFORMATION_SCHEMA database. You will get data like table type, record size avg, names and Storage Engine.
DESC INFORMATION_SCHEMA.TABLES;
It will give you a good knowledge of what you can look for by table. Remembering that ALL OVER "SHOW" command has correlation with tables in INFORMATION_SCHEMA
2
select * from all_tables where tables like '%tabela desejada%'
This is Oracle! Not Mysql!
Browser other questions tagged sql mysql
You are not signed in. Login or sign up in order to post.
If you need to specify a Database:
SHOW TABLES FROM banco
– Iberê
You can choose the seat using the command
USE nomeDoBanco;
, before theSHOW TABLES;
– rafaelxy
SHOW TABLES answers only a part of the question. Table attributes are in INFORMATION_SCHEMA
– jtomaszon
Yes, you can use information_schema to view more complete table information, but if you only need basic information like name, headline, etc. you can use "DESC" (as mentioned in that same answer) which is simpler.
– Tiago