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 has Christopher D. Manning written ?
assistant
SELECT DISTINCT COUNT ( DISTINCT t2.paperid ) FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname = 'Christopher D. Manning';
human
what author is most cited ?
assistant
SELECT DISTINCT t1.authorname , COUNT ( t3.citingpaperid ) FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid JOIN cite AS t3 ON t2.paperid = t3.citedpaperid GROUP BY t1.authorname ORDER BY COUNT ( t3.citingpaperid ) DESC;
human
authors with at least 5 papers
assistant
SELECT DISTINCT COUNT ( t2.paperid ) , t1.authorid FROM writes AS t1 JOIN paper AS t2 ON t1.paperid = t2.paperid GROUP BY t1.authorid HAVING COUNT ( t2.paperid ) >= 5;
human
Which authors published papers in 2015 ?
assistant
SELECT DISTINCT t1.authorid FROM writes AS t1 JOIN paper AS t2 ON t1.paperid = t2.paperid WHERE t2.year = 2015;
human
How many papers has Noah Smith co-authored since 2009 ?
assistant
SELECT DISTINCT COUNT ( DISTINCT t2.paperid ) 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 != 'Noah Smith' AND t3.year > 2009 AND t2.paperid IN ( SELECT t2.paperid FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname LIKE 'Noah Smith' );
human
How many co-authors has Mark Steedman had ?
assistant
SELECT DISTINCT COUNT( DISTINCT t1.authorid ) FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname != "Mark Steedman" AND t2.paperid IN ( SELECT t2.paperid FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname = "Mark Steedman" ) ;