Viewing All Tables

Function

This statement is used to show information about all tables in the current database.

Syntax

1
SHOW TABLES [IN | FROM db_name] [LIKE regex_expression];

Keyword

SHOW: displays all tables and views in the current database. In addition, you can use the FROM/IN db_name keyword to specify the database name to display the tables and views in that database.

Precautions

None

Example

  • To show all tables and views in the current database, run the following statement:
    1
    SHOW TABLES;
    
  • To show all tables started with test in the testdb database, run the following statement:
    1
    SHOW TABLES IN testdb LIKE "test*";