SQL grouping with ordering and counting

BEGIN;
CREATE SCHEMA IF NOT EXISTS sandbox;

CREATE TABLE sandbox.items (
    id serial PRIMARY KEY,
    name TEXT NOT NULL,
    price INT NOT NULL
);

INSERT INTO sandbox.items (name, price)
VALUES ('foo', 1), ('bar', 2), ('foo', 2), ('baz', 4);

SELECT
    name,
    COUNT(id) as num,
    SUM(price) as total
FROM sandbox.items
GROUP BY name
ORDER BY num DESC;

-- And then roll everything back
ROLLBACK;