Do you have problem with sql? As in you don't know how to write the query? Or is it something else that is bothering you?
If you can't explain the problem better then I don't think we can help you. Sql does have the option to sum various things in the query already. If you don't know how else to do it, you could even just do
SELECT * FROM table
and then filter through results with PHP, but that would be very slow, if you have to do it for a larger datasets then you would probably get timeout exception from your server. Or maximum memory exceded.
All in all, you need to describe the problem better.
And you would not write a new query for every cell, at least EUR -> HUF can be simply done by calculationg value of cell * currency_exchange_value.