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 papers has sharon goldwater written ?
assistant
SELECT DISTINCT t2.paperid FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname = 'sharon goldwater';
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
papers citing Daniel Jurafsky
assistant
SELECT DISTINCT t3.paperid FROM paper AS t3 JOIN cite AS t4 ON t3.paperid = t4.citingpaperid JOIN writes AS t2 ON t2.paperid = t4.citedpaperid JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname = 'Daniel Jurafsky';
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
where does Peter Mertens publish ?
assistant
SELECT DISTINCT t3.journalid , t4.venueid 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 = 'Peter Mertens';
human
what are the papers that have Peter Mertens and Dina Barbian as co-authors
assistant
SELECT DISTINCT t3.paperid FROM writes AS t3 JOIN author AS t2 ON t3.authorid = t2.authorid JOIN writes AS t4 ON t4.paperid = t3.paperid JOIN author AS t1 ON t4.authorid = t1.authorid WHERE t2.authorname = "Peter Mertens" AND t1.authorname = "Dina Barbian" ;