db_name
stringclasses 146
values | prompt
stringlengths 310
4.81k
|
|---|---|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the conferences, which have more than 10 papers by " H. V. Jagadish " .
#
### SQL:
#
# SELECT t2.name FROM publication AS t4 JOIN conference AS t2 ON t4.cid = t2.cid 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 HAVING COUNT ( DISTINCT t4.title ) > 10;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the conference, which have the most number of papers by " H. V. Jagadish " .
#
### SQL:
#
# SELECT t2.name FROM publication AS t4 JOIN conference AS t2 ON t4.cid = t2.cid 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;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the journals, which have more than 10 papers by " H. V. Jagadish " .
#
### SQL:
#
# 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 HAVING COUNT ( DISTINCT t4.title ) > 10;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the journal, which have the most number of papers by " H. V. Jagadish " .
#
### SQL:
#
# 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;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the paper with the most citations .
#
### SQL:
#
# SELECT title FROM publication ORDER BY citation_num DESC LIMIT 1;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the paper in Databases area with the most citations .
#
### SQL:
#
# SELECT t3.title FROM DOMAIN AS t2 JOIN domain_publication AS t1 ON t2.did = t1.did JOIN publication AS t3 ON t3.pid = t1.pid WHERE t2.name = "Databases" ORDER BY t3.citation_num DESC LIMIT 1;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the paper in PVLDB with the most citations .
#
### SQL:
#
# SELECT t2.title FROM publication AS t2 JOIN journal AS t1 ON t2.jid = t1.jid WHERE t1.name = "PVLDB" ORDER BY t2.citation_num DESC LIMIT 1;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the paper in VLDB conference with the most citations .
#
### SQL:
#
# SELECT t2.title FROM publication AS t2 JOIN conference AS t1 ON t2.cid = t1.cid WHERE t1.name = "VLDB" ORDER BY t2.citation_num DESC LIMIT 1;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the paper by " H. V. Jagadish " with the most citations .
#
### SQL:
#
# SELECT 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" ORDER BY t3.citation_num DESC LIMIT 1;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the paper after 2000 with the most citations .
#
### SQL:
#
# SELECT title FROM publication WHERE YEAR > 2000 ORDER BY citation_num DESC LIMIT 1;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the paper after 2000 in Databases area with the most citations .
#
### SQL:
#
# SELECT t3.title FROM DOMAIN AS t2 JOIN domain_publication AS t1 ON t2.did = t1.did JOIN publication AS t3 ON t3.pid = t1.pid WHERE t2.name = "Databases" AND t3.year > 2000 ORDER BY t3.citation_num DESC LIMIT 1;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the paper after 2000 in PVLDB with the most citations .
#
### SQL:
#
# SELECT t2.title FROM publication AS t2 JOIN journal AS t1 ON t2.jid = t1.jid WHERE t1.name = "PVLDB" AND t2.year > 2000 ORDER BY t2.citation_num DESC LIMIT 1;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the paper after 2000 in VLDB conference with the most citations .
#
### SQL:
#
# SELECT t2.title FROM publication AS t2 JOIN conference AS t1 ON t2.cid = t1.cid WHERE t1.name = "VLDB" AND t2.year > 2000 ORDER BY t2.citation_num DESC LIMIT 1;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the authors who have more than 10 papers in PVLDB .
#
### SQL:
#
# SELECT t1.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 t2.name = "PVLDB" GROUP BY t1.name HAVING COUNT ( DISTINCT t4.title ) > 10;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the authors who have the most number of papers in PVLDB .
#
### SQL:
#
# SELECT t1.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 t2.name = "PVLDB" GROUP BY t1.name ORDER BY COUNT ( DISTINCT t4.title ) DESC LIMIT 1;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the authors who have more than 10 papers containing keyword " Relational Database " .
#
### SQL:
#
# SELECT t2.name FROM publication_keyword AS t5 JOIN keyword AS t1 ON t5.kid = t1.kid JOIN publication AS t3 ON t3.pid = t5.pid JOIN writes AS t4 ON t4.pid = t3.pid JOIN author AS t2 ON t4.aid = t2.aid WHERE t1.keyword = "Relational Database" GROUP BY t2.name HAVING COUNT ( DISTINCT t3.title ) > 10;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the conferences, which have more than 60 papers containing keyword " Relational Database " .
#
### SQL:
#
# SELECT t2.name FROM publication_keyword AS t4 JOIN keyword AS t1 ON t4.kid = t1.kid JOIN publication AS t3 ON t3.pid = t4.pid JOIN conference AS t2 ON t3.cid = t2.cid WHERE t1.keyword = "Relational Database" GROUP BY t2.name HAVING COUNT ( DISTINCT t3.title ) > 60;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the journals, which have more than 60 papers containing keyword " Relational Database " .
#
### SQL:
#
# SELECT t3.name FROM publication_keyword AS t4 JOIN keyword AS t1 ON t4.kid = t1.kid JOIN publication AS t2 ON t2.pid = t4.pid JOIN journal AS t3 ON t2.jid = t3.jid WHERE t1.keyword = "Relational Database" GROUP BY t3.name HAVING COUNT ( DISTINCT t2.title ) > 60;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the keywords, which have been contained by more than 100 papers in VLDB conference .
#
### SQL:
#
# SELECT t1.keyword FROM publication_keyword AS t4 JOIN keyword AS t1 ON t4.kid = t1.kid JOIN publication AS t3 ON t3.pid = t4.pid JOIN conference AS t2 ON t3.cid = t2.cid WHERE t2.name = "VLDB" GROUP BY t1.keyword HAVING COUNT ( DISTINCT t3.title ) > 100;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the keywords, which have been contained by more than 100 papers in PVLDB .
#
### SQL:
#
# SELECT t1.keyword FROM publication_keyword AS t4 JOIN keyword AS t1 ON t4.kid = t1.kid JOIN publication AS t2 ON t2.pid = t4.pid JOIN journal AS t3 ON t2.jid = t3.jid WHERE t3.name = "PVLDB" GROUP BY t1.keyword HAVING COUNT ( DISTINCT t2.title ) > 100;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the keywords, which have been contained by more than 10 papers of " H. V. Jagadish " .
#
### SQL:
#
# SELECT t1.keyword FROM publication_keyword AS t5 JOIN keyword AS t1 ON t5.kid = t1.kid JOIN publication AS t3 ON t3.pid = t5.pid JOIN writes AS t4 ON t4.pid = t3.pid JOIN author AS t2 ON t4.aid = t2.aid WHERE t2.name = "H. V. Jagadish" GROUP BY t1.keyword HAVING COUNT ( DISTINCT t3.title ) > 10;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the authors who have more than 10 papers in the VLDB conference .
#
### SQL:
#
# SELECT t1.name FROM publication AS t4 JOIN conference AS t2 ON t4.cid = t2.cid JOIN writes AS t3 ON t3.pid = t4.pid JOIN author AS t1 ON t3.aid = t1.aid WHERE t2.name = "VLDB" GROUP BY t1.name HAVING COUNT ( DISTINCT t4.title ) > 10;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the author who has the most number of papers in the VLDB conference .
#
### SQL:
#
# SELECT t1.name FROM publication AS t4 JOIN conference AS t2 ON t4.cid = t2.cid JOIN writes AS t3 ON t3.pid = t4.pid JOIN author AS t1 ON t3.aid = t1.aid WHERE t2.name = "VLDB" GROUP BY t1.name ORDER BY COUNT ( DISTINCT t4.title ) DESC LIMIT 1;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the author in the " University of Michigan " whose papers have more than 5000 total citations .
#
### SQL:
#
# SELECT t1.name FROM organization AS t2 JOIN author AS t1 ON t2.oid = t1.oid JOIN writes AS t3 ON t3.aid = t1.aid JOIN publication AS t4 ON t3.pid = t4.pid WHERE t2.name = "University of Michigan" GROUP BY t1.name HAVING SUM ( t4.citation_num ) > 5000;
#
### End.
|
academic
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# domain_author.did can be joined with domain.did
# domain_author.aid can be joined with author.aid
# domain_conference.did can be joined with domain.did
# domain_conference.cid can be joined with conference.cid
# domain_journal.did can be joined with domain.did
# domain_journal.jid can be joined with journal.jid
# domain_keyword.did can be joined with domain.did
# domain_keyword.kid can be joined with keyword.kid
# publication.cid can be joined with conference.cid
# publication.jid can be joined with journal.jid
# domain_publication.did can be joined with domain.did
# domain_publication.pid can be joined with publication.pid
# publication_keyword.kid can be joined with keyword.kid
# publication_keyword.pid can be joined with publication.pid
# writes.aid can be joined with author.aid
# writes.pid can be joined with publication.pid
# cite.citing can be joined with publication.pid
# cite.cited can be joined with publication.pid
#
### Question:
#
# return me the author in the " University of Michigan " in Databases area whose papers have more than 5000 total citations .
#
### SQL:
#
# SELECT t1.name FROM domain_author AS t6 JOIN author AS t1 ON t6.aid = t1.aid JOIN DOMAIN AS t3 ON t3.did = t6.did JOIN organization AS t5 ON t5.oid = t1.oid JOIN writes AS t2 ON t2.aid = t1.aid JOIN publication AS t4 ON t2.pid = t4.pid WHERE t3.name = "Databases" AND t5.name = "University of Michigan" GROUP BY t1.name HAVING SUM ( t4.citation_num ) > 5000;
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What year is the movie " The Imitation Game " from ?
#
### SQL:
#
# SELECT release_year FROM movie WHERE title = "The Imitation Game";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What year was the movie " The Imitation Game " produced
#
### SQL:
#
# SELECT release_year FROM movie WHERE title = "The Imitation Game";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What year was " Benedict Cumberbatch " born ?
#
### SQL:
#
# SELECT birth_year FROM actor WHERE name = "Benedict Cumberbatch";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# In what year was " Benedict Cumberbatch " born
#
### SQL:
#
# SELECT birth_year FROM actor WHERE name = "Benedict Cumberbatch";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What is the nationality of the actress " Christoph Waltz " ?
#
### SQL:
#
# SELECT nationality FROM actor WHERE name = "Christoph Waltz";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What is the nationality of the actor " Christoph Waltz " ?
#
### SQL:
#
# SELECT nationality FROM actor WHERE name = "Christoph Waltz";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all movies produced in 2015
#
### SQL:
#
# SELECT title FROM movie WHERE release_year = 2015;
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all actors born in " Tehran "
#
### SQL:
#
# SELECT name FROM actor WHERE birth_city = "Tehran";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all actors born in Tehran
#
### SQL:
#
# SELECT name FROM actor WHERE birth_city = "Tehran";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Which actors were born in Tehran
#
### SQL:
#
# SELECT name FROM actor WHERE birth_city = "Tehran";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all actors who are from Afghanistan
#
### SQL:
#
# SELECT name FROM actor WHERE nationality = "Afghanistan";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all actors from Afghanistan
#
### SQL:
#
# SELECT name FROM actor WHERE nationality = "Afghanistan";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Give me the name of all the actors from Afghanistan
#
### SQL:
#
# SELECT name FROM actor WHERE nationality = "Afghanistan";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all actors who were born in 1984
#
### SQL:
#
# SELECT name FROM actor WHERE birth_year = 1984;
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# When was " Kevin Spacey " born ?
#
### SQL:
#
# SELECT birth_year FROM actor WHERE name = "actor_name0";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# In what year was " Kevin Spacey " born ?
#
### SQL:
#
# SELECT birth_year FROM actor WHERE name = "actor_name0";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Where is the birth place of " Kevin Spacey "
#
### SQL:
#
# SELECT birth_city FROM director WHERE name = "director_name0";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# In what city was " Kevin Spacey " born ?
#
### SQL:
#
# SELECT birth_city FROM director WHERE name = "director_name0";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What is the nationality of " Kevin Spacey " ?
#
### SQL:
#
# SELECT nationality FROM director WHERE name = "director_name0";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# How much was the budget of " Finding Nemo "
#
### SQL:
#
# SELECT budget FROM movie WHERE title = "Finding Nemo";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all movies directed by " Steven Spielberg " after 2006
#
### SQL:
#
# SELECT t3.title FROM director AS t2 JOIN directed_by AS t1 ON t2.did = t1.did JOIN movie AS t3 ON t3.mid = t1.msid WHERE t2.name = "Steven Spielberg" AND t3.release_year > 2006;
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Who is the director of the movie " James Bond " ?
#
### SQL:
#
# SELECT t2.name FROM director AS t2 JOIN directed_by AS t1 ON t2.did = t1.did JOIN movie AS t3 ON t3.mid = t1.msid WHERE t3.title = "James Bond";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Who directed the movie " James Bond " ?
#
### SQL:
#
# SELECT t2.name FROM director AS t2 JOIN directed_by AS t1 ON t2.did = t1.did JOIN movie AS t3 ON t3.mid = t1.msid WHERE t3.title = "James Bond";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# List " James Bond " directors
#
### SQL:
#
# SELECT t2.name FROM director AS t2 JOIN directed_by AS t1 ON t2.did = t1.did JOIN movie AS t3 ON t3.mid = t1.msid WHERE t3.title = "James Bond";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find the actor who played " Alan Turing " in the movie " The Imitation Game "
#
### SQL:
#
# SELECT t1.name FROM CAST AS t2 JOIN actor AS t1 ON t2.aid = t1.aid JOIN movie AS t3 ON t3.mid = t2.msid WHERE t2.role = "Alan Turing" AND t3.title = "The Imitation Game";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Who acted " Alan Turing " in the movie " The Imitation Game " ?
#
### SQL:
#
# SELECT t1.name FROM CAST AS t2 JOIN actor AS t1 ON t2.aid = t1.aid JOIN movie AS t3 ON t3.mid = t2.msid WHERE t2.role = "Alan Turing" AND t3.title = "The Imitation Game";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Who was the actor that played " Alan Turing " in the movie " The Imitation Game " ?
#
### SQL:
#
# SELECT t1.name FROM CAST AS t2 JOIN actor AS t1 ON t2.aid = t1.aid JOIN movie AS t3 ON t3.mid = t2.msid WHERE t2.role = "Alan Turing" AND t3.title = "The Imitation Game";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Who acts as " Alan Turing " in the movie " The Imitation Game " ?
#
### SQL:
#
# SELECT t1.name FROM CAST AS t2 JOIN actor AS t1 ON t2.aid = t1.aid JOIN movie AS t3 ON t3.mid = t2.msid WHERE t2.role = "Alan Turing" AND t3.title = "The Imitation Game";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Who is the actor playing " Alan Turing " in " The Imitation Game " ?
#
### SQL:
#
# SELECT t1.name FROM CAST AS t2 JOIN actor AS t1 ON t2.aid = t1.aid JOIN movie AS t3 ON t3.mid = t2.msid WHERE t2.role = "Alan Turing" AND t3.title = "The Imitation Game";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What is the genre of the movie " Jurassic Park " ?
#
### SQL:
#
# SELECT t2.genre FROM genre AS t2 JOIN classification AS t1 ON t2.gid = t1.gid JOIN movie AS t3 ON t3.mid = t1.msid WHERE t3.title = "Jurassic Park";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Who was the director of the movie Joy from 2015 ?
#
### SQL:
#
# SELECT t2.name FROM director AS t2 JOIN directed_by AS t1 ON t2.did = t1.did JOIN movie AS t3 ON t3.mid = t1.msid WHERE t3.release_year = 2015 AND t3.title = "Joy";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all movies written by " Matt Damon "
#
### SQL:
#
# SELECT t1.title FROM written_by AS t3 JOIN movie AS t1 ON t3.msid = t1.mid JOIN writer AS t2 ON t3.wid = t2.wid WHERE t2.name = "Matt Damon";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all movies written and produced by " Woody Allen "
#
### SQL:
#
# SELECT t2.title FROM movie AS t2 JOIN made_by AS t3 ON t2.mid = t3.msid JOIN producer AS t1 ON t1.pid = t3.pid JOIN written_by AS t5 ON t5.msid = t2.mid JOIN writer AS t4 ON t5.wid = t4.wid WHERE t1.name = "Woody Allen" AND t4.name = "Woody Allen";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all movies featuring " Robin Wright "
#
### SQL:
#
# SELECT t2.title FROM CAST AS t3 JOIN actor AS t1 ON t3.aid = t1.aid JOIN movie AS t2 ON t2.mid = t3.msid WHERE t1.name = "Robin Wright";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What are all the movies featuring " Robin Wright " ?
#
### SQL:
#
# SELECT t2.title FROM CAST AS t3 JOIN actor AS t1 ON t3.aid = t1.aid JOIN movie AS t2 ON t2.mid = t3.msid WHERE t1.name = "Robin Wright";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all movies in which " Robin Wright " appears
#
### SQL:
#
# SELECT t2.title FROM CAST AS t3 JOIN actor AS t1 ON t3.aid = t1.aid JOIN movie AS t2 ON t2.mid = t3.msid WHERE t1.name = "Robin Wright";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What was the budget of the movie Juno from 2007 ?
#
### SQL:
#
# SELECT budget FROM movie WHERE release_year = 2007 AND title = "Juno";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all Sci-Fi produced in year 2010
#
### SQL:
#
# SELECT t3.title FROM genre AS t2 JOIN classification AS t1 ON t2.gid = t1.gid JOIN movie AS t3 ON t3.mid = t1.msid WHERE t2.genre = "Sci-Fi" AND t3.release_year = 2010;
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# List all the Sci-Fi movies which released in 2010
#
### SQL:
#
# SELECT t3.title FROM genre AS t2 JOIN classification AS t1 ON t2.gid = t1.gid JOIN movie AS t3 ON t3.mid = t1.msid WHERE t2.genre = "Sci-Fi" AND t3.release_year = 2010;
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all actors born in " Austin " after 1980
#
### SQL:
#
# SELECT name FROM actor WHERE birth_city = "Austin" AND birth_year > 1980;
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Who are the actors born in " Austin " after 1980 ?
#
### SQL:
#
# SELECT name FROM actor WHERE birth_city = "Austin" AND birth_year > 1980;
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all actors from Austin born after 1980
#
### SQL:
#
# SELECT name FROM actor WHERE birth_city = "Austin" AND birth_year > 1980;
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all movies by directors born in " Los Angeles "
#
### SQL:
#
# SELECT t3.title FROM director AS t2 JOIN directed_by AS t1 ON t2.did = t1.did JOIN movie AS t3 ON t3.mid = t1.msid WHERE t2.birth_city = "Los Angeles";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all actors who were born in " New York City " in 1984
#
### SQL:
#
# SELECT name FROM actor WHERE birth_city = "New York City" AND birth_year = 1984;
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all movies about nuclear weapons
#
### SQL:
#
# SELECT t3.title FROM tags AS t2 JOIN keyword AS t1 ON t2.kid = t1.id JOIN movie AS t3 ON t2.msid = t3.mid WHERE t1.keyword = "nuclear weapons";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What are the movies related to nuclear weapons
#
### SQL:
#
# SELECT t3.title FROM tags AS t2 JOIN keyword AS t1 ON t2.kid = t1.id JOIN movie AS t3 ON t2.msid = t3.mid WHERE t1.keyword = "nuclear weapons";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Which movies did " Alfred Hitchcock " direct ?
#
### SQL:
#
# SELECT t3.title FROM director AS t2 JOIN directed_by AS t1 ON t2.did = t1.did JOIN movie AS t3 ON t3.mid = t1.msid WHERE t2.name = "Alfred Hitchcock";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all movies directed by " Asghar Farhadi " and featuring " Taraneh Alidoosti "
#
### SQL:
#
# SELECT t4.title FROM CAST AS t5 JOIN actor AS t1 ON t5.aid = t1.aid JOIN movie AS t4 ON t4.mid = t5.msid JOIN directed_by AS t2 ON t4.mid = t2.msid JOIN director AS t3 ON t3.did = t2.did WHERE t1.name = "Taraneh Alidoosti" AND t3.name = "Asghar Farhadi";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What are all the movies directed by " Asghar Farhadi " featuring " Taraneh Alidoosti " ?
#
### SQL:
#
# SELECT t4.title FROM CAST AS t5 JOIN actor AS t1 ON t5.aid = t1.aid JOIN movie AS t4 ON t4.mid = t5.msid JOIN directed_by AS t2 ON t4.mid = t2.msid JOIN director AS t3 ON t3.did = t2.did WHERE t1.name = "Taraneh Alidoosti" AND t3.name = "Asghar Farhadi";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# How many movies are there that are directed by " Asghar Farhadi " and featuring " Taraneh Alidoosti " ?
#
### SQL:
#
# SELECT t4.title FROM CAST AS t5 JOIN actor AS t1 ON t5.aid = t1.aid JOIN movie AS t4 ON t4.mid = t5.msid JOIN directed_by AS t2 ON t4.mid = t2.msid JOIN director AS t3 ON t3.did = t2.did WHERE t1.name = "Taraneh Alidoosti" AND t3.name = "Asghar Farhadi";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# List all the movies directed by " Asghar Farhadi " in which " Taraneh Alidoosti " played
#
### SQL:
#
# SELECT t4.title FROM CAST AS t5 JOIN actor AS t1 ON t5.aid = t1.aid JOIN movie AS t4 ON t4.mid = t5.msid JOIN directed_by AS t2 ON t4.mid = t2.msid JOIN director AS t3 ON t3.did = t2.did WHERE t1.name = "Taraneh Alidoosti" AND t3.name = "Asghar Farhadi";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What are all the tv series created by " Shonda Rhimes " ?
#
### SQL:
#
# SELECT t2.title FROM producer AS t1 JOIN made_by AS t3 ON t1.pid = t3.pid JOIN tv_series AS t2 ON t2.sid = t3.msid WHERE t1.name = "Shonda Rhimes";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Who acts " Olivia Pope " in the series Scandal ?
#
### SQL:
#
# SELECT t1.name FROM CAST AS t3 JOIN actor AS t1 ON t3.aid = t1.aid JOIN tv_series AS t2 ON t2.sid = t3.msid WHERE t3.role = "Olivia Pope" AND t2.title = "Scandal";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Who is the writer of the movie " The Truman Show "
#
### SQL:
#
# SELECT t2.name FROM written_by AS t3 JOIN movie AS t1 ON t3.msid = t1.mid JOIN writer AS t2 ON t3.wid = t2.wid WHERE t1.title = "The Truman Show";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Who is the writer of " The Truman Show "
#
### SQL:
#
# SELECT t2.name FROM written_by AS t3 JOIN movie AS t1 ON t3.msid = t1.mid JOIN writer AS t2 ON t3.wid = t2.wid WHERE t1.title = "The Truman Show";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What are the series featuring " Scott Foley " ?
#
### SQL:
#
# SELECT t2.title FROM CAST AS t3 JOIN actor AS t1 ON t3.aid = t1.aid JOIN tv_series AS t2 ON t2.sid = t3.msid WHERE t1.name = "Scott Foley";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What are the series in which " Scott Foley " is an actor ?
#
### SQL:
#
# SELECT t2.title FROM CAST AS t3 JOIN actor AS t1 ON t3.aid = t1.aid JOIN tv_series AS t2 ON t2.sid = t3.msid WHERE t1.name = "Scott Foley";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find the directors of all movies featuring " Kate Winslet "
#
### SQL:
#
# SELECT t3.name FROM CAST AS t4 JOIN actor AS t1 ON t4.aid = t1.aid JOIN movie AS t5 ON t5.mid = t4.msid JOIN directed_by AS t2 ON t5.mid = t2.msid JOIN director AS t3 ON t3.did = t2.did WHERE t1.name = "Kate Winslet";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find the producers of all movies in which " Kate Winslet " is an actor
#
### SQL:
#
# SELECT t1.name FROM CAST AS t3 JOIN actor AS t2 ON t3.aid = t2.aid JOIN movie AS t5 ON t5.mid = t3.msid JOIN made_by AS t4 ON t5.mid = t4.msid JOIN producer AS t1 ON t1.pid = t4.pid WHERE t2.name = "Kate Winslet";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Who is the director of the tv series " House of Cards " from 2013 ?
#
### SQL:
#
# SELECT t2.name FROM director AS t2 JOIN directed_by AS t1 ON t2.did = t1.did JOIN tv_series AS t3 ON t3.sid = t1.msid WHERE t3.release_year = 2013 AND t3.title = "House of Cards";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all the female actors from Austin
#
### SQL:
#
# SELECT name FROM actor WHERE birth_city = "Austin" AND gender = "female";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all actors from Italy born after 1980
#
### SQL:
#
# SELECT name FROM actor WHERE birth_year > 1980 AND nationality = "Italy";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all the female actors born in " New York City " after 1980
#
### SQL:
#
# SELECT name FROM actor WHERE birth_city = "New York City" AND birth_year > 1980 AND gender = "female";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all the female actors in the movie " Saving Private Ryan "
#
### SQL:
#
# SELECT t1.name FROM CAST AS t2 JOIN actor AS t1 ON t2.aid = t1.aid JOIN movie AS t3 ON t3.mid = t2.msid WHERE t1.gender = "female" AND t3.title = "Saving Private Ryan";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all the directors who are from Afghanistan
#
### SQL:
#
# SELECT name FROM director WHERE nationality = "Afghanistan";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find the actors who played in the movie " Camp X-Ray "
#
### SQL:
#
# SELECT t1.name FROM CAST AS t2 JOIN actor AS t1 ON t2.aid = t1.aid JOIN movie AS t3 ON t3.mid = t2.msid WHERE t3.title = "Camp X-Ray";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Find all actors from Canada who acted in " James Bond " movies
#
### SQL:
#
# SELECT t1.name FROM CAST AS t2 JOIN actor AS t1 ON t2.aid = t1.aid JOIN movie AS t3 ON t3.mid = t2.msid WHERE t1.nationality = "Canada" AND t3.title = "James Bond";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# find all films in which " Rowan Atkinson " acted as " Mr. Bean "
#
### SQL:
#
# SELECT t2.title FROM CAST AS t3 JOIN actor AS t1 ON t3.aid = t1.aid JOIN movie AS t2 ON t2.mid = t3.msid WHERE t1.name = "Rowan Atkinson" AND t3.role = "Mr. Bean";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# where is the director of " The Past " from
#
### SQL:
#
# SELECT t2.birth_city FROM director AS t2 JOIN directed_by AS t1 ON t2.did = t1.did JOIN movie AS t3 ON t3.mid = t1.msid WHERE t3.title = "The Past";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# who acted the role of " Mr. Bean "
#
### SQL:
#
# SELECT t1.name FROM CAST AS t2 JOIN actor AS t1 ON t2.aid = t1.aid WHERE t2.role = "Mr. Bean";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# what are the genres of movies directed by " Asghar Farhadi "
#
### SQL:
#
# SELECT t3.genre FROM director AS t5 JOIN directed_by AS t2 ON t5.did = t2.did JOIN movie AS t4 ON t4.mid = t2.msid JOIN classification AS t1 ON t4.mid = t1.msid JOIN genre AS t3 ON t3.gid = t1.gid WHERE t5.name = "Asghar Farhadi";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# Which movie had the character " Daffy Duck "
#
### SQL:
#
# SELECT t1.title FROM movie AS t1 JOIN CAST AS t2 ON t1.mid = t2.msid WHERE t2.role = "Daffy Duck";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What are the major roles in the movie " Daddy Long Legs "
#
### SQL:
#
# SELECT t2.role FROM CAST AS t2 JOIN actor AS t1 ON t2.aid = t1.aid JOIN movie AS t3 ON t3.mid = t2.msid WHERE t3.title = "Daddy Long Legs";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# List all the directors of movies about nuclear weapons
#
### SQL:
#
# SELECT t3.name FROM director AS t3 JOIN directed_by AS t2 ON t3.did = t2.did JOIN movie AS t4 ON t4.mid = t2.msid JOIN tags AS t5 ON t5.msid = t4.mid JOIN keyword AS t1 ON t5.kid = t1.id WHERE t1.keyword = "nuclear weapons";
#
### End.
|
imdb
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# actor ( aid, gender, name, nationality, birth_city, birth_year )
# copyright ( id, msid, cid )
# cast ( id, msid, aid, role )
# genre ( gid, genre )
# classification ( id, msid, gid )
# company ( id, name, country_code )
# director ( did, gender, name, nationality, birth_city, birth_year )
# producer ( pid, gender, name, nationality, birth_city, birth_year )
# directed_by ( id, msid, did )
# keyword ( id, keyword )
# made_by ( id, msid, pid )
# movie ( mid, title, release_year, title_aka, budget )
# tags ( id, msid, kid )
# tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget )
# writer ( wid, gender, name, nationality, num_of_episodes, birth_city, birth_year )
# written_by ( id, msid, wid )
#
# cast.msid can be joined with copyright.msid
# cast.aid can be joined with actor.aid
# classification.msid can be joined with copyright.msid
# classification.gid can be joined with genre.gid
# directed_by.did can be joined with director.did
# directed_by.msid can be joined with copyright.msid
# made_by.pid can be joined with producer.pid
# made_by.msid can be joined with copyright.msid
# tags.msid can be joined with copyright.msid
# written_by.wid can be joined with writer.wid
# written_by.msid can be joined with copyright.msid
#
### Question:
#
# What is the number of movies in which " Jennifer Aniston " acted after 2010 ?
#
### SQL:
#
# SELECT COUNT ( DISTINCT t2.title ) FROM CAST AS t3 JOIN actor AS t1 ON t3.aid = t1.aid JOIN movie AS t2 ON t2.mid = t3.msid WHERE t1.name = "Jennifer Aniston" AND t2.release_year > 2010;
#
### End.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.