The following MySQL query can be used to view multiple tables’ row counts in one single SELECT statement.
CREATE TABLE Dept(
EmployeeDetails VARCHAR(100));INSERT INTO Dept VALUES
(‘John|Sales Team’),
(‘Mike|Sales’),
(‘Smith|Development’),
(‘Jim|New Sales Team’),
(‘Lucy|Development’),
(‘Will|Development’);CREATE TABLE tbStudents(iStudentID INT, StudentName VARCHAR(10), SubjectName VARCHAR(30));
INSERT INTO tbStudents VALUES
(1, ‘John’, ‘Mathematics’),
(1, ‘John’, ‘Science’),
(1, ‘John’, ‘Chemistry’),
(2, ‘Smith’, ‘Economics’),
(2, ‘Smith’, ‘Mathematics’),
(2, ‘Smith’, ‘Commerce’),
(3, ‘Will’, ‘History’),
(3, ‘Will’, ‘Civics’),
(3, ‘Will’, ‘Economics’);SELECT
(SELECT COUNT(*) FROM Dept) AS DeptTableRowCount,
(SELECT COUNT(*) FROM tbStudents) AS StudentsTableRowCount;
Hope this helps.