{"venue": {"columns": [[0, "venueId", "INTEGER", 1, null, 1], [1, "venueName", "varchar(100)", 0, "NULL", 0]], "primary_keys": ["venueId"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "author": {"columns": [[0, "authorId", "INTEGER", 1, null, 1], [1, "authorName", "varchar(50)", 0, "NULL", 0]], "primary_keys": ["authorId"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "dataset": {"columns": [[0, "datasetId", "INTEGER", 1, null, 1], [1, "datasetName", "varchar(50)", 0, "NULL", 0]], "primary_keys": ["datasetId"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "journal": {"columns": [[0, "journalId", "INTEGER", 1, null, 1], [1, "journalName", "varchar(100)", 0, "NULL", 0]], "primary_keys": ["journalId"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "keyphrase": {"columns": [[0, "keyphraseId", "INTEGER", 1, null, 1], [1, "keyphraseName", "varchar(50)", 0, "NULL", 0]], "primary_keys": ["keyphraseId"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "paper": {"columns": [[0, "paperId", "INTEGER", 1, null, 1], [1, "title", "varchar(300)", 0, "NULL", 0], [2, "venueId", "INTEGER", 0, "NULL", 0], [3, "year", "INTEGER", 0, "NULL", 0], [4, "numCiting", "INTEGER", 0, "NULL", 0], [5, "numCitedBy", "INTEGER", 0, "NULL", 0], [6, "journalId", "INTEGER", 0, "NULL", 0]], "primary_keys": ["paperId"], "foreign_keys": [[0, 0, "venue", "venueId", "venueId", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "journal", "journalId", "journalId", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "cite": {"columns": [[0, "citingPaperId", "INTEGER", 1, null, 1], [1, "citedPaperId", "INTEGER", 1, null, 2]], "primary_keys": ["citingPaperId", "citedPaperId"], "foreign_keys": [[0, 0, "paper", "citingPaperId", "paperId", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "paper", "citedPaperId", "paperId", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "citingPaperId"], [1, 1, "citedPaperId"]]], "check_constraints": []}, "paperDataset": {"columns": [[0, "paperId", "INTEGER", 0, "NULL", 2], [1, "datasetId", "INTEGER", 0, "NULL", 1]], "primary_keys": ["paperId", "datasetId"], "foreign_keys": [], "unique_constraints": [[[0, 1, "datasetId"], [1, 0, "paperId"]]], "check_constraints": []}, "paperKeyphrase": {"columns": [[0, "paperId", "INTEGER", 0, "NULL", 2], [1, "keyphraseId", "INTEGER", 0, "NULL", 1]], "primary_keys": ["paperId", "keyphraseId"], "foreign_keys": [[0, 0, "keyphrase", "keyphraseId", "keyphraseId", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "paper", "paperId", "paperId", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "keyphraseId"], [1, 0, "paperId"]]], "check_constraints": []}, "writes": {"columns": [[0, "paperId", "INTEGER", 0, "NULL", 1], [1, "authorId", "INTEGER", 0, "NULL", 2]], "primary_keys": ["paperId", "authorId"], "foreign_keys": [[0, 0, "author", "authorId", "authorId", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "paper", "paperId", "paperId", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "paperId"], [1, 1, "authorId"]]], "check_constraints": []}}
CREATE TABLE venue (
    venueId INTEGER NOT NULL  PRIMARY KEY,
    venueName varchar(100)  DEFAULT NULL
);

CREATE TABLE author (
    authorId INTEGER NOT NULL  PRIMARY KEY,
    authorName varchar(50)  DEFAULT NULL
);

CREATE TABLE dataset (
    datasetId INTEGER NOT NULL  PRIMARY KEY,
    datasetName varchar(50)  DEFAULT NULL
);

CREATE TABLE journal (
    journalId INTEGER NOT NULL  PRIMARY KEY,
    journalName varchar(100)  DEFAULT NULL
);

CREATE TABLE keyphrase (
    keyphraseId INTEGER NOT NULL  PRIMARY KEY,
    keyphraseName varchar(50)  DEFAULT NULL
);

CREATE TABLE paper (
    paperId INTEGER NOT NULL  PRIMARY KEY,
    title varchar(300)  DEFAULT NULL,
    venueId INTEGER  DEFAULT NULL,
    year INTEGER  DEFAULT NULL,
    numCiting INTEGER  DEFAULT NULL,
    numCitedBy INTEGER  DEFAULT NULL,
    journalId INTEGER  DEFAULT NULL,
    FOREIGN KEY (venueId) REFERENCES venue(venueId),
    FOREIGN KEY (journalId) REFERENCES journal(journalId)
);

CREATE TABLE cite (
    citingPaperId INTEGER NOT NULL  PRIMARY KEY,
    citedPaperId INTEGER NOT NULL  PRIMARY KEY,
    PRIMARY KEY (citingPaperId, citedPaperId),
    UNIQUE (citingPaperId, citedPaperId),
    FOREIGN KEY (citingPaperId) REFERENCES paper(paperId),
    FOREIGN KEY (citedPaperId) REFERENCES paper(paperId)
);

CREATE TABLE paperDataset (
    paperId INTEGER  DEFAULT NULL PRIMARY KEY,
    datasetId INTEGER  DEFAULT NULL PRIMARY KEY,
    PRIMARY KEY (paperId, datasetId),
    UNIQUE (datasetId, paperId)
);

CREATE TABLE paperKeyphrase (
    paperId INTEGER  DEFAULT NULL PRIMARY KEY,
    keyphraseId INTEGER  DEFAULT NULL PRIMARY KEY,
    PRIMARY KEY (paperId, keyphraseId),
    UNIQUE (keyphraseId, paperId),
    FOREIGN KEY (keyphraseId) REFERENCES keyphrase(keyphraseId),
    FOREIGN KEY (paperId) REFERENCES paper(paperId)
);

CREATE TABLE writes (
    paperId INTEGER  DEFAULT NULL PRIMARY KEY,
    authorId INTEGER  DEFAULT NULL PRIMARY KEY,
    PRIMARY KEY (paperId, authorId),
    UNIQUE (paperId, authorId),
    FOREIGN KEY (authorId) REFERENCES author(authorId),
    FOREIGN KEY (paperId) REFERENCES paper(paperId)
);