CREATE TABLE paperdataset (paperid INT, datasetid INT)
CREATE TABLE writes (paperid INT, authorid INT)
CREATE TABLE paper (paperid INT, title VARCHAR, venueid INT, year INT, numciting INT, numcitedby INT, journalid INT)
CREATE TABLE venue (venueid INT, venuename VARCHAR)
CREATE TABLE paperkeyphrase (paperid INT, keyphraseid INT)
CREATE TABLE keyphrase (keyphraseid INT, keyphrasename VARCHAR)
CREATE TABLE cite (citingpaperid INT, citedpaperid INT)
CREATE TABLE journal (journalid INT, journalname VARCHAR)
CREATE TABLE author (authorid INT, authorname VARCHAR)
CREATE TABLE field (fieldid INT)
CREATE TABLE dataset (datasetid INT, datasetname VARCHAR)
CREATE TABLE paperfield (fieldid INT, paperid INT)

sentiment analysis papers that have the most citations
SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'sentiment analysis' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citedpaperid) DESC
SELECT DISTINCT "cite"."citedpaperid", COUNT("cite"."citedpaperid") FROM "cite" JOIN "paper" ON "cite"."citedpaperid" = "paper"."paperid" JOIN "paperkeyphrase" ON "paper"."paperid" = "paperkeyphrase"."paperid" JOIN "keyphrase" ON "keyphrase"."keyphraseid" = "paperkeyphrase"."keyphraseid" AND "keyphrase"."keyphrasename" = 'sentiment analysis' GROUP BY "cite"."citedpaperid" ORDER BY COUNT("cite"."citedpaperid") DESC NULLS LAST