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】
    How many 35-year-old female users gave the movie 1711133 a rating of 3? Female users mean that u_gender = 'F'

    【Evidence】
    Female users mean that u_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(T1.userid) FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid WHERE T2.rating = 3 AND T2.movieid = '1711133' AND T1.age = 35 AND T1.u_gender = 'F'
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 users have rated 1 each for the UK's second newest movies with a running time of 2? second newest movies refers to year = 2 since year in this database is a relative value, less is the newer

    【Evidence】
    second newest movies refers to year = 2 since year in this database is a relative value, less is the newer

    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.userid) FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'UK' AND T1.runningtime = 2 AND T2.rating = 1 AND T1.year = 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】
    How many unique directors with an average earnings of 2 and a quality of 3 have not made comedy films? List them.

    【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.directorid FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.d_quality = 3 AND T1.avg_revenue = 2 AND T2.genre != 'Comedy'
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】
    Calculate the percentage of female actors and quality 2 who have appeared twice at the casting of the film 1672580. Female actors mean that a_gender = 'F'; percentage can be computed by [cast_num = 2 AND a_quality = 2 in female) / (all female actors)] * 100%

    【Evidence】
    Female actors mean that a_gender = 'F'; percentage can be computed by [cast_num = 2 AND a_quality = 2 in female) / (all female actors)] * 100%

    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(T2.cast_num = 2 AND T1.a_quality = 2, 1, 0)) AS REAL) * 100 / COUNT(T1.actorid) FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid WHERE T2.movieid = 1672580 AND T1.a_gender = 'F'
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 of the worst actors are men and how many of the worst actors are women? Indicate your answer in ratio form. The worst actors means a_quality = 0; Men and male share the same meaning; men actors refers to a_gender = 'M'

    【Evidence】
    The worst actors means a_quality = 0; Men and male share the same meaning; men actors refers to a_gender = 'M'

    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(a_gender = 'M', 1, 0)) AS REAL) / SUM(IIF(a_gender = 'F', 1, 0)) FROM actors WHERE a_quality = 0
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 actor has appeared in the most films?

    【Evidence】
    

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

SQL: SELECT actorid FROM movies2actors GROUP BY actorid ORDER BY COUNT(movieid) 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】
    What is the most popular genre of film directed by directors? Most popular genre indicates that the genre has the most number of movies

    【Evidence】
    Most popular genre indicates that the genre has the most number of movies

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

SQL: SELECT genre FROM movies2directors GROUP BY genre ORDER BY COUNT(movieid) 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】
    What are the most common film genres made by the worst directors? d_quality = 5 refers to the best directors, d_quality = 0 refers to the worst directors

    【Evidence】
    d_quality = 5 refers to the best directors, d_quality = 0 refers to the worst directors

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

SQL: SELECT T2.genre FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.d_quality = 0 GROUP BY T2.genre ORDER BY COUNT(T2.movieid) 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】
    What non-English American film/s has received the lowest user ratings? Mention the movie's I.D. USA is a country; non-English means isEnglish = 'F'

    【Evidence】
    USA is a country; non-English means isEnglish = 'F'

    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 movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid WHERE T1.isEnglish = 'F' AND T1.country = 'USA' ORDER BY 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 is the total average movie directed by the directors who's quality and revenue is 4?

    【Evidence】
    

    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(CASE WHEN T1.d_quality = 4 AND T1.avg_revenue = 4 THEN 1 ELSE 0 END) AS REAL) / COUNT(T2.movieid) FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid