SELECT can compute a derived numeric column from existing columns.

highlighted = computed this step

Input table

Start with invoice lines that have quantities and unit prices.

Invoice lines\text{Invoice lines}
Invoice linesline_iditemqtyunit_pricel1notebook215l2pen38l3sticker42

Select query

Compute a line total by multiplying quantity by unit price.

SELECT line_id, qty times unit_price AS line_total\text{SELECT line\_id, qty times unit\_price AS line\_total}
SELECT computed line totalselect line_id,line_totalarity 2 rows 3InvoiceLinesarity 4 rows 3

Output table

The derived column is recomputed from the input values.

computed line totals\text{computed line totals}
Outputline_idline_totall130l224l38