begin;
INSERT INTO tournaments 
  (season, name, country, location, "date", machine, scoringsystem) VALUES (
    (SELECT season FROM seasons WHERE name='Challenge Cup 2004'),
    'Challenge Cup 3',
    (SELECT country FROM countries WHERE name='Norway'),
    'Askim',
    '2004-05-23',
    (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 3'),
   1,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 1);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 1,
   (SELECT song FROM songs WHERE lower(title)=lower('B4U (B4 Za Beat Mix)'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 1,
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=1;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=1;
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 3'),
   1, 1,
   (SELECT player FROM players WHERE nick='Ted Kristian'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 1,
   (SELECT player FROM players WHERE nick='Ted Kristian'),
   (SELECT song FROM songs WHERE lower(title)=lower('B4U (B4 Za Beat Mix)')),
   'f',
   4475);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 1,
   (SELECT player FROM players WHERE nick='Ted Kristian'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love')),
   'f',
   5340);
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 3'),
   1, 1,
   (SELECT player FROM players WHERE nick='Pål Andre'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 1,
   (SELECT player FROM players WHERE nick='Pål Andre'),
   (SELECT song FROM songs WHERE lower(title)=lower('B4U (B4 Za Beat Mix)')),
   'f',
   4760);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 1,
   (SELECT player FROM players WHERE nick='Pål Andre'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love')),
   'f',
   5946);
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 3'),
   1, 1,
   (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 3'),
   1, 1,
   (SELECT player FROM players WHERE nick='Mulefisk'),
   (SELECT song FROM songs WHERE lower(title)=lower('B4U (B4 Za Beat Mix)')),
   'f',
   5734);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 1,
   (SELECT player FROM players WHERE nick='Mulefisk'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love')),
   'f',
   7095);
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 3'),
   1, 1,
   (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 3'),
   1, 1,
   (SELECT player FROM players WHERE nick='Haggar'),
   (SELECT song FROM songs WHERE lower(title)=lower('B4U (B4 Za Beat Mix)')),
   'f',
   6356);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 1,
   (SELECT player FROM players WHERE nick='Haggar'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love')),
   'f',
   7560);
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 3'),
   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 3'),
   1, 1,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('B4U (B4 Za Beat Mix)')),
   'f',
   6480);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 1,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love')),
   'f',
   7646);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 2);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 2,
   (SELECT song FROM songs WHERE lower(title)=lower('Don\'t Try to Stop It'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 2,
   (SELECT song FROM songs WHERE lower(title)=lower('Make A Jam!'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=1;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=1;
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 3'),
   1, 2,
   (SELECT player FROM players WHERE nick='Jim Andre'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 2,
   (SELECT player FROM players WHERE nick='Jim Andre'),
   (SELECT song FROM songs WHERE lower(title)=lower('Don\'t Try to Stop It')),
   'f',
   5809);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 2,
   (SELECT player FROM players WHERE nick='Jim Andre'),
   (SELECT song FROM songs WHERE lower(title)=lower('Make A Jam!')),
   'f',
   5338);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Andre' AS nick WHERE 'Andre' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 2,
   (SELECT player FROM players WHERE nick='Andre'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 2,
   (SELECT player FROM players WHERE nick='Andre'),
   (SELECT song FROM songs WHERE lower(title)=lower('Don\'t Try to Stop It')),
   'f',
   4264);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 2,
   (SELECT player FROM players WHERE nick='Andre'),
   (SELECT song FROM songs WHERE lower(title)=lower('Make A Jam!')),
   'f',
   3773);
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 3'),
   1, 2,
   (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 3'),
   1, 2,
   (SELECT player FROM players WHERE nick='Dabi'),
   (SELECT song FROM songs WHERE lower(title)=lower('Don\'t Try to Stop It')),
   'f',
   5388);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 2,
   (SELECT player FROM players WHERE nick='Dabi'),
   (SELECT song FROM songs WHERE lower(title)=lower('Make A Jam!')),
   'f',
   5249);
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 3'),
   1, 2,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 2,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   (SELECT song FROM songs WHERE lower(title)=lower('Don\'t Try to Stop It')),
   'f',
   6226);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 2,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   (SELECT song FROM songs WHERE lower(title)=lower('Make A Jam!')),
   'f',
   6708);
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 3'),
   1, 2,
   (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 3'),
   1, 2,
   (SELECT player FROM players WHERE nick='OJK'),
   (SELECT song FROM songs WHERE lower(title)=lower('Don\'t Try to Stop It')),
   'f',
   7353);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 2,
   (SELECT player FROM players WHERE nick='OJK'),
   (SELECT song FROM songs WHERE lower(title)=lower('Make A Jam!')),
   'f',
   7214);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 3);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 3,
   (SELECT song FROM songs WHERE lower(title)=lower('5, 6, 7, 8'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 3,
   (SELECT song FROM songs WHERE lower(title)=lower('So Deep (Perfect Sphere Mix)'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=1;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=1;
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 3'),
   1, 3,
   (SELECT player FROM players WHERE nick='Glukko'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 3,
   (SELECT player FROM players WHERE nick='Glukko'),
   (SELECT song FROM songs WHERE lower(title)=lower('5, 6, 7, 8')),
   'f',
   4346);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 3,
   (SELECT player FROM players WHERE nick='Glukko'),
   (SELECT song FROM songs WHERE lower(title)=lower('So Deep (Perfect Sphere Mix)')),
   'f',
   3531);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Ole-Christian' AS nick WHERE 'Ole-Christian' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 3,
   (SELECT player FROM players WHERE nick='Ole-Christian'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 3,
   (SELECT player FROM players WHERE nick='Ole-Christian'),
   (SELECT song FROM songs WHERE lower(title)=lower('5, 6, 7, 8')),
   'f',
   0);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 3,
   (SELECT player FROM players WHERE nick='Ole-Christian'),
   (SELECT song FROM songs WHERE lower(title)=lower('So Deep (Perfect Sphere Mix)')),
   'f',
   0);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Zyc' AS nick WHERE 'Zyc' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 3,
   (SELECT player FROM players WHERE nick='Zyc'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 3,
   (SELECT player FROM players WHERE nick='Zyc'),
   (SELECT song FROM songs WHERE lower(title)=lower('5, 6, 7, 8')),
   'f',
   4898);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 3,
   (SELECT player FROM players WHERE nick='Zyc'),
   (SELECT song FROM songs WHERE lower(title)=lower('So Deep (Perfect Sphere Mix)')),
   'f',
   3333);
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 3'),
   1, 3,
   (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 3'),
   1, 3,
   (SELECT player FROM players WHERE nick='Ylini'),
   (SELECT song FROM songs WHERE lower(title)=lower('5, 6, 7, 8')),
   'f',
   5189);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 3,
   (SELECT player FROM players WHERE nick='Ylini'),
   (SELECT song FROM songs WHERE lower(title)=lower('So Deep (Perfect Sphere Mix)')),
   'f',
   4391);
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 3'),
   1, 3,
   (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 3'),
   1, 3,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('5, 6, 7, 8')),
   'f',
   5822);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 3,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('So Deep (Perfect Sphere Mix)')),
   'f',
   8510);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 4);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 4,
   (SELECT song FROM songs WHERE lower(title)=lower('Look to the sky'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 4,
   (SELECT song FROM songs WHERE lower(title)=lower('Burnin\' the Floor'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=1;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=1;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Th0rny' AS nick WHERE 'Th0rny' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 4,
   (SELECT player FROM players WHERE nick='Th0rny'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 4,
   (SELECT player FROM players WHERE nick='Th0rny'),
   (SELECT song FROM songs WHERE lower(title)=lower('Look to the sky')),
   'f',
   5789);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 4,
   (SELECT player FROM players WHERE nick='Th0rny'),
   (SELECT song FROM songs WHERE lower(title)=lower('Burnin\' the Floor')),
   'f',
   6214);
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 3'),
   1, 4,
   (SELECT player FROM players WHERE nick='Nameless'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 4,
   (SELECT player FROM players WHERE nick='Nameless'),
   (SELECT song FROM songs WHERE lower(title)=lower('Look to the sky')),
   'f',
   5618);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 4,
   (SELECT player FROM players WHERE nick='Nameless'),
   (SELECT song FROM songs WHERE lower(title)=lower('Burnin\' the Floor')),
   'f',
   6326);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Matsi' AS nick WHERE 'Matsi' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 4,
   (SELECT player FROM players WHERE nick='Matsi'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 4,
   (SELECT player FROM players WHERE nick='Matsi'),
   (SELECT song FROM songs WHERE lower(title)=lower('Look to the sky')),
   'f',
   4525);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 4,
   (SELECT player FROM players WHERE nick='Matsi'),
   (SELECT song FROM songs WHERE lower(title)=lower('Burnin\' the Floor')),
   'f',
   6008);
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 3'),
   1, 4,
   (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 3'),
   1, 4,
   (SELECT player FROM players WHERE nick='Draconia'),
   (SELECT song FROM songs WHERE lower(title)=lower('Look to the sky')),
   'f',
   5716);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 4,
   (SELECT player FROM players WHERE nick='Draconia'),
   (SELECT song FROM songs WHERE lower(title)=lower('Burnin\' the Floor')),
   'f',
   6169);
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 3'),
   1, 4,
   (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 3'),
   1, 4,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('Look to the sky')),
   'f',
   6023);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 4,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('Burnin\' the Floor')),
   'f',
   6628);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 5);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 5,
   (SELECT song FROM songs WHERE lower(title)=lower('Paranoia KCET (Clean Mix)'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 5,
   (SELECT song FROM songs WHERE lower(title)=lower('Dead End'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=1;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=1;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Eruanna' AS nick WHERE 'Eruanna' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='Eruanna'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='Eruanna'),
   (SELECT song FROM songs WHERE lower(title)=lower('Paranoia KCET (Clean Mix)')),
   'f',
   5410);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='Eruanna'),
   (SELECT song FROM songs WHERE lower(title)=lower('Dead End')),
   'f',
   4383);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Advena' AS nick WHERE 'Advena' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='Advena'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='Advena'),
   (SELECT song FROM songs WHERE lower(title)=lower('Paranoia KCET (Clean Mix)')),
   'f',
   6729);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='Advena'),
   (SELECT song FROM songs WHERE lower(title)=lower('Dead End')),
   'f',
   7069);
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 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='Tassen'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='Tassen'),
   (SELECT song FROM songs WHERE lower(title)=lower('Paranoia KCET (Clean Mix)')),
   'f',
   6911);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='Tassen'),
   (SELECT song FROM songs WHERE lower(title)=lower('Dead End')),
   'f',
   6693);
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 3'),
   1, 5,
   (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 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='Duckling'),
   (SELECT song FROM songs WHERE lower(title)=lower('Paranoia KCET (Clean Mix)')),
   'f',
   8252);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='Duckling'),
   (SELECT song FROM songs WHERE lower(title)=lower('Dead End')),
   'f',
   7357);
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 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='Olemann'),
   5
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='Olemann'),
   (SELECT song FROM songs WHERE lower(title)=lower('Paranoia KCET (Clean Mix)')),
   'f',
   7471);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='Olemann'),
   (SELECT song FROM songs WHERE lower(title)=lower('Dead End')),
   'f',
   7919);
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 3'),
   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 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='T|na'),
   (SELECT song FROM songs WHERE lower(title)=lower('Paranoia KCET (Clean Mix)')),
   'f',
   8546);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 5,
   (SELECT player FROM players WHERE nick='T|na'),
   (SELECT song FROM songs WHERE lower(title)=lower('Dead End')),
   'f',
   7881);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6,
   (SELECT song FROM songs WHERE lower(title)=lower('The Reflex'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6,
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love (SPEED MIX)'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=1;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=1;
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 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Bonzo'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Bonzo'),
   (SELECT song FROM songs WHERE lower(title)=lower('The Reflex')),
   'f',
   4564);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Bonzo'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love (SPEED MIX)')),
   'f',
   6212);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Gollum' AS nick WHERE 'Gollum' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Gollum'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Gollum'),
   (SELECT song FROM songs WHERE lower(title)=lower('The Reflex')),
   'f',
   3139);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Gollum'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love (SPEED MIX)')),
   'f',
   5655);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Hugo' AS nick WHERE 'Hugo' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Hugo'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Hugo'),
   (SELECT song FROM songs WHERE lower(title)=lower('The Reflex')),
   'f',
   6888);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Hugo'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love (SPEED MIX)')),
   'f',
   8521);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Auran' AS nick WHERE 'Auran' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Auran'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Auran'),
   (SELECT song FROM songs WHERE lower(title)=lower('The Reflex')),
   'f',
   3300);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Auran'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love (SPEED MIX)')),
   'f',
   3813);
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 3'),
   1, 6,
   (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 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Smiph'),
   (SELECT song FROM songs WHERE lower(title)=lower('The Reflex')),
   'f',
   5696);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Smiph'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love (SPEED MIX)')),
   'f',
   7569);
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 3'),
   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 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Stream'),
   (SELECT song FROM songs WHERE lower(title)=lower('The Reflex')),
   'f',
   5989);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   1, 6,
   (SELECT player FROM players WHERE nick='Stream'),
   (SELECT song FROM songs WHERE lower(title)=lower('Can\'t Stop Fallin\' in Love (SPEED MIX)')),
   'f',
   7689);
