begin;
INSERT INTO tournaments 
  (season, name, country, location, "date", machine, scoringsystem) VALUES (
    (SELECT season FROM seasons WHERE name='Challenge Cup 2004'),
    'Challenge Cup 4',
    (SELECT country FROM countries WHERE name='Norway'),
    'Askim',
    '2004-08-28',
    (SELECT machine FROM machines WHERE name='Dancing Stage EuroMix 2'),
    (SELECT scoringsystem FROM scoringsystems WHERE name='10K Machine score')
);
INSERT INTO rounds (tournament, round, randomsongs, chosensongs) 
  VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT song FROM songs WHERE lower(title)=lower('Nori Nori Nori'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT song FROM songs WHERE lower(title)=lower('PARANOiA Rebirth'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=1;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=1;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Pål Andre' AS nick WHERE 'Pål Andre' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT player FROM players WHERE nick='Pål Andre'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT player FROM players WHERE nick='Pål Andre'),
   (SELECT song FROM songs WHERE lower(title)=lower('Nori Nori Nori')),
   'f',
   5755);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT player FROM players WHERE nick='Pål Andre'),
   (SELECT song FROM songs WHERE lower(title)=lower('PARANOiA Rebirth')),
   'f',
   7439);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Tassen' AS nick WHERE 'Tassen' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT player FROM players WHERE nick='Tassen'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT player FROM players WHERE nick='Tassen'),
   (SELECT song FROM songs WHERE lower(title)=lower('Nori Nori Nori')),
   'f',
   5862);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT player FROM players WHERE nick='Tassen'),
   (SELECT song FROM songs WHERE lower(title)=lower('PARANOiA Rebirth')),
   'f',
   7465);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Haggar' AS nick WHERE 'Haggar' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT player FROM players WHERE nick='Haggar'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT player FROM players WHERE nick='Haggar'),
   (SELECT song FROM songs WHERE lower(title)=lower('Nori Nori Nori')),
   'f',
   6303);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT player FROM players WHERE nick='Haggar'),
   (SELECT song FROM songs WHERE lower(title)=lower('PARANOiA Rebirth')),
   'f',
   8631);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Draconia' AS nick WHERE 'Draconia' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT player FROM players WHERE nick='Draconia'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT player FROM players WHERE nick='Draconia'),
   (SELECT song FROM songs WHERE lower(title)=lower('Nori Nori Nori')),
   'f',
   5607);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT player FROM players WHERE nick='Draconia'),
   (SELECT song FROM songs WHERE lower(title)=lower('PARANOiA Rebirth')),
   'f',
   5191);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Snute' AS nick WHERE 'Snute' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT player FROM players WHERE nick='Snute'),
   5
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('Nori Nori Nori')),
   'f',
   6749);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 1,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('PARANOiA Rebirth')),
   'f',
   8741);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT song FROM songs WHERE lower(title)=lower('Cotton-Eye Joe'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT song FROM songs WHERE lower(title)=lower('Stomp'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=1;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=1;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Mync' AS nick WHERE 'Mync' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT player FROM players WHERE nick='Mync'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT player FROM players WHERE nick='Mync'),
   (SELECT song FROM songs WHERE lower(title)=lower('Cotton-Eye Joe')),
   'f',
   5430);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT player FROM players WHERE nick='Mync'),
   (SELECT song FROM songs WHERE lower(title)=lower('Stomp')),
   'f',
   5492);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Glukko' AS nick WHERE 'Glukko' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT player FROM players WHERE nick='Glukko'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT player FROM players WHERE nick='Glukko'),
   (SELECT song FROM songs WHERE lower(title)=lower('Cotton-Eye Joe')),
   'f',
   2894);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT player FROM players WHERE nick='Glukko'),
   (SELECT song FROM songs WHERE lower(title)=lower('Stomp')),
   'f',
   3223);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Mulefisk' AS nick WHERE 'Mulefisk' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT player FROM players WHERE nick='Mulefisk'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT player FROM players WHERE nick='Mulefisk'),
   (SELECT song FROM songs WHERE lower(title)=lower('Cotton-Eye Joe')),
   'f',
   6127);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT player FROM players WHERE nick='Mulefisk'),
   (SELECT song FROM songs WHERE lower(title)=lower('Stomp')),
   'f',
   6043);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Ylini' AS nick WHERE 'Ylini' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT player FROM players WHERE nick='Ylini'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT player FROM players WHERE nick='Ylini'),
   (SELECT song FROM songs WHERE lower(title)=lower('Cotton-Eye Joe')),
   'f',
   6012);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT player FROM players WHERE nick='Ylini'),
   (SELECT song FROM songs WHERE lower(title)=lower('Stomp')),
   'f',
   5709);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'DufF' AS nick WHERE 'DufF' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT player FROM players WHERE nick='DufF'),
   5
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('Cotton-Eye Joe')),
   'f',
   6811);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 2,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('Stomp')),
   'f',
   6585);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT song FROM songs WHERE lower(title)=lower('My Summer Love'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT song FROM songs WHERE lower(title)=lower('Exotic Ethnic'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=1;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=1;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Pingo' AS nick WHERE 'Pingo' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT player FROM players WHERE nick='Pingo'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT player FROM players WHERE nick='Pingo'),
   (SELECT song FROM songs WHERE lower(title)=lower('My Summer Love')),
   'f',
   7866);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT player FROM players WHERE nick='Pingo'),
   (SELECT song FROM songs WHERE lower(title)=lower('Exotic Ethnic')),
   'f',
   7709);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Jim Andre' AS nick WHERE 'Jim Andre' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT player FROM players WHERE nick='Jim Andre'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT player FROM players WHERE nick='Jim Andre'),
   (SELECT song FROM songs WHERE lower(title)=lower('My Summer Love')),
   'f',
   4750);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT player FROM players WHERE nick='Jim Andre'),
   (SELECT song FROM songs WHERE lower(title)=lower('Exotic Ethnic')),
   'f',
   6116);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Dabi' AS nick WHERE 'Dabi' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT player FROM players WHERE nick='Dabi'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT player FROM players WHERE nick='Dabi'),
   (SELECT song FROM songs WHERE lower(title)=lower('My Summer Love')),
   'f',
   4556);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT player FROM players WHERE nick='Dabi'),
   (SELECT song FROM songs WHERE lower(title)=lower('Exotic Ethnic')),
   'f',
   4005);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Olemann' AS nick WHERE 'Olemann' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT player FROM players WHERE nick='Olemann'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT player FROM players WHERE nick='Olemann'),
   (SELECT song FROM songs WHERE lower(title)=lower('My Summer Love')),
   'f',
   7080);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT player FROM players WHERE nick='Olemann'),
   (SELECT song FROM songs WHERE lower(title)=lower('Exotic Ethnic')),
   'f',
   7509);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'OJK' AS nick WHERE 'OJK' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT player FROM players WHERE nick='OJK'),
   5
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT player FROM players WHERE nick='OJK'),
   (SELECT song FROM songs WHERE lower(title)=lower('My Summer Love')),
   'f',
   8480);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 3,
   (SELECT player FROM players WHERE nick='OJK'),
   (SELECT song FROM songs WHERE lower(title)=lower('Exotic Ethnic')),
   'f',
   8664);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT song FROM songs WHERE lower(title)=lower('Max 300'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT song FROM songs WHERE lower(title)=lower('Spin the disc'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=1;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=1;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Mario' AS nick WHERE 'Mario' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='Mario'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='Mario'),
   (SELECT song FROM songs WHERE lower(title)=lower('Max 300')),
   'f',
   5758);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='Mario'),
   (SELECT song FROM songs WHERE lower(title)=lower('Spin the disc')),
   'f',
   6465);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Gogo' AS nick WHERE 'Gogo' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='Gogo'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='Gogo'),
   (SELECT song FROM songs WHERE lower(title)=lower('Max 300')),
   'f',
   6758);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='Gogo'),
   (SELECT song FROM songs WHERE lower(title)=lower('Spin the disc')),
   'f',
   7512);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Ted Kristian' AS nick WHERE 'Ted Kristian' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='Ted Kristian'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='Ted Kristian'),
   (SELECT song FROM songs WHERE lower(title)=lower('Max 300')),
   'f',
   5911);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='Ted Kristian'),
   (SELECT song FROM songs WHERE lower(title)=lower('Spin the disc')),
   'f',
   6985);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Duckling' AS nick WHERE 'Duckling' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='Duckling'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='Duckling'),
   (SELECT song FROM songs WHERE lower(title)=lower('Max 300')),
   'f',
   7250);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='Duckling'),
   (SELECT song FROM songs WHERE lower(title)=lower('Spin the disc')),
   'f',
   6600);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Smiph' AS nick WHERE 'Smiph' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='Smiph'),
   5
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='Smiph'),
   (SELECT song FROM songs WHERE lower(title)=lower('Max 300')),
   'f',
   6036);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='Smiph'),
   (SELECT song FROM songs WHERE lower(title)=lower('Spin the disc')),
   'f',
   6297);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'RiChY' AS nick WHERE 'RiChY' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='RiChY'),
   6
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('Max 300')),
   'f',
   8446);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 4,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('Spin the disc')),
   'f',
   7602);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT song FROM songs WHERE lower(title)=lower('Make A Jam!'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT song FROM songs WHERE lower(title)=lower('Living in America'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=1;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=1;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Alexxz' AS nick WHERE 'Alexxz' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='Alexxz'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='Alexxz'),
   (SELECT song FROM songs WHERE lower(title)=lower('Make A Jam!')),
   'f',
   4861);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='Alexxz'),
   (SELECT song FROM songs WHERE lower(title)=lower('Living in America')),
   'f',
   4170);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Zeek' AS nick WHERE 'Zeek' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='Zeek'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='Zeek'),
   (SELECT song FROM songs WHERE lower(title)=lower('Make A Jam!')),
   'f',
   3749);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='Zeek'),
   (SELECT song FROM songs WHERE lower(title)=lower('Living in America')),
   'f',
   3734);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Bonzo' AS nick WHERE 'Bonzo' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='Bonzo'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='Bonzo'),
   (SELECT song FROM songs WHERE lower(title)=lower('Make A Jam!')),
   'f',
   6065);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='Bonzo'),
   (SELECT song FROM songs WHERE lower(title)=lower('Living in America')),
   'f',
   6185);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Tom' AS nick WHERE 'Tom' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='Tom'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='Tom'),
   (SELECT song FROM songs WHERE lower(title)=lower('Make A Jam!')),
   'f',
   7240);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='Tom'),
   (SELECT song FROM songs WHERE lower(title)=lower('Living in America')),
   'f',
   7260);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Snofox' AS nick WHERE 'Snofox' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='Snofox'),
   5
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='Snofox'),
   (SELECT song FROM songs WHERE lower(title)=lower('Make A Jam!')),
   'f',
   6529);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='Snofox'),
   (SELECT song FROM songs WHERE lower(title)=lower('Living in America')),
   'f',
   6174);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'T|na' AS nick WHERE 'T|na' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='T|na'),
   6
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='T|na'),
   (SELECT song FROM songs WHERE lower(title)=lower('Make A Jam!')),
   'f',
   6633);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 5,
   (SELECT player FROM players WHERE nick='T|na'),
   (SELECT song FROM songs WHERE lower(title)=lower('Living in America')),
   'f',
   5652);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT song FROM songs WHERE lower(title)=lower('The Centre of the Heart (Stonebridge Club Mix)'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=1;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=1;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Ozon' AS nick WHERE 'Ozon' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Ozon'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Ozon'),
   (SELECT song FROM songs WHERE lower(title)=lower('The Centre of the Heart (Stonebridge Club Mix)')),
   'f',
   5641);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Ozon'),
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me')),
   'f',
   5089);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Hyper' AS nick WHERE 'Hyper' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Hyper'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Hyper'),
   (SELECT song FROM songs WHERE lower(title)=lower('The Centre of the Heart (Stonebridge Club Mix)')),
   'f',
   4410);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Hyper'),
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me')),
   'f',
   2831);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Nameless' AS nick WHERE 'Nameless' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Nameless'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Nameless'),
   (SELECT song FROM songs WHERE lower(title)=lower('The Centre of the Heart (Stonebridge Club Mix)')),
   'f',
   6327);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Nameless'),
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me')),
   'f',
   5632);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Daniil' AS nick WHERE 'Daniil' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Daniil'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Daniil'),
   (SELECT song FROM songs WHERE lower(title)=lower('The Centre of the Heart (Stonebridge Club Mix)')),
   'f',
   6294);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Daniil'),
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me')),
   'f',
   5286);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Oliyzia' AS nick WHERE 'Oliyzia' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   5
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   (SELECT song FROM songs WHERE lower(title)=lower('The Centre of the Heart (Stonebridge Club Mix)')),
   'f',
   6371);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me')),
   'f',
   5369);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Stream' AS nick WHERE 'Stream' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Stream'),
   6
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Stream'),
   (SELECT song FROM songs WHERE lower(title)=lower('The Centre of the Heart (Stonebridge Club Mix)')),
   'f',
   6135);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   1, 6,
   (SELECT player FROM players WHERE nick='Stream'),
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me')),
   'f',
   5013);
