+ 1

count

if I made a table named class with 10 records. and there is a column named grade in which grades are like - A , B , C , D.. . if I want to count the number of students having respective grades then how can I ?????

1st Apr 2017, 3:25 AM
Sanya
2 Antworten
+ 22
Select COUNT(Grade) from Class WHERE Grade=... ;
1st Apr 2017, 3:36 AM
Frost
Frost - avatar
0
SELECT Grade,COUNT(Grade) AS GCount From Class GROUP BY Grade; This will list down all Grades and their Count side by side. Result: Grade | GCount A | 5 B | 2 If u want to query the count of a perticuler grave u can use Frost's query.
1st Apr 2017, 3:39 AM
Eranga
Eranga - avatar