I have a table called products and has attributes code, type(tablet, desktop, phone), and manufacturer.
I want to get the information of the number of tablets each manufacturer makes.
select manufacturer, count(manufacturer)
from products
where type = "tablet"
group by manufacturer
This query only returns the manufacturers which have at least a tablet. I would like to also print manufacturers which have 0 tablets.
For example: (manufacturer, type)
- (Samsung, tablet)
- (Apple, tablet)
- (Dell, phone)
- (Apple, tablet)
Then I wish to get
Samsung: 1
Apple: 2
Dell: 0