INSERT INTO rounds (tournament, round, randomsongs, chosensongs) 
  VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT song FROM songs WHERE lower(title)=lower('20th November'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=2;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=2;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Olemann' AS nick WHERE 'Olemann' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='Olemann'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='Olemann'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love')),
   'f',
   6635);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='Olemann'),
   (SELECT song FROM songs WHERE lower(title)=lower('20th November')),
   'f',
   5971);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'T|na' AS nick WHERE 'T|na' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='T|na'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='T|na'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love')),
   'f',
   7402);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='T|na'),
   (SELECT song FROM songs WHERE lower(title)=lower('20th November')),
   'f',
   6375);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Oliyzia' AS nick WHERE 'Oliyzia' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love')),
   'f',
   7331);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   (SELECT song FROM songs WHERE lower(title)=lower('20th November')),
   'f',
   6382);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Snofox' AS nick WHERE 'Snofox' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='Snofox'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='Snofox'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love')),
   'f',
   7448);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='Snofox'),
   (SELECT song FROM songs WHERE lower(title)=lower('20th November')),
   'f',
   6233);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Tom' AS nick WHERE 'Tom' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='Tom'),
   5
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='Tom'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love')),
   'f',
   7500);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='Tom'),
   (SELECT song FROM songs WHERE lower(title)=lower('20th November')),
   'f',
   6317);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Snute' AS nick WHERE 'Snute' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='Snute'),
   6
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love')),
   'f',
   7792);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 1,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('20th November')),
   'f',
   6639);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT song FROM songs WHERE lower(title)=lower('Electro Tuned (the SubS Mix)'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT song FROM songs WHERE lower(title)=lower('www.blonde girl (MOMO Mix)'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=2;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=2;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Duckling' AS nick WHERE 'Duckling' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='Duckling'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='Duckling'),
   (SELECT song FROM songs WHERE lower(title)=lower('Electro Tuned (the SubS Mix)')),
   'f',
   7990);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='Duckling'),
   (SELECT song FROM songs WHERE lower(title)=lower('www.blonde girl (MOMO Mix)')),
   'f',
   6324);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Daniil' AS nick WHERE 'Daniil' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='Daniil'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='Daniil'),
   (SELECT song FROM songs WHERE lower(title)=lower('Electro Tuned (the SubS Mix)')),
   'f',
   7982);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='Daniil'),
   (SELECT song FROM songs WHERE lower(title)=lower('www.blonde girl (MOMO Mix)')),
   'f',
   6286);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Mulefisk' AS nick WHERE 'Mulefisk' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='Mulefisk'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='Mulefisk'),
   (SELECT song FROM songs WHERE lower(title)=lower('Electro Tuned (the SubS Mix)')),
   'f',
   8108);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='Mulefisk'),
   (SELECT song FROM songs WHERE lower(title)=lower('www.blonde girl (MOMO Mix)')),
   'f',
   6173);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Haggar' AS nick WHERE 'Haggar' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='Haggar'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='Haggar'),
   (SELECT song FROM songs WHERE lower(title)=lower('Electro Tuned (the SubS Mix)')),
   'f',
   8499);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='Haggar'),
   (SELECT song FROM songs WHERE lower(title)=lower('www.blonde girl (MOMO Mix)')),
   'f',
   6638);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Nameless' AS nick WHERE 'Nameless' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='Nameless'),
   5
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='Nameless'),
   (SELECT song FROM songs WHERE lower(title)=lower('Electro Tuned (the SubS Mix)')),
   'f',
   8517);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='Nameless'),
   (SELECT song FROM songs WHERE lower(title)=lower('www.blonde girl (MOMO Mix)')),
   'f',
   6692);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'OJK' AS nick WHERE 'OJK' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='OJK'),
   6
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='OJK'),
   (SELECT song FROM songs WHERE lower(title)=lower('Electro Tuned (the SubS Mix)')),
   'f',
   8348);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 2,
   (SELECT player FROM players WHERE nick='OJK'),
   (SELECT song FROM songs WHERE lower(title)=lower('www.blonde girl (MOMO Mix)')),
   'f',
   6600);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT song FROM songs WHERE lower(title)=lower('Crash!'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT song FROM songs WHERE lower(title)=lower('Tsugaru'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=2;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=2;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Tassen' AS nick WHERE 'Tassen' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='Tassen'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='Tassen'),
   (SELECT song FROM songs WHERE lower(title)=lower('Crash!')),
   'f',
   0);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='Tassen'),
   (SELECT song FROM songs WHERE lower(title)=lower('Tsugaru')),
   'f',
   0);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Ylini' AS nick WHERE 'Ylini' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='Ylini'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='Ylini'),
   (SELECT song FROM songs WHERE lower(title)=lower('Crash!')),
   'f',
   7704);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='Ylini'),
   (SELECT song FROM songs WHERE lower(title)=lower('Tsugaru')),
   'f',
   8111);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Pingo' AS nick WHERE 'Pingo' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='Pingo'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='Pingo'),
   (SELECT song FROM songs WHERE lower(title)=lower('Crash!')),
   'f',
   8440);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='Pingo'),
   (SELECT song FROM songs WHERE lower(title)=lower('Tsugaru')),
   'f',
   8160);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Gogo' AS nick WHERE 'Gogo' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='Gogo'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='Gogo'),
   (SELECT song FROM songs WHERE lower(title)=lower('Crash!')),
   'f',
   7830);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='Gogo'),
   (SELECT song FROM songs WHERE lower(title)=lower('Tsugaru')),
   'f',
   8385);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'RiChY' AS nick WHERE 'RiChY' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='RiChY'),
   5
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('Crash!')),
   'f',
   8488);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('Tsugaru')),
   'f',
   8481);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'DufF' AS nick WHERE 'DufF' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='DufF'),
   6
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('Crash!')),
   'f',
   8747);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   2, 3,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('Tsugaru')),
   'f',
   8570);
