Last active
August 29, 2015 14:18
-
-
Save putWorkDev/d645408ccfc9d8fb2adb to your computer and use it in GitHub Desktop.
Determining the number of tables that are contained in a MySQL database is very straight-forward, although it is an often asked question. The simplest way to accomplish this is using the following SQL query. In this query, you will provide the database, and the SQL will access MySQL’s internal data scheme (information_schema).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT count(*) as 'Tables', table_schema as 'Database' | |
| FROM information_schema.TABLES | |
| WHERE table_schema= 'spendanalysis' | |
| GROUP BY table_schema |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Elegant solution.