Is there any good reason why you want to do computation like this with a database query, instead of, say, middle-ware?
For the product
(reduce #'* (select 'value :from 'product :flatp t))
If you want the sum change #'* to #'+.