human
Schema:
author (aid, homepage, name, oid)
conference (cid, homepage, name)
domain (did, name)
domain_author (aid, did)
domain_conference (cid, did)
journal (homepage, jid, name)
domain_journal (did, jid)
keyword (keyword, kid)
domain_keyword (did, kid)
publication (abstract, cid, citation_num, jid, pid, reference_num, title, year)
domain_publication (did, pid)
organization (continent, homepage, name, oid)
publication_keyword (pid, kid)
writes (aid, pid)
cite (cited, citing)
Please answer with SQL.
assistant
Sure, I understand.
human
return me the journal, which have the most number of papers by ' H. V. Jagadish ' .
assistant
SELECT t2.name FROM publication AS t4 JOIN journal AS t2 ON t4.jid = t2.jid JOIN writes AS t3 ON t3.pid = t4.pid JOIN author AS t1 ON t3.aid = t1.aid WHERE t1.name = 'H. V. Jagadish' GROUP BY t2.name ORDER BY COUNT ( DISTINCT t4.title ) DESC LIMIT 1;
human
return me the number of papers written by ' H. V. Jagadish ' and ' Divesh Srivastava ' .
assistant
SELECT COUNT ( DISTINCT t5.title ) FROM writes AS t3 JOIN author AS t2 ON t3.aid = t2.aid JOIN publication AS t5 ON t3.pid = t5.pid JOIN writes AS t4 ON t4.pid = t5.pid JOIN author AS t1 ON t4.aid = t1.aid WHERE t2.name = 'H. V. Jagadish' AND t1.name = 'Divesh Srivastava';
human
return me the number of papers by ' H. V. Jagadish ' on PVLDB .
assistant
SELECT COUNT ( DISTINCT t4.title ) FROM publication AS t4 JOIN journal AS t2 ON t4.jid = t2.jid JOIN writes AS t3 ON t3.pid = t4.pid JOIN author AS t1 ON t3.aid = t1.aid WHERE t1.name = 'H. V. Jagadish' AND t2.name = 'PVLDB';
human
return me the number of papers written by ' H. V. Jagadish ' in each year .
assistant
SELECT COUNT ( DISTINCT t3.title ) , t3.year FROM writes AS t2 JOIN author AS t1 ON t2.aid = t1.aid JOIN publication AS t3 ON t2.pid = t3.pid WHERE t1.name = 'H. V. Jagadish' GROUP BY t3.year;
human
return me the number of papers by ' H. V. Jagadish ' after 2000 .
assistant
SELECT COUNT ( DISTINCT t3.title ) FROM writes AS t2 JOIN author AS t1 ON t2.aid = t1.aid JOIN publication AS t3 ON t2.pid = t3.pid WHERE t1.name = 'H. V. Jagadish' AND t3.year > 2000;
human
return me the number of papers by ' H. V. Jagadish ' .
assistant
SELECT COUNT( DISTINCT t3.title ) FROM writes AS t2 JOIN author AS t1 ON t2.aid = t1.aid JOIN publication AS t3 ON t2.pid = t3.pid WHERE t1.name = "H. V. Jagadish" ;