QIAN-ME/bird_schema_data huggingface dataset:
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 movielens
【Schema】
# Table: movies2actors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(actorid:INTEGER, Primary Key, Examples: [88796, 88848, 121878]),
(cast_num:INTEGER, Examples: [0, 1, 2])
]
# Table: users
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(age:TEXT, Examples: [1, 56, 25]),
(u_gender:TEXT, Examples: [F, M]),
(occupation:TEXT, Examples: [2, 3, 4])
]
# Table: directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(avg_revenue:INTEGER, Examples: [0, 1, 2])
]
# Table: movies
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(year:INTEGER, Examples: [3, 4, 1]),
(isEnglish:TEXT, Examples: [T, F]),
(country:TEXT, Examples: [other, USA, France]),
(runningtime:INTEGER, Examples: [2, 3, 0])
]
# Table: movies2directors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(directorid:INTEGER, Primary Key, Examples: [22397, 54934, 297253]),
(genre:TEXT, Examples: [Action, Adventure, Animation])
]
# Table: u2base
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(movieid:INTEGER, Primary Key, Examples: [1684486, 1685309, 1685493]),
(rating:TEXT, Examples: [1, 2, 3])
]
# Table: actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
【Foreign keys】
movies2actors.actorid=actors.actorid
movies2actors.movieid=movies.movieid
movies2directors.directorid=directors.directorid
movies2directors.movieid=movies.movieid
u2base.movieid=movies.movieid
u2base.userid=users.userid

    【Question】
    What's different average revenue status for director who directed the movie that got the most 1 ratings?

    【Evidence】
    

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT DISTINCT T1.avg_revenue FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.d_quality = 5
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 movielens
【Schema】
# Table: movies2actors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(actorid:INTEGER, Primary Key, Examples: [88796, 88848, 121878]),
(cast_num:INTEGER, Examples: [0, 1, 2])
]
# Table: users
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(age:TEXT, Examples: [1, 56, 25]),
(u_gender:TEXT, Examples: [F, M]),
(occupation:TEXT, Examples: [2, 3, 4])
]
# Table: directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(avg_revenue:INTEGER, Examples: [0, 1, 2])
]
# Table: movies
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(year:INTEGER, Examples: [3, 4, 1]),
(isEnglish:TEXT, Examples: [T, F]),
(country:TEXT, Examples: [other, USA, France]),
(runningtime:INTEGER, Examples: [2, 3, 0])
]
# Table: movies2directors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(directorid:INTEGER, Primary Key, Examples: [22397, 54934, 297253]),
(genre:TEXT, Examples: [Action, Adventure, Animation])
]
# Table: u2base
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(movieid:INTEGER, Primary Key, Examples: [1684486, 1685309, 1685493]),
(rating:TEXT, Examples: [1, 2, 3])
]
# Table: actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
【Foreign keys】
movies2actors.actorid=actors.actorid
movies2actors.movieid=movies.movieid
movies2directors.directorid=directors.directorid
movies2directors.movieid=movies.movieid
u2base.movieid=movies.movieid
u2base.userid=users.userid

    【Question】
    How many French movies got the highest ranking? France is a country

    【Evidence】
    France is a country

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(movieid) FROM movies WHERE country = 'France' AND movieid IN ( SELECT movieid FROM u2base WHERE rating = ( SELECT MAX(rating) FROM u2base ) )
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 movielens
【Schema】
# Table: movies2actors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(actorid:INTEGER, Primary Key, Examples: [88796, 88848, 121878]),
(cast_num:INTEGER, Examples: [0, 1, 2])
]
# Table: users
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(age:TEXT, Examples: [1, 56, 25]),
(u_gender:TEXT, Examples: [F, M]),
(occupation:TEXT, Examples: [2, 3, 4])
]
# Table: directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(avg_revenue:INTEGER, Examples: [0, 1, 2])
]
# Table: movies
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(year:INTEGER, Examples: [3, 4, 1]),
(isEnglish:TEXT, Examples: [T, F]),
(country:TEXT, Examples: [other, USA, France]),
(runningtime:INTEGER, Examples: [2, 3, 0])
]
# Table: movies2directors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(directorid:INTEGER, Primary Key, Examples: [22397, 54934, 297253]),
(genre:TEXT, Examples: [Action, Adventure, Animation])
]
# Table: u2base
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(movieid:INTEGER, Primary Key, Examples: [1684486, 1685309, 1685493]),
(rating:TEXT, Examples: [1, 2, 3])
]
# Table: actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
【Foreign keys】
movies2actors.actorid=actors.actorid
movies2actors.movieid=movies.movieid
movies2directors.directorid=directors.directorid
movies2directors.movieid=movies.movieid
u2base.movieid=movies.movieid
u2base.userid=users.userid

    【Question】
    List the movie that has been rated most by 25 years old users.

    【Evidence】
    

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT T2.movieid FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid WHERE T1.age = 25 GROUP BY T2.movieid ORDER BY COUNT(T1.userid) DESC LIMIT 1
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 movielens
【Schema】
# Table: movies2actors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(actorid:INTEGER, Primary Key, Examples: [88796, 88848, 121878]),
(cast_num:INTEGER, Examples: [0, 1, 2])
]
# Table: users
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(age:TEXT, Examples: [1, 56, 25]),
(u_gender:TEXT, Examples: [F, M]),
(occupation:TEXT, Examples: [2, 3, 4])
]
# Table: directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(avg_revenue:INTEGER, Examples: [0, 1, 2])
]
# Table: movies
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(year:INTEGER, Examples: [3, 4, 1]),
(isEnglish:TEXT, Examples: [T, F]),
(country:TEXT, Examples: [other, USA, France]),
(runningtime:INTEGER, Examples: [2, 3, 0])
]
# Table: movies2directors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(directorid:INTEGER, Primary Key, Examples: [22397, 54934, 297253]),
(genre:TEXT, Examples: [Action, Adventure, Animation])
]
# Table: u2base
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(movieid:INTEGER, Primary Key, Examples: [1684486, 1685309, 1685493]),
(rating:TEXT, Examples: [1, 2, 3])
]
# Table: actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
【Foreign keys】
movies2actors.actorid=actors.actorid
movies2actors.movieid=movies.movieid
movies2directors.directorid=directors.directorid
movies2directors.movieid=movies.movieid
u2base.movieid=movies.movieid
u2base.userid=users.userid

    【Question】
    How many separate 35 year-old uesers have rated the movie from UK? UK is a country

    【Evidence】
    UK is a country

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(DISTINCT T2.userid) FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid INNER JOIN users AS T3 ON T2.userid = T3.userid WHERE T1.country = 'UK' AND T3.age = 35
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 movielens
【Schema】
# Table: movies2actors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(actorid:INTEGER, Primary Key, Examples: [88796, 88848, 121878]),
(cast_num:INTEGER, Examples: [0, 1, 2])
]
# Table: users
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(age:TEXT, Examples: [1, 56, 25]),
(u_gender:TEXT, Examples: [F, M]),
(occupation:TEXT, Examples: [2, 3, 4])
]
# Table: directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(avg_revenue:INTEGER, Examples: [0, 1, 2])
]
# Table: movies
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(year:INTEGER, Examples: [3, 4, 1]),
(isEnglish:TEXT, Examples: [T, F]),
(country:TEXT, Examples: [other, USA, France]),
(runningtime:INTEGER, Examples: [2, 3, 0])
]
# Table: movies2directors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(directorid:INTEGER, Primary Key, Examples: [22397, 54934, 297253]),
(genre:TEXT, Examples: [Action, Adventure, Animation])
]
# Table: u2base
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(movieid:INTEGER, Primary Key, Examples: [1684486, 1685309, 1685493]),
(rating:TEXT, Examples: [1, 2, 3])
]
# Table: actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
【Foreign keys】
movies2actors.actorid=actors.actorid
movies2actors.movieid=movies.movieid
movies2directors.directorid=directors.directorid
movies2directors.movieid=movies.movieid
u2base.movieid=movies.movieid
u2base.userid=users.userid

    【Question】
    List the user ids and ages who gave the rate 2 to the movie No. 2409051.

    【Evidence】
    

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT T1.userid, T1.age FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid WHERE T2.movieid = '2409051' AND T2.rating = 2
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 movielens
【Schema】
# Table: movies2actors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(actorid:INTEGER, Primary Key, Examples: [88796, 88848, 121878]),
(cast_num:INTEGER, Examples: [0, 1, 2])
]
# Table: users
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(age:TEXT, Examples: [1, 56, 25]),
(u_gender:TEXT, Examples: [F, M]),
(occupation:TEXT, Examples: [2, 3, 4])
]
# Table: directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(avg_revenue:INTEGER, Examples: [0, 1, 2])
]
# Table: movies
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(year:INTEGER, Examples: [3, 4, 1]),
(isEnglish:TEXT, Examples: [T, F]),
(country:TEXT, Examples: [other, USA, France]),
(runningtime:INTEGER, Examples: [2, 3, 0])
]
# Table: movies2directors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(directorid:INTEGER, Primary Key, Examples: [22397, 54934, 297253]),
(genre:TEXT, Examples: [Action, Adventure, Animation])
]
# Table: u2base
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(movieid:INTEGER, Primary Key, Examples: [1684486, 1685309, 1685493]),
(rating:TEXT, Examples: [1, 2, 3])
]
# Table: actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
【Foreign keys】
movies2actors.actorid=actors.actorid
movies2actors.movieid=movies.movieid
movies2directors.directorid=directors.directorid
movies2directors.movieid=movies.movieid
u2base.movieid=movies.movieid
u2base.userid=users.userid

    【Question】
    Please give the ids of the oldest films that got the most ratings. Films and movies share the same meaning; oldest film refers to the movie with year = 1

    【Evidence】
    Films and movies share the same meaning; oldest film refers to the movie with year = 1

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT DISTINCT T1.movieid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T1.rating = 5 AND T2.year = 1
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 movielens
【Schema】
# Table: movies2actors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(actorid:INTEGER, Primary Key, Examples: [88796, 88848, 121878]),
(cast_num:INTEGER, Examples: [0, 1, 2])
]
# Table: users
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(age:TEXT, Examples: [1, 56, 25]),
(u_gender:TEXT, Examples: [F, M]),
(occupation:TEXT, Examples: [2, 3, 4])
]
# Table: directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(avg_revenue:INTEGER, Examples: [0, 1, 2])
]
# Table: movies
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(year:INTEGER, Examples: [3, 4, 1]),
(isEnglish:TEXT, Examples: [T, F]),
(country:TEXT, Examples: [other, USA, France]),
(runningtime:INTEGER, Examples: [2, 3, 0])
]
# Table: movies2directors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(directorid:INTEGER, Primary Key, Examples: [22397, 54934, 297253]),
(genre:TEXT, Examples: [Action, Adventure, Animation])
]
# Table: u2base
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(movieid:INTEGER, Primary Key, Examples: [1684486, 1685309, 1685493]),
(rating:TEXT, Examples: [1, 2, 3])
]
# Table: actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
【Foreign keys】
movies2actors.actorid=actors.actorid
movies2actors.movieid=movies.movieid
movies2directors.directorid=directors.directorid
movies2directors.movieid=movies.movieid
u2base.movieid=movies.movieid
u2base.userid=users.userid

    【Question】
    Which different movies from France got the least ratings? France is a country

    【Evidence】
    France is a country

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT DISTINCT T1.movieid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'France' AND T1.rating = 1
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 movielens
【Schema】
# Table: movies2actors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(actorid:INTEGER, Primary Key, Examples: [88796, 88848, 121878]),
(cast_num:INTEGER, Examples: [0, 1, 2])
]
# Table: users
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(age:TEXT, Examples: [1, 56, 25]),
(u_gender:TEXT, Examples: [F, M]),
(occupation:TEXT, Examples: [2, 3, 4])
]
# Table: directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(avg_revenue:INTEGER, Examples: [0, 1, 2])
]
# Table: movies
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(year:INTEGER, Examples: [3, 4, 1]),
(isEnglish:TEXT, Examples: [T, F]),
(country:TEXT, Examples: [other, USA, France]),
(runningtime:INTEGER, Examples: [2, 3, 0])
]
# Table: movies2directors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(directorid:INTEGER, Primary Key, Examples: [22397, 54934, 297253]),
(genre:TEXT, Examples: [Action, Adventure, Animation])
]
# Table: u2base
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(movieid:INTEGER, Primary Key, Examples: [1684486, 1685309, 1685493]),
(rating:TEXT, Examples: [1, 2, 3])
]
# Table: actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
【Foreign keys】
movies2actors.actorid=actors.actorid
movies2actors.movieid=movies.movieid
movies2directors.directorid=directors.directorid
movies2directors.movieid=movies.movieid
u2base.movieid=movies.movieid
u2base.userid=users.userid

    【Question】
    How many female actors have been played a role in any of French or USA movies? French and USA are two countries; Female actors mean that a_gender = 'F'

    【Evidence】
    French and USA are two countries; Female actors mean that a_gender = 'F'

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(T2.actorid) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.country IN ('France', 'USA')
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 movielens
【Schema】
# Table: movies2actors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(actorid:INTEGER, Primary Key, Examples: [88796, 88848, 121878]),
(cast_num:INTEGER, Examples: [0, 1, 2])
]
# Table: users
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(age:TEXT, Examples: [1, 56, 25]),
(u_gender:TEXT, Examples: [F, M]),
(occupation:TEXT, Examples: [2, 3, 4])
]
# Table: directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(avg_revenue:INTEGER, Examples: [0, 1, 2])
]
# Table: movies
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(year:INTEGER, Examples: [3, 4, 1]),
(isEnglish:TEXT, Examples: [T, F]),
(country:TEXT, Examples: [other, USA, France]),
(runningtime:INTEGER, Examples: [2, 3, 0])
]
# Table: movies2directors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(directorid:INTEGER, Primary Key, Examples: [22397, 54934, 297253]),
(genre:TEXT, Examples: [Action, Adventure, Animation])
]
# Table: u2base
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(movieid:INTEGER, Primary Key, Examples: [1684486, 1685309, 1685493]),
(rating:TEXT, Examples: [1, 2, 3])
]
# Table: actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
【Foreign keys】
movies2actors.actorid=actors.actorid
movies2actors.movieid=movies.movieid
movies2directors.directorid=directors.directorid
movies2directors.movieid=movies.movieid
u2base.movieid=movies.movieid
u2base.userid=users.userid

    【Question】
    How many different actors have played a role in the highest rating movie? highest rating of a movie is 5

    【Evidence】
    highest rating of a movie is 5

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(DISTINCT T2.actorid) FROM u2base AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.rating = 5
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 movielens
【Schema】
# Table: movies2actors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(actorid:INTEGER, Primary Key, Examples: [88796, 88848, 121878]),
(cast_num:INTEGER, Examples: [0, 1, 2])
]
# Table: users
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(age:TEXT, Examples: [1, 56, 25]),
(u_gender:TEXT, Examples: [F, M]),
(occupation:TEXT, Examples: [2, 3, 4])
]
# Table: directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(avg_revenue:INTEGER, Examples: [0, 1, 2])
]
# Table: movies
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(year:INTEGER, Examples: [3, 4, 1]),
(isEnglish:TEXT, Examples: [T, F]),
(country:TEXT, Examples: [other, USA, France]),
(runningtime:INTEGER, Examples: [2, 3, 0])
]
# Table: movies2directors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(directorid:INTEGER, Primary Key, Examples: [22397, 54934, 297253]),
(genre:TEXT, Examples: [Action, Adventure, Animation])
]
# Table: u2base
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(movieid:INTEGER, Primary Key, Examples: [1684486, 1685309, 1685493]),
(rating:TEXT, Examples: [1, 2, 3])
]
# Table: actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
【Foreign keys】
movies2actors.actorid=actors.actorid
movies2actors.movieid=movies.movieid
movies2directors.directorid=directors.directorid
movies2directors.movieid=movies.movieid
u2base.movieid=movies.movieid
u2base.userid=users.userid

    【Question】
    Which Crime film got the lowest average rating?

    【Evidence】
    

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT T2.movieid FROM u2base AS T2 INNER JOIN movies2directors AS T3 ON T2.movieid = T3.movieid WHERE T3.genre = 'Crime' GROUP BY T2.movieid ORDER BY AVG(T2.rating) LIMIT 1
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 movielens
【Schema】
# Table: movies2actors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(actorid:INTEGER, Primary Key, Examples: [88796, 88848, 121878]),
(cast_num:INTEGER, Examples: [0, 1, 2])
]
# Table: users
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(age:TEXT, Examples: [1, 56, 25]),
(u_gender:TEXT, Examples: [F, M]),
(occupation:TEXT, Examples: [2, 3, 4])
]
# Table: directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(avg_revenue:INTEGER, Examples: [0, 1, 2])
]
# Table: movies
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(year:INTEGER, Examples: [3, 4, 1]),
(isEnglish:TEXT, Examples: [T, F]),
(country:TEXT, Examples: [other, USA, France]),
(runningtime:INTEGER, Examples: [2, 3, 0])
]
# Table: movies2directors
[
(movieid:INTEGER, Primary Key, Examples: [1672052, 1672111, 1672580]),
(directorid:INTEGER, Primary Key, Examples: [22397, 54934, 297253]),
(genre:TEXT, Examples: [Action, Adventure, Animation])
]
# Table: u2base
[
(userid:INTEGER, Primary Key, Examples: [1, 2, 3]),
(movieid:INTEGER, Primary Key, Examples: [1684486, 1685309, 1685493]),
(rating:TEXT, Examples: [1, 2, 3])
]
# Table: actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
【Foreign keys】
movies2actors.actorid=actors.actorid
movies2actors.movieid=movies.movieid
movies2directors.directorid=directors.directorid
movies2directors.movieid=movies.movieid
u2base.movieid=movies.movieid
u2base.userid=users.userid

    【Question】
    What's the ratio of gender in actors to actress in all the UK movies? UK is a country; Male actors mean that a_gender = 'M'; Female actors mean that a_gender = 'F'; ratio; ratio of gender in actors = count(a_gender = 'M') / a_gender = 'F'

    【Evidence】
    UK is a country; Male actors mean that a_gender = 'M'; Female actors mean that a_gender = 'F'; ratio; ratio of gender in actors = count(a_gender = 'M') / a_gender = 'F'

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT CAST(SUM(IIF(T3.a_gender = 'M', 1, 0)) AS REAL) / SUM(IIF(T3.a_gender = 'F', 1, 0)) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T2.actorid = T3.actorid WHERE T1.country = 'UK'