1SELECT count(*)
2FROM INFORMATION_SCHEMA.TABLES
3WHERE TABLE_SCHEMA = 'database_name'
1select table_name, sum(table_rows) as sum
2from information_schema.tables
3where table_schema = '[DB NAME]'
4group by table_name
5order by sum desc;
1# get row count of all tables in all database in this server
2select table_name, table_schema,table_rows from information_schema.tables;
3
4# get row count of all tables in testdb database
5select table_name, table_schema,table_rows from information_schema.tables where table_schema='testdb';
1SELECT COUNT(*) FROM count_demos; // Code language: SQL (Structured Query Language) (sql)