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
Who writes a lot of papers in Machine Learning ?
assistant
SELECT DISTINCT t1.authorname FROM paperkeyphrase AS t2 JOIN keyphrase AS t4 ON t2.keyphraseid = t4.keyphraseid JOIN writes AS t3 ON t3.paperid = t2.paperid JOIN author AS t1 ON t3.authorid = t1.authorid WHERE t4.keyphrasename = 'Machine Learning' GROUP BY t1.authorname ORDER BY COUNT ( DISTINCT t3.paperid ) DESC;
human
How many papers are there ?
assistant
SELECT DISTINCT COUNT ( DISTINCT paperid ) FROM paper;
human
papers published in the last year
assistant
SELECT DISTINCT paperid FROM paper WHERE YEAR = ( SELECT MAX ( YEAR ) FROM paper );
human
List today 's journals
assistant
SELECT DISTINCT journalid FROM paper WHERE YEAR = 2011 GROUP BY journalid;
human
papers from 2014
assistant
SELECT DISTINCT paperid FROM paper WHERE YEAR = 2014;
human
papers that use WebKB
assistant
SELECT DISTINCT t3.paperid FROM paperdataset AS t2 JOIN dataset AS t1 ON t2.datasetid = t1.datasetid JOIN paper AS t3 ON t3.paperid = t2.paperid WHERE t1.datasetname = "WebKB" ;