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


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


CREATE TABLE author (
	"authorId" INTEGER NOT NULL, 
	"authorName" VARCHAR(50) DEFAULT NULL, 
	PRIMARY KEY ("authorId")
)


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


CREATE TABLE dataset (
	"datasetId" INTEGER NOT NULL, 
	"datasetName" VARCHAR(50) DEFAULT NULL, 
	PRIMARY KEY ("datasetId")
)


CREATE TABLE journal (
	"journalId" INTEGER NOT NULL, 
	"journalName" VARCHAR(100) DEFAULT NULL, 
	PRIMARY KEY ("journalId")
)


CREATE TABLE keyphrase (
	"keyphraseId" INTEGER NOT NULL, 
	"keyphraseName" VARCHAR(50) DEFAULT NULL, 
	PRIMARY KEY ("keyphraseId")
)


CREATE TABLE paper (
	"paperId" INTEGER NOT NULL, 
	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, 
	PRIMARY KEY ("paperId"), 
	FOREIGN KEY("venueId") REFERENCES venue ("venueId"), 
	FOREIGN KEY("journalId") REFERENCES journal ("journalId")
)


CREATE TABLE venue (
	"venueId" INTEGER NOT NULL, 
	"venueName" VARCHAR(100) DEFAULT NULL, 
	PRIMARY KEY ("venueId")
)


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

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

/*
2 rows from paperDataset table:
paperId	datasetId

*/


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

/*
2 rows from paperKeyphrase table:
paperId	keyphraseId

*/


CREATE TABLE author (
	"authorId" INTEGER NOT NULL, 
	"authorName" VARCHAR(50) DEFAULT NULL, 
	PRIMARY KEY ("authorId")
)

/*
2 rows from author table:
authorId	authorName

*/


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

/*
2 rows from cite table:
citingPaperId	citedPaperId

*/


CREATE TABLE dataset (
	"datasetId" INTEGER NOT NULL, 
	"datasetName" VARCHAR(50) DEFAULT NULL, 
	PRIMARY KEY ("datasetId")
)

/*
2 rows from dataset table:
datasetId	datasetName

*/


CREATE TABLE journal (
	"journalId" INTEGER NOT NULL, 
	"journalName" VARCHAR(100) DEFAULT NULL, 
	PRIMARY KEY ("journalId")
)

/*
2 rows from journal table:
journalId	journalName

*/


CREATE TABLE keyphrase (
	"keyphraseId" INTEGER NOT NULL, 
	"keyphraseName" VARCHAR(50) DEFAULT NULL, 
	PRIMARY KEY ("keyphraseId")
)

/*
2 rows from keyphrase table:
keyphraseId	keyphraseName

*/


CREATE TABLE paper (
	"paperId" INTEGER NOT NULL, 
	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, 
	PRIMARY KEY ("paperId"), 
	FOREIGN KEY("venueId") REFERENCES venue ("venueId"), 
	FOREIGN KEY("journalId") REFERENCES journal ("journalId")
)

/*
2 rows from paper table:
paperId	title	venueId	year	numCiting	numCitedBy	journalId

*/


CREATE TABLE venue (
	"venueId" INTEGER NOT NULL, 
	"venueName" VARCHAR(100) DEFAULT NULL, 
	PRIMARY KEY ("venueId")
)

/*
2 rows from venue table:
venueId	venueName

*/


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

/*
2 rows from writes table:
paperId	authorId

*/
how many papers published in nature communications 2015 ?
SELECT DISTINCT COUNT ( t1.paperid ) FROM venue AS t2 JOIN paper AS t1 ON t2.venueid  =  t1.venueid WHERE t1.year  =  2015 AND t2.venuename  =  "nature communications";
[{'COUNT ( t1.paperid )': 0}]