How to view tables in a database using SQL?

In SQL, you can use the following command to view tables in a database:

SHOW TABLES;

Alternatively

SELECT table_name 
FROM information_schema.tables 
WHERE table_schema = 'database_name';

In this case, database_name is the name of the database where the table is to be viewed.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds