How to Get the names of the table in SQL

The syntax provided in this article works only for SQL Server and MySQL.

If you want to know how many tables are present in your database and the details of the table like TABLE_SCHEMA, TABLE_TYPE and all.

Syntax:



SELECT * FROM INFORMATION_SCHEMA.TABLES 

WHERE

1. INFORMATION_SCHEMA views allow you to retrieve metadata about the objects within a database. These views can be found in the master database under Views / System Views and be called from any database in your SQL Server instance.

2. INFORMATION_SCHEMA.TABLES The INFORMATION_SCHEMA.TABLES view allows you to get information about all tables and views within a database.

Example:

Output:



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.