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】 music_tracker
【Schema】
# Table: tags
[
(index:INTEGER, Primary Key, Examples: [0, 1, 2]),
(id:INTEGER, Examples: [0, 2, 3]),
(tag:TEXT, Examples: [1970s, funk, disco])
]
# Table: torrents
[
(groupName:TEXT, Examples: [superappin&#39;]),
(totalSnatched:INTEGER, Examples: [239, 156, 480]),
(artist:TEXT, Examples: [grandmaster flash & the furious five]),
(groupYear:INTEGER, Examples: [1979, 1980, 1981]),
(releaseType:TEXT, Examples: [single, album, live album]),
(groupId:INTEGER, Examples: [720949, 728752, 18513]),
(id:INTEGER, Primary Key, Examples: [0, 1, 2])
]
【Foreign keys】
tags.id=torrents.id

    【Question】
    Please list all release titles whose tag is jazz in 2005. release titles refer to groupName; groupYear = 2005;

    【Evidence】
    release titles refer to groupName; groupYear = 2005;

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

SQL: SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupYear = 2005 AND T2.tag LIKE 'jazz'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 music_tracker
【Schema】
# Table: tags
[
(index:INTEGER, Primary Key, Examples: [0, 1, 2]),
(id:INTEGER, Examples: [0, 2, 3]),
(tag:TEXT, Examples: [1970s, funk, disco])
]
# Table: torrents
[
(groupName:TEXT, Examples: [superappin&#39;]),
(totalSnatched:INTEGER, Examples: [239, 156, 480]),
(artist:TEXT, Examples: [grandmaster flash & the furious five]),
(groupYear:INTEGER, Examples: [1979, 1980, 1981]),
(releaseType:TEXT, Examples: [single, album, live album]),
(groupId:INTEGER, Examples: [720949, 728752, 18513]),
(id:INTEGER, Primary Key, Examples: [0, 1, 2])
]
【Foreign keys】
tags.id=torrents.id

    【Question】
    From 1980 to 2000, which artist had the most disco releases? From 1980 to 2000 refers to groupYear between 1980 and 2000; tag = 'disco'; the most releases refer to MAX(COUNT(id));

    【Evidence】
    From 1980 to 2000 refers to groupYear between 1980 and 2000; tag = 'disco'; the most releases refer to MAX(COUNT(id));

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

SQL: SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupYear BETWEEN 1980 AND 2000 AND T2.tag LIKE 'disco' GROUP BY T1.artist ORDER BY COUNT(T2.tag) DESC LIMIT 1
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 music_tracker
【Schema】
# Table: tags
[
(index:INTEGER, Primary Key, Examples: [0, 1, 2]),
(id:INTEGER, Examples: [0, 2, 3]),
(tag:TEXT, Examples: [1970s, funk, disco])
]
# Table: torrents
[
(groupName:TEXT, Examples: [superappin&#39;]),
(totalSnatched:INTEGER, Examples: [239, 156, 480]),
(artist:TEXT, Examples: [grandmaster flash & the furious five]),
(groupYear:INTEGER, Examples: [1979, 1980, 1981]),
(releaseType:TEXT, Examples: [single, album, live album]),
(groupId:INTEGER, Examples: [720949, 728752, 18513]),
(id:INTEGER, Primary Key, Examples: [0, 1, 2])
]
【Foreign keys】
tags.id=torrents.id

    【Question】
    Which artists have released singles with the tag 1970s? releaseType = 'single';

    【Evidence】
    releaseType = 'single';

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

SQL: SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'single' AND T2.tag LIKE '1970s'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 music_tracker
【Schema】
# Table: tags
[
(index:INTEGER, Primary Key, Examples: [0, 1, 2]),
(id:INTEGER, Examples: [0, 2, 3]),
(tag:TEXT, Examples: [1970s, funk, disco])
]
# Table: torrents
[
(groupName:TEXT, Examples: [superappin&#39;]),
(totalSnatched:INTEGER, Examples: [239, 156, 480]),
(artist:TEXT, Examples: [grandmaster flash & the furious five]),
(groupYear:INTEGER, Examples: [1979, 1980, 1981]),
(releaseType:TEXT, Examples: [single, album, live album]),
(groupId:INTEGER, Examples: [720949, 728752, 18513]),
(id:INTEGER, Primary Key, Examples: [0, 1, 2])
]
【Foreign keys】
tags.id=torrents.id

    【Question】
    From 1979 to 1982, what was the percentage of united.states albums out of total albums were released? From 1979 to 1982 refers to groupYear between 1979 and 1982; United States refer to tag; albums refer to releaseType; DIVIDE(COUNT(releaseType = 'album' where tag = 'united.states' and groupYear between 1979 and 1982), COUNT(releaseType = 'album' where groupYear between 1979 and 1982)) as percentage;

    【Evidence】
    From 1979 to 1982 refers to groupYear between 1979 and 1982; United States refer to tag; albums refer to releaseType; DIVIDE(COUNT(releaseType = 'album' where tag = 'united.states' and groupYear between 1979 and 1982), COUNT(releaseType = 'album' where groupYear between 1979 and 1982)) as percentage;

    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 T2.tag LIKE 'united.states' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.releaseType) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupYear BETWEEN 1979 AND 1982 AND T1.releaseType LIKE 'album'
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 different director IDs of the movies whose user rating is more than 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 DISTINCT T2.directorid FROM u2base AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.rating > 4
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】
    Among the users who gave a rating of 5, how many of them are male? Male users mean that u_gender = 'M'

    【Evidence】
    Male users mean that u_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 COUNT(T1.userid) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 5 AND T2.u_gender = 'M'
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 genres of the movies which actor id 851 is the star.

    【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.genre FROM movies2actors AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T1.actorid = T3.actorid WHERE T3.actorid = 851
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 movies from the USA which user rating is less than 3?

    【Evidence】
    

    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.movieid) FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'USA' AND T1.rating < 3
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】
    Among the movies from France, how many of them are drama? France a one country

    【Evidence】
    France a one 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(T1.movieid) FROM movies2directors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'France' AND T1.genre = 'drama'
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 average occupation of users whose ratings are not more than 2 ?

    【Evidence】
    

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

SQL: SELECT AVG(T2.occupation) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.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】
    List the top 10 USA movies, by descending order, from the highest to the lowest, the user rating. USA is a country

    【Evidence】
    USA 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 T1.movieid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'USA' GROUP BY T1.movieid ORDER BY AVG(T1.rating) DESC LIMIT 10
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 average number of casts of movies that are from the USA? USA is a country

    【Evidence】
    USA 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 AVG(T2.cast_num) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'USA'