cyclist_expenses

Empty table to demonstrate batches.

Empty table to demonstrate batches.

SOURCE '0_create_keyspace.cql';

DROP TABLE IF EXISTS cycling.cyclist_expenses;

CREATE TABLE IF NOT EXISTS cycling.cyclist_expenses ( 
  cyclist_name text, 
  balance float STATIC, 
  expense_id int, 
  amount float, 
  description text, 
  paid boolean, 
  PRIMARY KEY (cyclist_name, expense_id) 
);

// START-batch
BEGIN BATCH USING TIMESTAMP 1481124356754405

  INSERT INTO cycling.cyclist_expenses (
    cyclist_name, expense_id, amount, description, paid
  ) VALUES (
    'Vera ADRIAN', 2, 13.44, 'Lunch', true
  );

  INSERT INTO cycling.cyclist_expenses (
    cyclist_name, expense_id, amount, description, paid
  ) VALUES (
    'Vera ADRIAN', 3, 25.00, 'Dinner', true
  );

APPLY BATCH;
// END-batch

// START-con
BEGIN BATCH

  INSERT INTO cycling.cyclist_expenses (
    cyclist_name, expense_id
  ) VALUES (
    'Joe WALLS', 1
  )
  IF NOT EXISTS;

  INSERT INTO cycling.cyclist_expenses (
    cyclist_name, expense_id, amount, description, paid
  ) VALUES (
    'Joe WALLS', 1, 8, 'burrito', false
  );

APPLY BATCH;
// END-con

insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Anna VAN DER BREGGEN',1,50,'dinner');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Anna VAN DER BREGGEN',2,50,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Michael MATTHEWS',3,25,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Michael MATTHEWS',4,25,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Alex FRAME',5,40,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Alex FRAME',6,40,'dinner');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Steven KRUIKSWIJK',7,20,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Steven KRUIKSWIJK',8,39,'dinner');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Marianne VOS',9,20,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Marianne VOS',10,20,'dinner');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Paolo TIRALONGO',11,10,'dinner');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Paolo TIRALONGO',12,10,'dinner');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Anna VAN DER BREGGEN',13,50,'dinner');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Anna VAN DER BREGGEN',14,25,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Anna VAN DER BREGGEN',15,35,'dinner');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Anna VAN DER BREGGEN',16,20,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Anna VAN DER BREGGEN',17,70,'dinner');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Anna VAN DER BREGGEN',18,10,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Anna VAN DER BREGGEN',19,50,'dinner');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Anna VAN DER BREGGEN',20,25,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Anna VAN DER BREGGEN',21,35,'dinner');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Anna VAN DER BREGGEN',22,20,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Anna VAN DER BREGGEN',23,70,'dinner');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Paolo TIRALONGO',24,10,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Paolo TIRALONGO',25,11,'dinner');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Paolo TIRALONGO',26,12,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Paolo TIRALONGO',27,13,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Paolo TIRALONGO',28,14,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Paolo TIRALONGO',29,15,'dinner');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Paolo TIRALONGO',30,16,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Paolo TIRALONGO',31,17,'dinner');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Paolo TIRALONGO',32,18,'breakfast');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Steven KRUIKSWIJK',33,3,'coffee');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Steven KRUIKSWIJK',34,3,'coffee');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Steven KRUIKSWIJK',35,3,'coffee');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Steven KRUIKSWIJK',36,3,'coffee');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Steven KRUIKSWIJK',37,3,'coffee');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Steven KRUIKSWIJK',38,3,'coffee');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Steven KRUIKSWIJK',39,3,'coffee');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Michael MATTHEWS',40,25,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Michael MATTHEWS',41,25,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Michael MATTHEWS',42,25,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Michael MATTHEWS',43,25,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Michael MATTHEWS',44,25,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Michael MATTHEWS',45,25,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Michael MATTHEWS',46,25,'lunch');
insert into cycling.cyclist_expenses (cyclist_name,expense_id,amount,description) values ('Michael MATTHEWS',47,25,'lunch');