INSERT INTO rounds (tournament, round, randomsongs, chosensongs) 
  VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 1);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 1,
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\''))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 1,
   (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 3') AND 
  round=2;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=2;
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 3'),
   2, 1,
   (SELECT player FROM players WHERE nick='Smiph'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 1,
   (SELECT player FROM players WHERE nick='Smiph'),
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\'')),
   'f',
   5825);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 1,
   (SELECT player FROM players WHERE nick='Smiph'),
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me')),
   'f',
   4790);
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 3'),
   2, 1,
   (SELECT player FROM players WHERE nick='Mulefisk'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 1,
   (SELECT player FROM players WHERE nick='Mulefisk'),
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\'')),
   'f',
   6533);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 1,
   (SELECT player FROM players WHERE nick='Mulefisk'),
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me')),
   'f',
   5504);
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 3'),
   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 3'),
   2, 1,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\'')),
   'f',
   7101);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 1,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me')),
   'f',
   5725);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Th0rny' AS nick WHERE 'Th0rny' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 1,
   (SELECT player FROM players WHERE nick='Th0rny'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 1,
   (SELECT player FROM players WHERE nick='Th0rny'),
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\'')),
   'f',
   6377);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 1,
   (SELECT player FROM players WHERE nick='Th0rny'),
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me')),
   'f',
   4994);
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 3'),
   2, 1,
   (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 3'),
   2, 1,
   (SELECT player FROM players WHERE nick='OJK'),
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\'')),
   'f',
   7140);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 1,
   (SELECT player FROM players WHERE nick='OJK'),
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me')),
   'f',
   5515);
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 3'),
   2, 1,
   (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 3'),
   2, 1,
   (SELECT player FROM players WHERE nick='T|na'),
   (SELECT song FROM songs WHERE lower(title)=lower('Love This Feelin\'')),
   'f',
   6447);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 1,
   (SELECT player FROM players WHERE nick='T|na'),
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me')),
   'f',
   5518);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 2);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 2,
   (SELECT song FROM songs WHERE lower(title)=lower('La Senorita'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 2,
   (SELECT song FROM songs WHERE lower(title)=lower('Ecstasy'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=2;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=2;
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 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Dabi'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Dabi'),
   (SELECT song FROM songs WHERE lower(title)=lower('La Senorita')),
   'f',
   4394);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Dabi'),
   (SELECT song FROM songs WHERE lower(title)=lower('Ecstasy')),
   'f',
   4295);
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 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Duckling'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Duckling'),
   (SELECT song FROM songs WHERE lower(title)=lower('La Senorita')),
   'f',
   5898);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Duckling'),
   (SELECT song FROM songs WHERE lower(title)=lower('Ecstasy')),
   'f',
   5857);
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 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Ylini'),
   3
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Ylini'),
   (SELECT song FROM songs WHERE lower(title)=lower('La Senorita')),
   'f',
   5873);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Ylini'),
   (SELECT song FROM songs WHERE lower(title)=lower('Ecstasy')),
   'f',
   5881);
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 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Stream'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Stream'),
   (SELECT song FROM songs WHERE lower(title)=lower('La Senorita')),
   'f',
   5820);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Stream'),
   (SELECT song FROM songs WHERE lower(title)=lower('Ecstasy')),
   'f',
   6437);
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 3'),
   2, 2,
   (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 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('La Senorita')),
   'f',
   6509);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('Ecstasy')),
   'f',
   6858);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Hugo' AS nick WHERE 'Hugo' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Hugo'),
   6
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Hugo'),
   (SELECT song FROM songs WHERE lower(title)=lower('La Senorita')),
   'f',
   6424);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 2,
   (SELECT player FROM players WHERE nick='Hugo'),
   (SELECT song FROM songs WHERE lower(title)=lower('Ecstasy')),
   'f',
   6499);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 3);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 3,
   (SELECT song FROM songs WHERE lower(title)=lower('Exotic Ethnic'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 3,
   (SELECT song FROM songs WHERE lower(title)=lower('Stomp'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=2;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=2;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Zyc' AS nick WHERE 'Zyc' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 3,
   (SELECT player FROM players WHERE nick='Zyc'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 3,
   (SELECT player FROM players WHERE nick='Zyc'),
   (SELECT song FROM songs WHERE lower(title)=lower('Exotic Ethnic')),
   'f',
   3711);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 3,
   (SELECT player FROM players WHERE nick='Zyc'),
   (SELECT song FROM songs WHERE lower(title)=lower('Stomp')),
   'f',
   3767);
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 3'),
   2, 3,
   (SELECT player FROM players WHERE nick='Nameless'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 3,
   (SELECT player FROM players WHERE nick='Nameless'),
   (SELECT song FROM songs WHERE lower(title)=lower('Exotic Ethnic')),
   'f',
   8621);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 3,
   (SELECT player FROM players WHERE nick='Nameless'),
   (SELECT song FROM songs WHERE lower(title)=lower('Stomp')),
   'f',
   5773);
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 3'),
   2, 3,
   (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 3'),
   2, 3,
   (SELECT player FROM players WHERE nick='Haggar'),
   (SELECT song FROM songs WHERE lower(title)=lower('Exotic Ethnic')),
   'f',
   8853);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 3,
   (SELECT player FROM players WHERE nick='Haggar'),
   (SELECT song FROM songs WHERE lower(title)=lower('Stomp')),
   'f',
   5898);
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 3'),
   2, 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 3'),
   2, 3,
   (SELECT player FROM players WHERE nick='Olemann'),
   (SELECT song FROM songs WHERE lower(title)=lower('Exotic Ethnic')),
   'f',
   6836);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 3,
   (SELECT player FROM players WHERE nick='Olemann'),
   (SELECT song FROM songs WHERE lower(title)=lower('Stomp')),
   'f',
   5513);
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 3'),
   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 3'),
   2, 3,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('Exotic Ethnic')),
   'f',
   8490);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 3,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('Stomp')),
   'f',
   6341);
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 3'),
   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 3'),
   2, 3,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('Exotic Ethnic')),
   'f',
   8781);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   2, 3,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('Stomp')),
   'f',
   6211);
