Name
SHOW TABLES
Synopsis
SHOW [OPEN] TABLES [FROMdatabase] [LIKE 'pattern']
This statement displays a list of
tables. For a listing of tables that is currently being used by
queries, add the OPEN flag. The tables shown will
not include temporary tables and will be from the current default
database. To list tables from another database, add the
FROM clause along with the name of the database.
You can reduce the list of tables to ones with a name meeting a given
naming pattern. As of Version 5.0.1 of MySQL, the results set will
include tables and views for the database. It will also include a
second column to specify whether a row is for a table or a view. This
is indicated by the values of BASE TABLE and
VIEW, respectively.
SHOW TABLES FROM workrequests LIKE 'work%';
This statement will list all of the tables and views (if the server is running Version 5.0.1 or higher) with a name that begins with the word "work," for the database workrequests. Incidentally, by default, only tables for which the user has privileges will be listed.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access