+
+CREATE TABLE scores (
+ tournament INTEGER NOT NULL,
+ round INTEGER NOT NULL,
+ parallel INTEGER NOT NULL,
+ player INTEGER NOT NULL REFERENCES players,
+
+ song INTEGER NOT NULL REFERENCES songs,
+ playmode VARCHAR NOT NULL CHECK playmode IN ('single','double'),
+ difficulty VARCHAR NOT NULL CHECK difficulty IN ('beginner','standard','difficult','expert','challenge'),
+
+ score INTEGER NOT NULL CHECK (score >= 0 AND score <= 10000),
+
+ FOREIGN KEY (song, playmode, difficulty) REFERENCES songs (song, playmode, difficulty),
+ FOREIGN KEY (tournament, round, parallel) REFERENCES groups (tournament, round, parallel),
+ PRIMARY KEY (tournament, round, parallel, player, songs)
+);