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
find all films in which ' Rowan Atkinson ' acted as ' Mr. Bean '
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.name = 'Rowan Atkinson' AND t3.role = 'Mr. Bean';
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';
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
What year is the movie ' The Imitation Game ' from ?
assistant
SELECT release_year FROM movie WHERE title = 'The Imitation Game';
human
How many movies did ' Humphrey Bogart ' act in before 1942 ?
assistant
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 = 'Humphrey Bogart' AND t2.release_year < 1942;
human
Which movie had the character ' Daffy Duck
assistant
SELECT t1.title FROM movie AS t1 JOIN CAST AS t2 ON t1.mid = t2.msid WHERE t2.role = "Daffy Duck" ;