round INTEGER NOT NULL,
parallel INTEGER NOT NULL,
player INTEGER NOT NULL REFERENCES players,
+ songnumber INTEGER NOT NULL,
song INTEGER NOT NULL REFERENCES songs,
playmode VARCHAR CHECK (playmode IS NULL OR playmode IN ('single','double')),
FOREIGN KEY (song) REFERENCES songs (song),
FOREIGN KEY (song, playmode, difficulty) REFERENCES songratings (song, playmode, difficulty),
FOREIGN KEY (tournament, round, parallel, player) REFERENCES roundparticipation (tournament, round, parallel, player),
+ UNIQUE (tournament, round, parallel, player, songnumber),
PRIMARY KEY (tournament, round, parallel, player, song)
);