Queries5 / 14
Up next

Arithmetic in a query

CREATE TABLE line_item (id INTEGER, qty INTEGER, unit_price REAL);
INSERT INTO line_item VALUES (1, 3, 2.5), (2, 5, 1.2);
-- arithmetic operators work directly on columns
SELECT qty, unit_price, qty * unit_price AS total
FROM line_item;
What you're solving

compute values with operators