How to get the list of tables in default MySQL 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.

Updated on: 30-Jul-2019

267 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements