create table animals as
  select "dog" as kind, 4 as legs, 20 as weight union
  select "cat"        , 4        , 10           union
  select "ferret"     , 4        , 10           union
  select "parrot"     , 2        , 6            union
  select "penguin"    , 2        , 10           union
  select "t-rex"      , 2        , 12000;

-- Generated by typing '.dump cones' in sqlite3
CREATE TABLE cones (Id INT, Flavor TEXT, Color TEXT, Price REAL);
INSERT INTO cones VALUES(1,'strawberry','pink',3.50);
INSERT INTO cones VALUES(2,'chocolate','light brown',4.75);
INSERT INTO cones VALUES(3,'chocolate','dark brown',5.25);
INSERT INTO cones VALUES(4,'strawberry','pink',5.25);
INSERT INTO cones VALUES(5,'bubblegum','pink',4.75);
INSERT INTO cones VALUES(6,'chocolate','dark brown',5.25);
INSERT INTO cones VALUES(7,'vanilla','white',5.0);

-- here id is the sales id
CREATE TABLE sales(Cashier,id, cone_id int);
INSERT INTO sales VALUES('Baskin',1,2);
INSERT INTO sales VALUES('Baskin',3,1);
INSERT INTO sales VALUES('Baskin',4,2);
INSERT INTO sales VALUES('Robin',2,3);
INSERT INTO sales VALUES('Robin',5,2);
INSERT INTO sales VALUES('Robin',6,1);
INSERT INTO sales VALUES('Ben',7,2);
INSERT INTO sales VALUES('Ben',8,7);
INSERT INTO sales VALUES('Jerry',9,6);
INSERT INTO sales VALUES('Jerry',10,6);

SELECT Cashier, SUM(Price) as 'Total Sold'
FROM sales, cones
WHERE sales.cone_id = cones.id
GROUP BY Cashier;

SELECT Cashier, SUM(Price) as 'Total Value Sold', COUNT(*) as 'Number Sold'
FROM sales, cones
WHERE sales.cone_id = cones.id
GROUP BY Cashier
HAVING COUNT(*) > 2;
