Query database

execute a query

Films database

shchema

count()

SELECT COUNT(birthdate) AS count_birthdates
FROM PEOPLE;
#Result: 6152
#Alias count birthdates for the field name

Count() multiple fields

SELECT COUNT(name) as count_names, COUNT(birthdate) AS count_birthdates
FROM people;

Using with COUNT()

count(field_name)counts values in a field

count(*) count records in a table

SELECT COUNT(*) AS total_records
FROM people;