23.2. The INFORMATION_SCHEMA TABLES
Table
The TABLES
table provides information about
tables in databases.
Notes:
TABLE_SCHEMA
and
TABLE_NAME
are a single field in a
SHOW
display, for example
Table_in_db1
.
TABLE_TYPE
should be BASE
TABLE
or VIEW
. If table is
temporary, then TABLE_TYPE
=
TEMPORARY
. (There are no temporary views,
so this is not ambiguous.)
The TABLE_ROWS
column is
NULL
if the table is in the
INFORMATION_SCHEMA
database. For
InnoDB
tables, the row count is only a
rough estimate used in SQL optimization.
We have nothing for the table's default character set.
TABLE_COLLATION
is close, because collation
names begin with a character set name.
The following statements are equivalent:
SELECT table_name FROM INFORMATION_SCHEMA.TABLES
[WHERE table_schema = 'db_name
']
[WHERE|AND table_name LIKE 'wild
']
SHOW TABLES
[FROM db_name
]
[LIKE 'wild
']