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

who is the most cited author at CVPR ?
SELECT DISTINCT COUNT(DISTINCT cite.citingpaperid), writes.authorid FROM cite, paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename = 'CVPR' AND writes.paperid = cite.citedpaperid AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(DISTINCT cite.citingpaperid) DESC
SELECT DISTINCT COUNT(DISTINCT "cite"."citingpaperid"), "writes"."authorid" FROM "cite" JOIN "writes" ON "cite"."citedpaperid" = "writes"."paperid" JOIN "paper" ON "paper"."paperid" = "writes"."paperid" JOIN "venue" ON "paper"."venueid" = "venue"."venueid" AND "venue"."venuename" = 'CVPR' GROUP BY "writes"."authorid" ORDER BY COUNT(DISTINCT "cite"."citingpaperid") DESC NULLS LAST