Skip to content
C

Order Summary Stats

Easysql

Write a query returning three aggregate columns over the whole orders table: order_count (total number of orders), total_revenue (sum of all amount), and avg_amount (integer average, using SUM(amount) DIV COUNT(*)).

sql
CREATE TABLE orders ( id INTEGER PRIMARY KEY, customer_name TEXT NOT NULL, amount INTEGER NOT NULL, order_date DATE NOT NULL );

Sample data:

sql
INSERT INTO orders (id, customer_name, amount, order_date) VALUES (1, 'Asha', 500, '2026-03-05'), (2, 'Rohan', 300, '2026-03-20'), (3, 'Neha', 700, '2026-04-02'), (4, 'Asha', 200, '2026-03-28');

Input (stdin)

Output

Run your code to see output here...