We can get the total number of records of table in mysql by using count() function
SELECT COUNT(*) FROM test;
SELECT COUNT(IF(status = 'Cancelled', 1, NULL)) 'Cancelled', COUNT(IF(status = 'On Hold', 1, NULL)) 'On Hold', COUNT(IF(status = 'Confirm', 1, NULL)) 'Confirm', COUNT(IF(status = 'Disputed', 1, NULL)) 'Disputed' FROM orders ;
SELECT TABLE_ROWS from INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'employee' ;
Related
find the nth highest salary in mysql without limit