There are tables
Order
- idOrder
, login
, product
, number
;
Payment
- idPayment
, orderId
, number
(the paid amount from the order in the table. Order
).
Tell me, please, SELECT
queries:
- get the
Order
lines (orders) that are not referenced in thePayment
table; - get
Order
lines (orders) which are referenced in thePayment
table; - get
Order
lines (orders) that are referenced in thePayment
table under the condition that thenumber
fields in one and second tables are not equal, and the difference between these values, i.e.o.number-p.number;