Here is a one-liner:1 SELECT COUNT(*) FROM (SELECT DISTINCT table_name FROM INFORMATION_SCHEMA.TABLES) a