INSERT INTO rounds (tournament, round, randomsongs, chosensongs) 
  VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\''))
);
UPDATE rounds SET randomsongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=3;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=3;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'OJK' AS nick WHERE 'OJK' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='OJK'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='OJK'),
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\'')),
   'f',
   7448);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Pingo' AS nick WHERE 'Pingo' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='Pingo'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='Pingo'),
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\'')),
   'f',
   6765);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Tom' AS nick WHERE 'Tom' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='Tom'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='Tom'),
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\'')),
   'f',
   6668);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Nameless' AS nick WHERE 'Nameless' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='Nameless'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='Nameless'),
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\'')),
   'f',
   6994);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'RiChY' AS nick WHERE 'RiChY' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='RiChY'),
   5
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\'')),
   'f',
   7143);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Snofox' AS nick WHERE 'Snofox' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='Snofox'),
   6
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='Snofox'),
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\'')),
   'f',
   7175);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Haggar' AS nick WHERE 'Haggar' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='Haggar'),
   7
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='Haggar'),
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\'')),
   'f',
   6946);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Snute' AS nick WHERE 'Snute' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   8
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\'')),
   'f',
   7356);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'DufF' AS nick WHERE 'DufF' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   9
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   3, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\'')),
   'f',
   7433);
INSERT INTO rounds (tournament, round, randomsongs, chosensongs) 
  VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0,
   (SELECT song FROM songs WHERE lower(title)=lower('Cotton-Eye Joe'))
);
UPDATE rounds SET randomsongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=4;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=4;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Haggar' AS nick WHERE 'Haggar' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0,
   (SELECT player FROM players WHERE nick='Haggar'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0,
   (SELECT player FROM players WHERE nick='Haggar'),
   (SELECT song FROM songs WHERE lower(title)=lower('Cotton-Eye Joe')),
   'f',
   6555);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Snofox' AS nick WHERE 'Snofox' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0,
   (SELECT player FROM players WHERE nick='Snofox'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0,
   (SELECT player FROM players WHERE nick='Snofox'),
   (SELECT song FROM songs WHERE lower(title)=lower('Cotton-Eye Joe')),
   'f',
   6004);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'RiChY' AS nick WHERE 'RiChY' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0,
   (SELECT player FROM players WHERE nick='RiChY'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('Cotton-Eye Joe')),
   'f',
   6451);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Nameless' AS nick WHERE 'Nameless' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0,
   (SELECT player FROM players WHERE nick='Nameless'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0,
   (SELECT player FROM players WHERE nick='Nameless'),
   (SELECT song FROM songs WHERE lower(title)=lower('Cotton-Eye Joe')),
   'f',
   6422);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Snute' AS nick WHERE 'Snute' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   5
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('Cotton-Eye Joe')),
   'f',
   6579);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'DufF' AS nick WHERE 'DufF' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   6
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('Cotton-Eye Joe')),
   'f',
   6713);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'OJK' AS nick WHERE 'OJK' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0,
   (SELECT player FROM players WHERE nick='OJK'),
   7
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   4, 0,
   (SELECT player FROM players WHERE nick='OJK'),
   (SELECT song FROM songs WHERE lower(title)=lower('Cotton-Eye Joe')),
   'f',
   6544);
