Please tell me why in this query displays 2500 and not 5000.
select sum (Price) from Products WHERE ID IN (Select ID_Product From Order_Products WHERE ID_Order = 1)
Products Table ID | Price 1 | 2500.
Order_Products Table ID | ID_Order | ID_Product. 1 | 1 | 1 2 | 1 | 1
Because it is necessary to teach normal joyans. And subqueries are such joyans for the poor.
Here it turns out a request
select sum (Price) from Products Where ID in (1,1)
which is actually syntax sugar for request
select sum (Price) from Products Where id = 1 or id = 1
which returns 1 line
And you need a request that returns 2 lines. And it will make the usual simple joyne
select sum (Price) from Order_Products Op, Products P Where p.ID = OP.ID_Product and id_order = 1