INSERT INTO rounds (tournament, round, randomsongs, chosensongs) 
  VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   3,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   3, 0);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   3, 0,
   (SELECT song FROM songs WHERE lower(title)=lower('Memories'))
);
UPDATE rounds SET randomsongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=3;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=3;
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 3'),
   3, 0,
   (SELECT player FROM players WHERE nick='Stream'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   3, 0,
   (SELECT player FROM players WHERE nick='Stream'),
   (SELECT song FROM songs WHERE lower(title)=lower('Memories')),
   'f',
   6565);
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 3'),
   3, 0,
   (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 3'),
   3, 0,
   (SELECT player FROM players WHERE nick='T|na'),
   (SELECT song FROM songs WHERE lower(title)=lower('Memories')),
   'f',
   6520);
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 3'),
   3, 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 3'),
   3, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('Memories')),
   'f',
   7553);
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 3'),
   3, 0,
   (SELECT player FROM players WHERE nick='OJK'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   3, 0,
   (SELECT player FROM players WHERE nick='OJK'),
   (SELECT song FROM songs WHERE lower(title)=lower('Memories')),
   'f',
   7015);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Hugo' AS nick WHERE 'Hugo' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   3, 0,
   (SELECT player FROM players WHERE nick='Hugo'),
   5
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   3, 0,
   (SELECT player FROM players WHERE nick='Hugo'),
   (SELECT song FROM songs WHERE lower(title)=lower('Memories')),
   'f',
   7258);
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 3'),
   3, 0,
   (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 3'),
   3, 0,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('Memories')),
   'f',
   7143);
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 3'),
   3, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   7
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   3, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('Memories')),
   'f',
   7605);
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 3'),
   3, 0,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   8
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   3, 0,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   (SELECT song FROM songs WHERE lower(title)=lower('Memories')),
   'f',
   7185);
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 3'),
   3, 0,
   (SELECT player FROM players WHERE nick='Haggar'),
   9
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   3, 0,
   (SELECT player FROM players WHERE nick='Haggar'),
   (SELECT song FROM songs WHERE lower(title)=lower('Memories')),
   'f',
   6892);