INSERT INTO rounds (tournament, round, randomsongs, chosensongs) 
  VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   5,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   5, 0);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   5, 0,
   (SELECT song FROM songs WHERE lower(title)=lower('Afronova'))
);
UPDATE rounds SET randomsongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=5;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=5;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Nameless' AS nick WHERE 'Nameless' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   5, 0,
   (SELECT player FROM players WHERE nick='Nameless'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   5, 0,
   (SELECT player FROM players WHERE nick='Nameless'),
   (SELECT song FROM songs WHERE lower(title)=lower('Afronova')),
   'f',
   7215);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'RiChY' AS nick WHERE 'RiChY' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   5, 0,
   (SELECT player FROM players WHERE nick='RiChY'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   5, 0,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('Afronova')),
   'f',
   8438);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Haggar' AS nick WHERE 'Haggar' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   5, 0,
   (SELECT player FROM players WHERE nick='Haggar'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   5, 0,
   (SELECT player FROM players WHERE nick='Haggar'),
   (SELECT song FROM songs WHERE lower(title)=lower('Afronova')),
   'f',
   8547);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Snute' AS nick WHERE 'Snute' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   5, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   5, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('Afronova')),
   'f',
   8695);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'DufF' AS nick WHERE 'DufF' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   5, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   5
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   5, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('Afronova')),
   'f',
   8342);
