Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 352 Bytes

ex19.md

File metadata and controls

19 lines (13 loc) · 352 Bytes

Exercise: 19

For each maker having models in the Laptop table, find out the average screen size of the laptops he produces.

Result set: maker, average screen size.

Solution

SELECT maker, AVG(screen)
FROM (
	SELECT product.maker, laptop.screen
	FROM product
		JOIN laptop ON product.model = laptop.model
) AS p
GROUP BY p.maker