INSERT INTO rounds (tournament, round, randomsongs, chosensongs) 
  VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   4,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   4, 0);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   4, 0,
   (SELECT song FROM songs WHERE lower(title)=lower('era (nostalmix)'))
);
UPDATE rounds SET randomsongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=4;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') 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 3'),
   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 3'),
   4, 0,
   (SELECT player FROM players WHERE nick='Haggar'),
   (SELECT song FROM songs WHERE lower(title)=lower('era (nostalmix)')),
   'f',
   7528);
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Hugo' AS nick WHERE 'Hugo' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   4, 0,
   (SELECT player FROM players WHERE nick='Hugo'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   4, 0,
   (SELECT player FROM players WHERE nick='Hugo'),
   (SELECT song FROM songs WHERE lower(title)=lower('era (nostalmix)')),
   'f',
   7376);
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 3'),
   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 3'),
   4, 0,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('era (nostalmix)')),
   'f',
   7371);
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 3'),
   4, 0,
   (SELECT player FROM players WHERE nick='OJK'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   4, 0,
   (SELECT player FROM players WHERE nick='OJK'),
   (SELECT song FROM songs WHERE lower(title)=lower('era (nostalmix)')),
   'f',
   7282);
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 3'),
   4, 0,
   (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 3'),
   4, 0,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   (SELECT song FROM songs WHERE lower(title)=lower('era (nostalmix)')),
   'f',
   7352);
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 3'),
   4, 0,
   (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 3'),
   4, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('era (nostalmix)')),
   'f',
   7606);
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 3'),
   4, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   7
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   4, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('era (nostalmix)')),
   'f',
   7572);
