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
what keyphrase does Brian DeRenzi write about that gets most citations ?
assistant
SELECT DISTINCT t1.keyphrasename , SUM ( t3.numcitedby ) FROM paperkeyphrase AS t2 JOIN keyphrase AS t1 ON t2.keyphraseid = t1.keyphraseid JOIN paper AS t3 ON t3.paperid = t2.paperid JOIN writes AS t4 ON t4.paperid = t3.paperid JOIN author AS t5 ON t4.authorid = t5.authorid WHERE t5.authorname = 'Brian DeRenzi' GROUP BY t1.keyphrasename ORDER BY SUM ( t3.numcitedby ) DESC;
human
How many papers by Ed Desmond contain the keyphrases Semantic Parsing ?
assistant
SELECT DISTINCT COUNT ( DISTINCT t3.paperid ) FROM paperkeyphrase AS t1 JOIN keyphrase AS t4 ON t1.keyphraseid = t4.keyphraseid JOIN writes AS t3 ON t3.paperid = t1.paperid JOIN author AS t2 ON t3.authorid = t2.authorid WHERE t2.authorname = 'Ed Desmond' AND t4.keyphrasename = 'Semantic Parsing';
human
How many citations does luke zettlemoyer have per year
assistant
SELECT DISTINCT COUNT ( t4.citedpaperid ) , t3.year FROM paper AS t3 JOIN cite AS t4 ON t3.paperid = t4.citedpaperid JOIN writes AS t2 ON t2.paperid = t3.paperid JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname = 'luke zettlemoyer' GROUP BY t3.year;
human
When did Luke S Zettlemoyer publish ?
assistant
SELECT DISTINCT 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 = 'Luke S Zettlemoyer' ORDER BY t3.year;
human
keyphrases used by Luke S Zettlemoyer for each year
assistant
SELECT DISTINCT t2.keyphraseid , t3.year FROM paper AS t3 JOIN paperkeyphrase AS t2 ON t3.paperid = t2.paperid JOIN writes AS t4 ON t4.paperid = t3.paperid JOIN author AS t1 ON t4.authorid = t1.authorid WHERE t1.authorname = 'Luke S Zettlemoyer' ORDER BY t3.year , t2.keyphraseid;
human
give me the keywords used by Luke Zettlemoyer
assistant
SELECT DISTINCT t1.keyphraseid FROM paperkeyphrase AS t2 JOIN keyphrase AS t1 ON t2.keyphraseid = t1.keyphraseid JOIN paper AS t3 ON t3.paperid = t2.paperid JOIN writes AS t4 ON t4.paperid = t3.paperid JOIN author AS t5 ON t4.authorid = t5.authorid WHERE t5.authorname = "Luke Zettlemoyer" ;