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
Published on 19-Feb-2018 12:01:25
Advertisements