INSERT INTO rounds (tournament, round, randomsongs, chosensongs) 
  VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   5,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   5, 0);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   5, 0,
   (SELECT song FROM songs WHERE lower(title)=lower('B4U'))
);
UPDATE rounds SET randomsongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=5;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=5;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Hugo' AS nick WHERE 'Hugo' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   5, 0,
   (SELECT player FROM players WHERE nick='Hugo'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   5, 0,
   (SELECT player FROM players WHERE nick='Hugo'),
   (SELECT song FROM songs WHERE lower(title)=lower('B4U')),
   'f',
   7573);
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 3'),
   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 3'),
   5, 0,
   (SELECT player FROM players WHERE nick='RiChY'),
   (SELECT song FROM songs WHERE lower(title)=lower('B4U')),
   'f',
   7586);
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 3'),
   5, 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 3'),
   5, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('B4U')),
   'f',
   7742);
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 3'),
   5, 0,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   5, 0,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   (SELECT song FROM songs WHERE lower(title)=lower('B4U')),
   'f',
   7692);
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 3'),
   5, 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 3'),
   5, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('B4U')),
   'f',
   7830);
INSERT INTO rounds (tournament, round, randomsongs, chosensongs) 
  VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   6,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   6, 0);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   6, 0,
   (SELECT song FROM songs WHERE lower(title)=lower('B4U (B4 Za Beat Mix)'))
);
UPDATE rounds SET randomsongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=6;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=6;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Hugo' AS nick WHERE 'Hugo' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   6, 0,
   (SELECT player FROM players WHERE nick='Hugo'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   6, 0,
   (SELECT player FROM players WHERE nick='Hugo'),
   (SELECT song FROM songs WHERE lower(title)=lower('B4U (B4 Za Beat Mix)')),
   'f',
   6376);
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 3'),
   6, 0,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   6, 0,
   (SELECT player FROM players WHERE nick='Oliyzia'),
   (SELECT song FROM songs WHERE lower(title)=lower('B4U (B4 Za Beat Mix)')),
   'f',
   6094);
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 3'),
   6, 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 3'),
   6, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('B4U (B4 Za Beat Mix)')),
   'f',
   6623);
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 3'),
   6, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   4
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   6, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('B4U (B4 Za Beat Mix)')),
   'f',
   6455);
