How to get the list of tables in default MySQL database?

MySQLMySQLi Database

As we know that the default MySQL database would be the database that is currently in use for subsequent queries. We can get the list of tables in that database by using SHOW TABLES statement.

mysql> SHOW TABLES;

+------------------+
| Tables_in_sample |
+------------------+
| employee         |
| new_student      |
| student          |
+------------------+

3 rows in set (0.00 sec)

The above statement shows the list of table in Sampledatabase.

raja
Updated on 30-Jul-2019 22:30:21

Advertisements