1.One-row summary
BeginnerIn a single row, return the number of orders as orders, the total amount as revenue, the smallest order as smallest and the largest as largest.
Show hint
Aggregate functions without GROUP BY summarise the whole table into one row.
Show solution
SELECT COUNT(*) AS orders,
SUM(amount) AS revenue,
MIN(amount) AS smallest,
MAX(amount) AS largest
FROM orders;orders | revenue | smallest | largest
-------+---------+----------+--------
7 | 6530 | 150 | 2300