INSERT INTO rounds (tournament, round, randomsongs, chosensongs) 
  VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   7,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   7, 0);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   7, 0,
   (SELECT song FROM songs WHERE lower(title)=lower('Tsugaru'))
);
UPDATE rounds SET randomsongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=7;
UPDATE rounds SET chosensongs=1 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=7;
INSERT INTO players SELECT nextval('players_player_seq') AS player, 'Hugo' AS nick WHERE 'Hugo' NOT IN ( SELECT nick FROM players );
INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   7, 0,
   (SELECT player FROM players WHERE nick='Hugo'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   7, 0,
   (SELECT player FROM players WHERE nick='Hugo'),
   (SELECT song FROM songs WHERE lower(title)=lower('Tsugaru')),
   'f',
   8273);
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 3'),
   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 3'),
   7, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('Tsugaru')),
   'f',
   8420);
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 3'),
   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 3'),
   7, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('Tsugaru')),
   'f',
   8604);
INSERT INTO rounds (tournament, round, randomsongs, chosensongs) 
  VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   8,
   0, 0);
INSERT INTO groups (tournament, round, parallel) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   8, 0);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   8, 0,
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me'))
);
INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   8, 0,
   (SELECT song FROM songs WHERE lower(title)=lower('Max 300'))
);
UPDATE rounds SET randomsongs=2 WHERE 
  tournament=(SELECT tournament FROM tournaments WHERE name='Challenge Cup 3') AND 
  round=8;
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 3'),
   8, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   1
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   8, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me')),
   'f',
   5640);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   8, 0,
   (SELECT player FROM players WHERE nick='DufF'),
   (SELECT song FROM songs WHERE lower(title)=lower('Max 300')),
   'f',
   8906);
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 3'),
   8, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   2
);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   8, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('I Want You To Want Me')),
   'f',
   5750);
INSERT INTO scores (tournament, round, parallel, player, song, chosen, score) VALUES (
   (SELECT tournament FROM tournaments WHERE name='Challenge Cup 3'),
   8, 0,
   (SELECT player FROM players WHERE nick='Snute'),
   (SELECT song FROM songs WHERE lower(title)=lower('Max 300')),
   'f',
   9496);
commit;
