input
stringlengths 358
16.1k
| output
stringlengths 24
805
|
---|---|
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: For movies with the keyword of "civil war", calculate the average revenue generated by these movies. [/INST] | SELECT AVG(T1.revenue) FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T3.keyword_name = 'civil war'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Find out the popularity of the movies with the highest vote count. [/INST] | SELECT popularity FROM movie ORDER BY vote_COUNT DESC LIMIT 1; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Among the zero-budget movie titles, which one has made the highest revenue? [/INST] | SELECT title FROM movie WHERE budget = 0 ORDER BY revenue DESC LIMIT 1; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the ID of the production company which produced the movie "Gladiator"? [/INST] | SELECT T2.company_id FROM movie AS T1 INNER JOIN movie_company AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'Gladiator'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: List down the IDs of the production companies that released the movies in 1916. [/INST] | SELECT T2.company_id FROM movie AS T1 INNER JOIN movie_company AS T2 ON T1.movie_id = T2.movie_id WHERE CAST(STRFTIME('%Y', T1.release_date) AS INT) = 1916; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: List down the movies produced by Lucasfilm. [/INST] | SELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Lucasfilm'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Among Warner Bros. Pictures' movies, which title made the highest revenue? [/INST] | SELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Warner Bros. Pictures' ORDER BY T3.revenue DESC LIMIT 1; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Write down the release date of the movies produced by Twentieth Century Fox Film Corporation. [/INST] | SELECT T3.release_date FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Twentieth Century Fox Film Corporation'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the language ID of the movie "Walk the Line"? [/INST] | SELECT T2.language_id FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'Walk the Line'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Find out the language ID of the movie with the highest popularity. [/INST] | SELECT T2.language_id FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.popularity DESC LIMIT 1; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Tell the language of the movie "C'era una volta il West". [/INST] | SELECT T3.language_name FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T1.title LIKE 'C%era una volta il West'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Are there any post-production movies in Nederlands? [/INST] | SELECT DISTINCT CASE WHEN T1.movie_status = 'Post Production' THEN 'YES' ELSE 'NO' END AS YORN FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T3.language_name = 'Nederlands'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: List down the tagline of the Polski movies. [/INST] | SELECT DISTINCT T1.tagline FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T3.language_name = 'Polski'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Provide the homepage of the Bahasa Indonesia movies. [/INST] | SELECT DISTINCT T1.homepage FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T3.language_name = 'Bahasa indonesia'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Work out the difference in revenues made between the English and Latin movies. [/INST] | SELECT SUM(CASE WHEN T3.language_name = 'English' THEN T1.revenue ELSE 0 END) - SUM(CASE WHEN T3.language_name = 'Latin' THEN T1.revenue ELSE 0 END) AS DIFFERENCE FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Calculate the revenues made by Fantasy Films and Live Entertainment. [/INST] | SELECT SUM(T3.revenue) FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name IN ('Fantasy Films', 'Live Entertainment'); |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the average revenue made by Latin movies? [/INST] | SELECT AVG(T1.revenue) FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T3.language_name = 'Latin'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the most common first name? [/INST] | SELECT person_name FROM person GROUP BY person_name ORDER BY COUNT(person_name) DESC LIMIT 1; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the average number of crews for a movie? [/INST] | SELECT CAST(SUM(CD) AS REAL) / COUNT(movie_id) FROM ( SELECT movie_id, COUNT(person_id) AS CD FROM movie_crew GROUP BY movie_id ); |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: List all the keywords with "christmas" in them. [/INST] | SELECT keyword_name FROM keyword WHERE keyword_name LIKE '%christmas%'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the longest runtime of all movies? [/INST] | SELECT MAX(runtime) FROM movie; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the iso code of "Kyrgyz Republic"? [/INST] | SELECT COUNTry_iso_code FROM COUNTry WHERE COUNTry_name = 'Kyrgyz Republic'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Provide the overview for the movie "The Pacifier". [/INST] | SELECT overview FROM movie WHERE title = 'The Pacifier'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: How many movies were produced by "Eddie Murphy Productions"? [/INST] | SELECT COUNT(T1.movie_id) FROM movie_company AS T1 INNER JOIN production_company AS T2 ON T1.company_id = T2.company_id WHERE T2.company_name = 'Eddie Murphy Productions'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: List all the actors who have played characters with "captain" in their names. [/INST] | SELECT DISTINCT T1.person_name FROM person AS T1 INNER JOIN movie_cast AS T2 ON T1.person_id = T2.person_id WHERE T2.character_name LIKE '%captain%'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the most common keyword among all the movies released in 2006? [/INST] | SELECT T3.keyword_name FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T1.release_date LIKE '2006%' GROUP BY T3.keyword_name ORDER BY COUNT(T3.keyword_name) DESC LIMIT 1; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: How many movies have "vi" as their language code? [/INST] | SELECT COUNT(T1.movie_id) FROM movie_languages AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_code = 'vi'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the third least common genre? [/INST] | SELECT T2.genre_name FROM movie_genres AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.genre_id GROUP BY T2.genre_id ORDER BY COUNT(T1.movie_id) LIMIT 2, 1; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the original language of the movie with the tagline "An offer you can't refuse."? [/INST] | SELECT T3.language_name FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id INNER JOIN language_role AS T4 ON T2.language_role_id = T4.role_id WHERE T4.language_role = 'Original' AND T1.tagline LIKE 'An offer you can%t refuse.'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Provide the average revenue of all the French movies. [/INST] | SELECT AVG(T1.revenue) FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id WHERE T3.COUNTry_name = 'France'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: List all the unspecified gender characters. [/INST] | SELECT T1.character_name FROM movie_cast AS T1 INNER JOIN gender AS T2 ON T1.gender_id = T2.gender_id WHERE T2.gender = 'Unspecified'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What are the top 5 most popular movie directors? [/INST] | SELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T2.job = 'Director' ORDER BY T1.popularity DESC LIMIT 5; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: List the film with the highest budget in each genre. [/INST] | SELECT T3.genre_name, MAX(T1.budget) FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id GROUP BY T3.genre_name; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the title of the movie with the most keywords? [/INST] | SELECT T1.title FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id GROUP BY T1.title ORDER BY COUNT(T2.keyword_id) DESC LIMIT 1; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Which department has the most people? [/INST] | SELECT T1.department_name FROM department AS T1 INNER JOIN movie_crew AS T2 ON T1.department_id = T2.department_id GROUP BY T1.department_id ORDER BY COUNT(T2.department_id) DESC LIMIT 1; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What percentage of films are made in the US? [/INST] | SELECT CAST(COUNT(CASE WHEN T3.COUNTry_iso_code = 'US' THEN T1.movie_id ELSE NULL END) AS REAL) * 100 / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the average ratio between female and male actors in a movie? [/INST] | SELECT CAST(COUNT(CASE WHEN T2.gender = 'Female' THEN T1.person_id ELSE NULL END) AS REAL) / COUNT(CASE WHEN T2.gender = 'Male' THEN T1.person_id ELSE NULL END) FROM movie_cast AS T1 INNER JOIN gender AS T2 ON T1.gender_id = T2.gender_id; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: List the movies released in 1945. [/INST] | SELECT title FROM movie WHERE CAST(STRFTIME('%Y', release_date) AS INT) = 1945; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Provide the ID and ISO code of Belgium. [/INST] | SELECT COUNTry_id, COUNTry_iso_code FROM COUNTry WHERE COUNTry_name = 'Belgium'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: List the character names played by Catherine Deneuve. [/INST] | SELECT T2.character_name FROM person AS T1 INNER JOIN movie_cast AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Catherine Deneuve'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: List the movies in the Somali language. [/INST] | SELECT T1.title FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T3.language_name = 'Somali'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Provide the release date and language of the most popular movie. [/INST] | SELECT T1.release_date, T3.language_name FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id ORDER BY T1.popularity DESC LIMIT 1; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the original language of the "Four Rooms" movie? [/INST] | SELECT T3.language_name FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id INNER JOIN language_role AS T4 ON T2.language_role_id = T4.role_id WHERE T4.language_role = 'Original' AND T1.title = 'Four Rooms'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: List the character names in the "Open Water" movie. [/INST] | SELECT T2.character_name FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'Open Water'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Who is the main actor in the "Pirates of the Caribbean: At World's End" movie? [/INST] | SELECT T3.person_name FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' ORDER BY T2.cast_order LIMIT 1; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: List the names of camera supervisors in the crew. [/INST] | SELECT T1.person_name FROM person AS T1 INNER JOIN movie_crew AS T2 ON T1.person_id = T2.person_id WHERE T2.job = 'Camera Supervisor'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: List the job titles of Sally Menke in the crew. [/INST] | SELECT DISTINCT T2.job FROM person AS T1 INNER JOIN movie_crew AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Sally Menke'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Provide the names and departments of the person who worked as a music editor in the "Pirates of the Caribbean: At World's End" movie. [/INST] | SELECT T3.person_name, T4.department_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id INNER JOIN department AS T4 ON T2.department_id = T4.department_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' AND T2.job = 'Music Editor'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Provide the titles and revenues of the movies produced by the DreamWorks company. [/INST] | SELECT T1.title, T1.revenue FROM movie AS T1 INNER JOIN movie_company AS T2 ON T1.movie_id = T2.movie_id INNER JOIN production_company AS T3 ON T2.company_id = T3.company_id WHERE T3.company_name = 'DreamWorks'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: How many movies were produced in Canada? [/INST] | SELECT COUNT(T2.movie_id) FROM COUNTry AS T1 INNER JOIN production_COUNTry AS T2 ON T1.COUNTry_id = T2.COUNTry_id WHERE T1.COUNTry_name = 'Canada'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: List the genres of Forrest Gump movie. [/INST] | SELECT T3.genre_name FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T1.title = 'Forrest Gump'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Provide the production companies of the movie that has over 35% average running time per movie in 2016. [/INST] | SELECT T.company_name FROM ( SELECT DISTINCT T3.company_name, T1.runtime FROM movie AS T1 INNER JOIN movie_company AS T2 ON T1.movie_id = T2.movie_id INNER JOIN production_company AS T3 ON T3.company_id = T2.company_id WHERE T1.release_date LIKE '2016%' ) T WHERE T.runtime * 100 > (0.35 * ( SELECT AVG(T1.runtime) FROM movie AS T1 INNER JOIN movie_company AS T2 ON T1.movie_id = T2.movie_id INNER JOIN production_company AS T3 ON T3.company_id = T2.company_id WHERE T1.release_date LIKE '2016%' ) + ( SELECT AVG(T1.runtime) FROM movie AS T1 INNER JOIN movie_company AS T2 ON T1.movie_id = T2.movie_id INNER JOIN production_company AS T3 ON T3.company_id = T2.company_id WHERE T1.release_date LIKE '2016%' )) * 100; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Find the difference in percentage of the movies under keywords of "woman director" and "independent film". [/INST] | SELECT CAST((SUM(CASE WHEN T1.keyword_name = 'woman director' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.keyword_name = 'independent film' THEN 1 ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN T1.keyword_name = 'independent film' THEN 1 ELSE 0 END) FROM keyword AS T1 INNER JOIN movie_keywords AS T2 ON T1.keyword_id = T2.keyword_id; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Which genre does the movie Dancer in the Dark belong to? [/INST] | SELECT T3.genre_name FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T1.title = 'Dancer in the Dark'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: How many adventure movies are there that were released in 2000? [/INST] | SELECT COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T3.genre_name = 'Adventure' AND CAST(STRFTIME('%Y', T1.release_date) AS INT) = 2000; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Which movies did the company Paramount Pictures produce in 2000? [/INST] | SELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Paramount Pictures' AND CAST(STRFTIME('%Y', T3.release_date) AS INT) = 2000; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What keyword can the user use to search for the movie Finding Nemo? [/INST] | SELECT T3.keyword_name FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T1.title = 'Finding Nemo'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Name the horror movies with positive ratings greater than 7. [/INST] | SELECT T1.title FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T3.genre_name = 'Horror' AND T1.vote_average > 7; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: How many production companies made more than 150 movies? [/INST] | SELECT COUNT(*) FROM ( SELECT T1.company_name AS CNAME FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id HAVING COUNT(T1.company_name) > 150 ); |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the role of Mark Hammel? [/INST] | SELECT T2.job FROM person AS T1 INNER JOIN movie_crew AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Mark Hammel'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: How many main actors are there in the movie Pirates of the Caribbean: At World's End? [/INST] | SELECT COUNT(T2.cast_order) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T3.gender_id = T2.gender_id WHERE T3.gender = 'Male' OR T3.gender = 'Female' AND T1.title = 'Pirates of the Caribbean: At World''s End' AND T2.cast_order = ( SELECT MIN(T2.cast_order) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T3.gender_id = T2.gender_id WHERE T3.gender = 'Male' OR T3.gender = 'Female' AND T1.title = 'Pirates of the Caribbean: At World''s End' ); |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Which movies have the participation of actor Harrison Ford? [/INST] | SELECT T1.title FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Harrison Ford'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Which character did Orlando Bloom play in the movie Pirates of the Caribbean: The Curse of the Black Pearl? [/INST] | SELECT T2.character_name FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title = 'Pirates of the Caribbean: The Curse of the Black Pearl' AND T3.person_name = 'Orlando Bloom'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the average number of horror movies among all movies genre? [/INST] | SELECT CAST(COUNT(CASE WHEN T3.genre_name = 'Horror' THEN T1.movie_id ELSE NULL END) AS REAL) / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: List the names of all the producers in the movie "Pirates of the Caribbean: At World's End". [/INST] | SELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title = 'Pirates of the Caribbean: The Curse of the Black Pearl' AND T2.job = 'Producer'; |
[INST] Here is a database schema:
country :
country_id [ INTEGER ] primary_key
country_iso_code [ TEXT ]
country_name [ TEXT ]
department :
department_id [ INTEGER ] primary_key
department_name [ TEXT ]
gender :
gender_id [ INTEGER ] primary_key
gender [ TEXT ]
genre :
genre_id [ INTEGER ] primary_key
genre_name [ TEXT ]
keyword :
keyword_id [ INTEGER ] primary_key
keyword_name [ TEXT ]
language :
language_id [ INTEGER ] primary_key
language_code [ TEXT ]
language_name [ TEXT ]
language_role :
role_id [ INTEGER ] primary_key
language_role [ TEXT ]
movie :
movie_id [ INTEGER ] primary_key
title [ TEXT ]
budget [ INTEGER ]
homepage [ TEXT ]
overview [ TEXT ]
popularity [ REAL ]
release_date [ DATE ]
revenue [ INTEGER ]
runtime [ INTEGER ]
movie_status [ TEXT ]
tagline [ TEXT ]
vote_average [ REAL ]
vote_count [ INTEGER ]
movie_genres :
movie_id [ INTEGER ] movie_genres.movie_id = movie.movie_id
genre_id [ INTEGER ] movie_genres.genre_id = genre.genre_id
movie_languages :
movie_id [ INTEGER ] movie_languages.movie_id = movie.movie_id
language_id [ INTEGER ] movie_languages.language_id = language.language_id
language_role_id [ INTEGER ] movie_languages.language_role_id = language_role.role_id
person :
person_id [ INTEGER ] primary_key
person_name [ TEXT ]
movie_crew :
movie_id [ INTEGER ] movie_crew.movie_id = movie.movie_id
person_id [ INTEGER ] movie_crew.person_id = person.person_id
department_id [ INTEGER ] movie_crew.department_id = department.department_id
job [ TEXT ]
production_company :
company_id [ INTEGER ] primary_key
company_name [ TEXT ]
production_country :
movie_id [ INTEGER ] production_country.movie_id = movie.movie_id
country_id [ INTEGER ] production_country.country_id = country.country_id
movie_cast :
movie_id [ INTEGER ] movie_cast.movie_id = movie.movie_id
person_id [ INTEGER ] movie_cast.person_id = person.person_id
character_name [ TEXT ]
gender_id [ INTEGER ] movie_cast.gender_id = gender.gender_id
cast_order [ INTEGER ]
movie_keywords :
movie_id [ INTEGER ]
keyword_id [ INTEGER ]
movie_company :
movie_id [ INTEGER ]
company_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Calculate the average income made by movies using the keyword "paris". List the title of the movies. [/INST] | SELECT AVG(T1.revenue), T1.title FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T3.keyword_name = 'paris'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: How many English language codes whose comments for the method are in the XML format? [/INST] | SELECT COUNT(Lang) FROM Method WHERE Lang = 'en' AND CommentIsXml = 1; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the task of the method whose tokenized name is "online median filter test median window filling"? [/INST] | SELECT SUBSTR(SUBSTR(Name, INSTR(Name, '.') + 1), 1, INSTR(SUBSTR(Name, INSTR(Name, '.') + 1), '.') - 1) task FROM Method WHERE NameTokenized = 'online median filter test median window filling'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the time of sampling of the solution with the highest sampling time? Indicate the id number of the solution. [/INST] | SELECT DISTINCT SampledAt, SolutionId FROM Method WHERE SampledAt = ( SELECT MAX(SampledAt) FROM Method ); |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: How many followers do the most followed repository on Github have? Give the github address of the repository. [/INST] | SELECT Forks, Url FROM Repo WHERE Forks = ( SELECT MAX(Forks) FROM Repo ); |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the id of the repository with the highest number of solution path? [/INST] | SELECT RepoId FROM solution GROUP BY RepoId ORDER BY COUNT(Path) DESC LIMIT 1; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the most liked repository? Indicate its github address and the amount of stars it has received. [/INST] | SELECT Url, Stars FROM Repo WHERE Stars = ( SELECT MAX(Stars) FROM Repo ); |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the name of the solution path with the highest processed time? [/INST] | SELECT Path FROM Solution WHERE ProcessedTime = ( SELECT MAX(ProcessedTime) FROM Solution ); |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: How much is the processed time of downloading the most popular repository? [/INST] | SELECT ProcessedTime FROM Repo WHERE Watchers = ( SELECT MAX(Watchers) FROM Repo ); |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the github address of the "nofear_Mara\Mara.sln" solution path? [/INST] | SELECT Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE Path = 'nofear_MaraMara.sln'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: Which repository has the longest amount of processed time of downloading? Indicate whether the solution paths in the repository can be implemented without needs of compilation. [/INST] | SELECT DISTINCT T1.id, T2.WasCompiled FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.ProcessedTime = ( SELECT MAX(ProcessedTime) FROM Repo ); |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the tokenized name of the solution whose path is "maravillas_linq-to-delicious\tasty.sln"? [/INST] | SELECT DISTINCT T2.NameTokenized FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'maravillas_linq-to-delicious'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: Among the repositories whose number of stars received are between 6,000 to 9,000, which repository has the highest number of solution paths and many of those solution paths needs to be compiled if user wants to implement it? [/INST] | SELECT T2.RepoId, COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars BETWEEN 6000 AND 9000 AND T2.WasCompiled = 0 GROUP BY T2.RepoId ORDER BY COUNT(T2.RepoId) DESC LIMIT 1; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: In the "https://github.com/wallerdev/htmlsharp.git", give all the linearized sequenced of API calls. [/INST] | SELECT T3.ApiCalls FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId INNER JOIN Method AS T3 ON T2.Id = T3.SolutionId WHERE T1.Url = 'https://github.com/wallerdev/htmlsharp.git'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: How many solution paths are there inside the 2nd most popular repository? [/INST] | SELECT COUNT(DISTINCT T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Watchers = ( SELECT Watchers FROM Repo ORDER BY Watchers DESC LIMIT 1, 1 ); |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the average processed time of the solution paths inside the "https://github.com/zphingphong/DiscardCustomerApp.git"? [/INST] | SELECT CAST(SUM(T2.ProcessedTime) AS REAL) / COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/zphingphong/DiscardCustomerApp.git'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the full comment on the method whose solution path is "bmatzelle_nini\Source\Nini.sln" with a tokenized name of "alias text add alias"? [/INST] | SELECT T2.FullComment FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'bmatzelle_niniSourceNini.sln' AND T2.NameTokenized = 'alias text add alias'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the linearized sequenced of API calls of the method whose solution path is "mauriciodeamorim_tdd.encontro2\Tdd.Encontro2.sln"? [/INST] | SELECT T2.ApiCalls FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'mauriciodeamorim_tdd.encontro2Tdd.Encontro2.sln'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: How many solution paths that needs to be compiled if user wants to implement it in "https://github.com/jeffdik/tachy.git"? [/INST] | SELECT COUNT(T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/jeffdik/tachy.git' AND T2.WasCompiled = 0; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: How much is the processed time of the method whose tokenized name is "about box1 dispose"? Indicate the language of the method. [/INST] | SELECT DISTINCT T1.ProcessedTime, T2.Lang FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized = 'about box1 dispose'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: In "maxild_playground\Playground.sln", what is the time of sampling for the method "GitHubRepo.Cli.GitHubClientWrapper.GetReleases"? [/INST] | SELECT T2.SampledAt FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'maxild_playgroundPlayground.sln' AND T2.Name = 'GitHubRepo.Cli.GitHubClientWrapper.GetReleases'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the language of the method used in the solution path "opendns_diagnosticapp\windows\OpenDnsDiagnostic.sln"? [/INST] | SELECT T2.Lang FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'opendns_diagnosticappwindowsOpenDnsDiagnostic.sln'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: What's the task of the method whose tokenized name is "html parser feed"? [/INST] | SELECT SUBSTR(SUBSTR(Name, INSTR(Name, '.') + 1), 1, INSTR(SUBSTR(Name, INSTR(Name, '.') + 1), '.') - 1) task FROM Method WHERE NameTokenized = 'html parser feed'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: Are the comments for the method "HtmlSharp.HtmlParser.Feed" in XML format? [/INST] | SELECT CASE WHEN CommentIsXml = 0 THEN 'No' WHEN CommentIsXml = 1 THEN 'Yes' END isXMLFormat FROM Method WHERE Name = 'HtmlSharp.HtmlParser.Feed'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: Which method has the summary "Write a command to the log"? [/INST] | SELECT Name FROM Method WHERE Summary = 'Write a command to the log'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: How many solutions contain files found within the repository most people like? [/INST] | SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = ( SELECT MAX(Stars) FROM Repo ); |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: Please list the path of the solution that contains files found within the repository most people like. [/INST] | SELECT DISTINCT T2.Path FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = ( SELECT MAX(Stars) FROM Repo ); |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the github address of the repository that contains files used by solution ID12? [/INST] | SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 12; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: Among the solutions that contain files within the repository followed by over 1000 people, how many of them can be
implemented without needs of compilation? [/INST] | SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks > 1000 AND T2.WasCompiled = 1; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: Which solution contains files within a more popular repository, the solution ID18 or solution ID19? [/INST] | SELECT CASE WHEN SUM(CASE WHEN T2.Id = 18 THEN T1.Watchers ELSE 0 END) > SUM(CASE WHEN T2.Id = 19 THEN T1.Watchers ELSE 0 END) THEN 'SolutionID18' WHEN SUM(CASE WHEN T2.Id = 18 THEN T1.Watchers ELSE 0 END) < SUM(CASE WHEN T2.Id = 19 THEN T1.Watchers ELSE 0 END) THEN 'SolutionID19' END isMorePopular FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: Among the solutions that contain files within the repository needing the longest processed time to download, how many of them doesn't need to be
compiled if user wants to implement it? [/INST] | SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.ProcessedTime = ( SELECT MAX(ProcessedTime) FROM Repo ) AND T2.WasCompiled = 1; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: What is the processed time to download the repository whose files are contained in the solution with the path "jeffdik_tachy\src\Tachy.sln". [/INST] | SELECT DISTINCT T2.ProcessedTime FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Path = 'jeffdik_tachysrcTachy.sln'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: Please give the url of the repository whose files are contained in solution ID 9? [/INST] | SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 9; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: Please list all the paths of the solutions containing files within the repository whose url is "https://github.com/maxild/playground.git". [/INST] | SELECT T2.Path FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/maxild/playground.git'; |
[INST] Here is a database schema:
Method :
Id [ INTEGER ] primary_key
Name [ TEXT ]
FullComment [ TEXT ]
Summary [ TEXT ]
ApiCalls [ TEXT ]
CommentIsXml [ INTEGER ]
SampledAt [ INTEGER ]
SolutionId [ INTEGER ]
Lang [ TEXT ]
NameTokenized [ TEXT ]
MethodParameter :
Id [ INTEGER ] primary_key
MethodId [ TEXT ]
Type [ TEXT ]
Name [ TEXT ]
Repo :
Id [ INTEGER ] primary_key
Url [ TEXT ]
Stars [ INTEGER ]
Forks [ INTEGER ]
Watchers [ INTEGER ]
ProcessedTime [ INTEGER ]
Solution :
Id [ INTEGER ] primary_key
RepoId [ INTEGER ]
Path [ TEXT ]
ProcessedTime [ INTEGER ]
WasCompiled [ INTEGER ]
Please write me a SQL statement that answers the following question: Among the repositories with over 200 likes, how many of them have files contained by solutions with a processed time of under 636439500080712000? [/INST] | SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.ProcessedTime < 636439500080712000 AND T1.Stars > 200; |