hugopereira84
4/7/2015 - 9:19 AM

Determining the number of tables that are contained in a MySQL database is very straight-forward, although it is an often asked question. Th

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).

SELECT count(*) as 'Tables', table_schema as 'Database'
FROM information_schema.TABLES
WHERE table_schema= 'spendanalysis'
GROUP BY table_schema