INSERT INTO rounds (tournament, round, randomsongs, chosensongs) 
  VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   6,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   6, 0);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   6, 0,
   (SELECT song FROM songs WHERE lower(title)=lower('End of the Century'))
);
UPDATE rounds SET randomsongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=6;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=6;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'RiChY' AS nick WHERE 'RiChY' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   6, 0,
   (SELECT player FROM players WHERE nick='RiChY'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   6, 0,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('End of the Century')),
   'f',
   8120);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Haggar' AS nick WHERE 'Haggar' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   6, 0,
   (SELECT player FROM players WHERE nick='Haggar'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   6, 0,
   (SELECT player FROM players WHERE nick='Haggar'),
   (SELECT song FROM songs WHERE lower(title)=lower('End of the Century')),
   'f',
   8234);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'DufF' AS nick WHERE 'DufF' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   6, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   6, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('End of the Century')),
   'f',
   8376);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Snute' AS nick WHERE 'Snute' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   6, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   6, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('End of the Century')),
   'f',
   8784);
INSERT INTO rounds (tournament, round, randomsongs, chosensongs) 
  VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   7,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   7, 0);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   7, 0,
   (SELECT song FROM songs WHERE lower(title)=lower('Living in America'))
);
UPDATE rounds SET randomsongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=7;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=7;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'RiChY' AS nick WHERE 'RiChY' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   7, 0,
   (SELECT player FROM players WHERE nick='RiChY'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   7, 0,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('Living in America')),
   'f',
   6581);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'DufF' AS nick WHERE 'DufF' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   7, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   7, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('Living in America')),
   'f',
   6778);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Snute' AS nick WHERE 'Snute' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   7, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   7, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('Living in America')),
   'f',
   6776);
INSERT INTO rounds (tournament, round, randomsongs, chosensongs) 
  VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   8,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   8, 0);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   8, 0,
   (SELECT song FROM songs WHERE lower(title)=lower('www.blonde girl (MOMO Mix)'))
);
UPDATE rounds SET randomsongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=8;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 4') AND 
  round=8;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Snute' AS nick WHERE 'Snute' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   8, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   8, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('www.blonde girl (MOMO Mix)')),
   'f',
   6883);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'DufF' AS nick WHERE 'DufF' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   8, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 4'),
   8, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('www.blonde girl (MOMO Mix)')),
   'f',
   6436);
commit;
