The database scheme consists of four tables: Product(maker, model, type) PC(code, model, speed, ram, hd, cd, price) Laptop(code, model, speed, ram, hd, screen, price) Printer(code, model, color, type, price) Find out makers who produce only the models of the same type, and the number of those models exceeds 1.
asked Jan 09, 2013 at 05:27 PM in Default
I'm still not sure I entirely understand what you're getting at. However, I've prepared this as a little demo of what I think you want...
So, here's a table for
And here's the code that actually runs the query:
The above query returns data from my Product Table showing Maker, Product Type and number of products that that maker makes, so long as the maker only makes one line of products.
The way it works:
If you want it to only show Makers which make more than one item in a product line, then change the final
answered Jan 10, 2013 at 09:11 PM
SELECT maker, MAX(type) AS type FROM product GROUP BY maker HAVING COUNT(DISTINCT type) = 1 AND COUNT(model) > 1
answered Jan 23, 2015 at 09:19 AM