{"Songs": {"columns": [[0, "SongId", "INTEGER", 0, null, 1], [1, "Title", "TEXT", 0, null, 0]], "primary_keys": ["SongId"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Albums": {"columns": [[0, "AId", "INTEGER", 0, null, 1], [1, "Title", "TEXT", 0, null, 0], [2, "Year", "INTEGER", 0, null, 0], [3, "Label", "TEXT", 0, null, 0], [4, "Type", "TEXT", 0, null, 0]], "primary_keys": ["AId"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Band": {"columns": [[0, "Id", "INTEGER", 0, null, 1], [1, "Firstname", "TEXT", 0, null, 0], [2, "Lastname", "TEXT", 0, null, 0]], "primary_keys": ["Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Instruments": {"columns": [[0, "SongId", "INTEGER", 0, null, 1], [1, "BandmateId", "INTEGER", 0, null, 2], [2, "Instrument", "TEXT", 0, null, 3]], "primary_keys": ["SongId", "BandmateId", "Instrument"], "foreign_keys": [[0, 0, "Band", "BandmateId", "Id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Songs", "SongId", "SongId", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "SongId"], [1, 1, "BandmateId"], [2, 2, "Instrument"]]], "check_constraints": []}, "Performance": {"columns": [[0, "SongId", "INTEGER", 0, null, 1], [1, "Bandmate", "INTEGER", 0, null, 2], [2, "StagePosition", "TEXT", 0, null, 0]], "primary_keys": ["SongId", "Bandmate"], "foreign_keys": [[0, 0, "Band", "Bandmate", "Id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Songs", "SongId", "SongId", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "SongId"], [1, 1, "Bandmate"]]], "check_constraints": []}, "Tracklists": {"columns": [[0, "AlbumId", "INTEGER", 0, null, 1], [1, "Position", "INTEGER", 0, null, 2], [2, "SongId", "INTEGER", 0, null, 0]], "primary_keys": ["AlbumId", "Position"], "foreign_keys": [[0, 0, "Albums", "AlbumId", "AId", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Songs", "SongId", "SongId", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "AlbumId"], [1, 1, "Position"]]], "check_constraints": []}, "Vocals": {"columns": [[0, "SongId", "INTEGER", 0, null, 1], [1, "Bandmate", "INTEGER", 0, null, 2], [2, "Type", "TEXT", 0, null, 0]], "primary_keys": ["SongId", "Bandmate"], "foreign_keys": [[0, 0, "Band", "Bandmate", "Id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Songs", "SongId", "SongId", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "SongId"], [1, 1, "Bandmate"]]], "check_constraints": []}}
CREATE TABLE Songs (
    SongId INTEGER   PRIMARY KEY,
    Title TEXT
);

CREATE TABLE Albums (
    AId INTEGER   PRIMARY KEY,
    Title TEXT,
    Year INTEGER,
    Label TEXT,
    Type TEXT
);

CREATE TABLE Band (
    Id INTEGER   PRIMARY KEY,
    Firstname TEXT,
    Lastname TEXT
);

CREATE TABLE Instruments (
    SongId INTEGER   PRIMARY KEY,
    BandmateId INTEGER   PRIMARY KEY,
    Instrument TEXT   PRIMARY KEY,
    PRIMARY KEY (SongId, BandmateId, Instrument),
    UNIQUE (SongId, BandmateId, Instrument),
    FOREIGN KEY (BandmateId) REFERENCES Band(Id),
    FOREIGN KEY (SongId) REFERENCES Songs(SongId)
);

CREATE TABLE Performance (
    SongId INTEGER   PRIMARY KEY,
    Bandmate INTEGER   PRIMARY KEY,
    StagePosition TEXT,
    PRIMARY KEY (SongId, Bandmate),
    UNIQUE (SongId, Bandmate),
    FOREIGN KEY (Bandmate) REFERENCES Band(Id),
    FOREIGN KEY (SongId) REFERENCES Songs(SongId)
);

CREATE TABLE Tracklists (
    AlbumId INTEGER   PRIMARY KEY,
    Position INTEGER   PRIMARY KEY,
    SongId INTEGER,
    PRIMARY KEY (AlbumId, Position),
    UNIQUE (AlbumId, Position),
    FOREIGN KEY (AlbumId) REFERENCES Albums(AId),
    FOREIGN KEY (SongId) REFERENCES Songs(SongId)
);

CREATE TABLE Vocals (
    SongId INTEGER   PRIMARY KEY,
    Bandmate INTEGER   PRIMARY KEY,
    Type TEXT,
    PRIMARY KEY (SongId, Bandmate),
    UNIQUE (SongId, Bandmate),
    FOREIGN KEY (Bandmate) REFERENCES Band(Id),
    FOREIGN KEY (SongId) REFERENCES Songs(SongId)
);