>_QueryLocalCSV & JSON tools that run in your browser

How do I sum a numeric column across all rows?

SELECT SUM(quantity * unit_price) AS total_revenue FROM data;

Run this query on the demo dataset →

SUM() adds up a numeric expression across every row that matches the query. Here quantity * unit_price computes each order's line total first, and SUM() totals those line totals into a single grand total — a one-line replacement for a spreadsheet formula dragged down a column and summed at the bottom.

A table named data with columns: order_id (integer), customer (text), country (text), category (text), quantity (integer), unit_price (real), order_date (text, YYYY-MM-DD).

Want to run it on your own file? Open it with Query CSV with SQL: your file becomes the table data, and you can paste this query with your own column names.

Related recipes