human
Schema:
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)
Please answer with SQL.
assistant
Sure, I understand.
human
which movie has the most number of actors from China ?
assistant
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.nationality = 'China' GROUP BY t2.title ORDER BY COUNT ( DISTINCT t1.name ) DESC LIMIT 1;
human
Find all actors who are from Afghanistan
assistant
SELECT name FROM actor WHERE nationality = 'Afghanistan';
human
Find all actors born in ' Tehran '
assistant
SELECT name FROM actor WHERE birth_city = 'Tehran';
human
Find all actors who acted in the same movie as ' Tom Hanks '
assistant
SELECT t1.name FROM CAST AS t4 JOIN actor AS t1 ON t4.aid = t1.aid JOIN movie AS t5 ON t5.mid = t4.msid JOIN CAST AS t3 ON t5.mid = t3.msid JOIN actor AS t2 ON t3.aid = t2.aid WHERE t2.name = 'Tom Hanks';
human
What is the latest movie by ' Jim Jarmusch '
assistant
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 = 'Jim Jarmusch' ORDER BY t3.release_year DESC LIMIT 1;
human
find the number of actors from Iran who played in ' Jim Jarmusch ' movies
assistant
SELECT COUNT( DISTINCT t1.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.nationality = "Iran" AND t3.name = "Jim Jarmusch" ;