<html>
<body>
<font face="Courier New, Courier">a)productos y su cantidad<br>
select p.descrip,s.id_prod,sum(s.cantidad)<br>
from STOCK as s,productos p<br>
where  s.id_prod=p.id<br>
group by id_prod,p.descrip<br><br>
<br>
b)productos con stock > 59<br><br>
select p.descrip,s.id_prod,sum(s.cantidad)<br>
from STOCK as s,productos p<br>
where  (s.id_prod=p.id)<br>
group by id_prod,p.descrip<br>
having sum(s.cantidad)> 59<br><br>
<br>
c)cantidad de productos por almacen<br>
select a.nombre,sum(s.cantidad)<br>
from STOCK as s,productos p,almacenes a<br>
where  (a.id=s.id_almacen)<br>
group by s.id_almacen,a.nombre<br>
order by a.nombre asc<br><br>
<br>
d)total de productos<br>
select count(id) as productos<br>
from STOCK<br><br>
<br>
e)precios promedio de los productos<br>
select avg(precio)promedio_precio<br>
from PRODUCTOS<br><br>
f es igaul al ejemplo c ?<br>
c) cantidad de productos por almacen<br>
f) total de productos por almacen (el total es valor de los
productos)<br><br>
<br>
g)precios promedios poralmacen<br>
select a.nombre,round(avg(p.precio * s.cantidad ))as total<br>
from STOCK as s,productos p,almacenes a<br>
where  (a.id=s.id_almacen)<br>
group by s.id_almacen,a.nombre<br>
order by a.nombre asc<br><br>
</font></body>
</html>