Please help, -the products have material specified in the product detail table -the orders contain the products and their quantity ordered.
Check that the names of tables and fields are the same, but it would be like this:
select materiales.id_material, nombre_material, CONCAT(sum(detalle_de_pedido.cantidad_p*detalle_de_producto.cantidad_m),' ',unidad_medida) as cantidad_total
from detalle_de_pedido inner join detalle_de_producto on detalle_de_pedido.id_producto=detalle_de_producto.id_producto inner join materiales on detalle_de_producto.id_material=materiales.id_material
group by materiales.id_material