{"Inst": {"columns": [[0, "instID", "INTEGER", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "country", "TEXT", 0, null, 0]], "primary_keys": ["instID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Authors": {"columns": [[0, "authID", "INTEGER", 0, null, 1], [1, "lname", "TEXT", 0, null, 0], [2, "fname", "TEXT", 0, null, 0]], "primary_keys": ["authID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Papers": {"columns": [[0, "paperID", "INTEGER", 0, null, 1], [1, "title", "TEXT", 0, null, 0]], "primary_keys": ["paperID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Authorship": {"columns": [[0, "authID", "INTEGER", 0, null, 1], [1, "instID", "INTEGER", 0, null, 2], [2, "paperID", "INTEGER", 0, null, 3], [3, "authOrder", "INTEGER", 0, null, 0]], "primary_keys": ["authID", "instID", "paperID"], "foreign_keys": [[0, 0, "Papers", "paperID", "paperID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Inst", "instID", "instID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Authors", "authID", "authID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "authID"], [1, 1, "instID"], [2, 2, "paperID"]]], "check_constraints": []}}
CREATE TABLE Inst (
    instID INTEGER   PRIMARY KEY,
    name TEXT,
    country TEXT
);

CREATE TABLE Authors (
    authID INTEGER   PRIMARY KEY,
    lname TEXT,
    fname TEXT
);

CREATE TABLE Papers (
    paperID INTEGER   PRIMARY KEY,
    title TEXT
);

CREATE TABLE Authorship (
    authID INTEGER   PRIMARY KEY,
    instID INTEGER   PRIMARY KEY,
    paperID INTEGER   PRIMARY KEY,
    authOrder INTEGER,
    PRIMARY KEY (authID, instID, paperID),
    UNIQUE (authID, instID, paperID),
    FOREIGN KEY (paperID) REFERENCES Papers(paperID),
    FOREIGN KEY (instID) REFERENCES Inst(instID),
    FOREIGN KEY (authID) REFERENCES Authors(authID)
);