I have a table like this:
CREATE TABLE prodinfo ( prodtype string, prodname string );
Some of the values:
book | alice in wonderland
shoe | bata
book | c++ primer
cutlery | spoon
book | SCWCD
cutlery | knife
I need to find the number of products in each category.
book | 3
shoe | 1
cutlery | 2
How to write an SQL query for this?
P.S: This is not a homework assignment. I am working on something and I am stuck here.
1 Answer