SQL Knowledge Center · About ·
Easy Interactive Online SQL Training for Beginners

SQL COUNT(*) Tutorial - Interactive Database Lesson

Lesson 12 of 31

COUNT(*)

Interactive SQL Tutorial

Another way to explore a table is to check the number of rows in it. For example, if we are querying a table states_of_us, we’d expect 50 rows, or 500 rows in a table called fortune_500_companies.

SELECT COUNT(*) FROM friends_of_pickles; returns the total number of rows in the table friends_of_pickles. Try this for yourself.

SQL:

Query Result:

Available Tables: