SQL COUNT() function | Get length of rows in a table

A table ‘students‘ that has some rows in it (table image is given below). How many rows this table have? I want to know that. So I will use SQL COUNT() function.

sql table for count column

For this, SQL provides a COUNT() function. With the help of that, we can get the total number of rows.

SQL Count() function example

SELECT COUNT(*) FROM students;

Leave a Comment