2023-02-06
Max. 15 points
Name:
Task | Max. | Achieved |
---|---|---|
1 | 6 | |
2 | 9 | |
Sum | 15 |
To solve the tasks in this test, use the following ERD.
-- mariadb solution
select c.CategoryName as "Cheapest Category", avg(price) from Categories c
natural join Products p
group by c.CategoryID
order by avg(price)
limit 1;
select distinct(SupplierID), SupplierName from Suppliers s
natural join Products p
group by s.SupplierID
having max(p.Price) <
(select avg(Price) from Products);