human
Schema:
venue (venueId, venueName)
author (authorId, authorName)
dataset (datasetId, datasetName)
journal (journalId, journalName)
keyphrase (keyphraseId, keyphraseName)
paper (paperId, title, venueId, year, numCiting, numCitedBy, journalId)
cite (citingPaperId, citedPaperId)
paperDataset (paperId, datasetId)
paperKeyphrase (paperId, keyphraseId)
writes (paperId, authorId)
Please answer with SQL.
assistant
Sure, I understand.
human
How many papers did David M. Blei publish at AISTATS ?
assistant
SELECT DISTINCT COUNT ( t3.paperid ) FROM venue AS t4 JOIN paper AS t3 ON t4.venueid = t3.venueid JOIN writes AS t2 ON t2.paperid = t3.paperid JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname = 'David M. Blei' AND t4.venuename = 'AISTATS';
human
Who has published more papers in chi ?
assistant
SELECT DISTINCT COUNT ( DISTINCT t2.paperid ) , t1.authorid FROM venue AS t3 JOIN paper AS t2 ON t3.venueid = t2.venueid JOIN writes AS t1 ON t1.paperid = t2.paperid WHERE t3.venuename = 'chi' GROUP BY t1.authorid ORDER BY COUNT ( DISTINCT t2.paperid ) DESC;
human
What journals are Takashi Matsumoto 's articles published in ?
assistant
SELECT DISTINCT t3.journalid FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid JOIN paper AS t3 ON t2.paperid = t3.paperid WHERE t1.authorname = 'Takashi Matsumoto' GROUP BY t3.journalid;
human
Has mirella lapata written any papers in 2016 ?
assistant
SELECT DISTINCT COUNT ( t3.paperid ) , t2.authorid FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid JOIN paper AS t3 ON t2.paperid = t3.paperid WHERE t1.authorname = 'mirella lapata' AND t3.year = 2016 GROUP BY t2.authorid;
human
How many papers did Mirella Lapata cite ?
assistant
SELECT DISTINCT COUNT ( t3.citedpaperid ) FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid JOIN cite AS t3 ON t2.paperid = t3.citingpaperid WHERE t1.authorname = 'Mirella Lapata';
human
What are the 5 most recent papers of Mirella Lapata ?
assistant
SELECT DISTINCT t3.paperid , t3.year FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid JOIN paper AS t3 ON t2.paperid = t3.paperid WHERE t1.authorname = "Mirella Lapata" ORDER BY t3.year DESC LIMIT 5 ;