Skip to content

Commit 6b287cd

Browse files
authored
Create MySQL.sql
1 parent 745dcec commit 6b287cd

File tree

1 file changed

+9
-0
lines changed
  • sql-queries-11/Most_Efficient_Way_to_Get_Table_Row_Count_in_SQL

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-- Counting rows for course table
2+
SHOW TABLE STATUS LIKE 'course';
3+
4+
-- Alternative appraoch using information schema
5+
6+
SELECT table_rows
7+
FROM information_schema.tables
8+
WHERE table_schema = 'university'
9+
AND table_name = 'course';

0 commit comments

Comments
 (0)