Non vedo la difficoltà.

select idmarca, sum(prezzo)
from tabella
group by idmarca
order by sum(prezzo)
limit 0, 5