SQL: Select count

This entry is part 6 of 20 in the series SQL Tutorial

1Rod StewartMaggie May1973
2New OrderSubstance1987
3NirvanaSmell Like Teen Spirit1992

In a database table, we can use select count to retrieve the number of records in a table.

Syntax:  select count(*) from table_name

select count(*) from artiste

We can also use the syntax where we count a particular column such as id or album.

select count(id) from artiste
select count(album) from artiste
Series Navigation<< SQL: CRUD
SQL: Retrieving filtered data from a table >>

Leave a comment

Leave a Reply