SELECT can subtract a discount to create a net amount without changing row count.

highlighted = computed this step

Input table

Start with gross amounts and exact discount amounts.

Order charges\text{Order charges}
Order chargesorder_idgross_amountdiscounto112020o2800o3505

Select query

Subtract discount from gross_amount and name the result net_amount.

gross_amount minus discount AS net_amount\text{gross\_amount minus discount AS net\_amount}
SELECT net amount after discountselect order_id,net_amountarity 2 rows 3OrderChargesarity 3 rows 3

Output table

The row count stays the same; each output row has the recomputed net amount.

net amounts\text{net amounts}
Outputorder_idnet_amounto1100o280o345