db_id
stringclasses
68 values
question
stringlengths
24
325
evidence
stringlengths
0
580
SQL
stringlengths
23
728
movies_4
Are there any post-production movies in Nederlands?
post-production movies refers to movie_status = 'Post Production'; Nederlands refers to language_name = 'Nederlands';
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'
movies_4
List down the tagline of the Polski movies.
Polski movies refers to language_name = 'Polski'
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'
movies_4
Provide the homepage of the Bahasa Indonesia movies.
Bahasa Indonesia movies refers to language_name = 'Bahasa indonesia'
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'
movies_4
Work out the difference in revenues made between the English and Latin movies.
English refers to language_name = 'English'; Latin refers to language_name = 'Latin'; difference in revenues = subtract(sum(movie_id) when language_name = 'English', sum(movie_id) when language_name = 'Latin')
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
movies_4
Calculate the revenues made by Fantasy Films and Live Entertainment.
made by Fantasy Films refers to company_name = 'Fantasy Films'; Live Entertainment refers to company_name = 'Live Entertainment'
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')
movies_4
What is the average revenue made by Latin movies?
Latin movies refers to language_name = 'Latin'; average revenue = AVG(revenue)
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'
movies_4
What is the most common first name?
most common first name refers to max(count(person_name))
SELECT person_name FROM person GROUP BY person_name ORDER BY COUNT(person_name) DESC LIMIT 1
movies_4
What is the average number of crews for a movie?
average number of crews = divide(count(person_id), COUNT(movie_id))
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 )
movies_4
List all the keywords with "christmas" in them.
keywords with "christmas" in them refers to keyword_name LIKE '%christmas%'
SELECT keyword_name FROM keyword WHERE keyword_name LIKE '%christmas%'
movies_4
What is the longest runtime of all movies?
longest runtime refers to max(runtime)
SELECT MAX(runtime) FROM movie
movies_4
What is the iso code of "Kyrgyz Republic"?
iso code refers to country_iso_code; "Kyrgyz Republic" refers to country_name = 'Kyrgyz Republic'
SELECT COUNTry_iso_code FROM COUNTry WHERE COUNTry_name = 'Kyrgyz Republic'
movies_4
Provide the overview for the movie "The Pacifier".
movie "The Pacifier" refers to title = 'The Pacifier'
SELECT overview FROM movie WHERE title = 'The Pacifier'
movies_4
How many movies were produced by "Eddie Murphy Productions"?
produced by "Eddie Murphy Productions" refers to company_name = 'Eddie Murphy Productions'
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'
movies_4
List all the actors who have played characters with "captain" in their names.
List all the actors refers to person_name; characters with "captain" in their names refers to character_name LIKE '%captain%';
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%'
movies_4
How many movies have "vi" as their language code?
"vi" as their language code refers to language_code = 'vi'
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'
movies_4
What is the original language of the movie with the tagline "An offer you can't refuse."?
language refers to language_name; original language refers to language_role = 'Original'
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.'
movies_4
Provide the average revenue of all the French movies.
French movies refers to country_name = 'France'; average revenue = AVG(revenue)
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'
movies_4
List all the unspecified gender characters.
characters refers to character_name; gender = 'Unspecified'
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'
movies_4
What are the top 5 most popular movie directors?
directors refers to job = 'Director'; most popular refers to max(popularity)
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
movies_4
List the film with the highest budget in each genre.
highest budget refers to max(budget); each genre refers to genre_name; film also means movie; list the film refers to title of movie
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
movies_4
What is the title of the movie with the most keywords?
most keywords refers to max(count(keyword_id))
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
movies_4
Which department has the most people?
department refers to department_name; most people refers to max(count(department_id))
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
movies_4
What percentage of films are made in the US?
films' and 'movies' are synonyms; made in the US refers to country_iso_code = 'US'; percentage = divide(sum(country_id) when country_iso_code = 'US', count(country_id)) * 100 as percentage
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
movies_4
What is the average ratio between female and male actors in a movie?
female refers to gender = 'Female';male refers to gender = 'Male'; average ratio = divide(divide(sum(gender_id) when gender = 'Female', sum(gender_id) when gender = 'Male'), count(movie_id)) as percentage
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
movies_4
Provide the ID and ISO code of Belgium.
ID refers to country_id; ISO code refers to country_iso_code; Belgium refers to country_name = 'Belgium'
SELECT COUNTry_id, COUNTry_iso_code FROM COUNTry WHERE COUNTry_name = 'Belgium'
movies_4
List the character names played by Catherine Deneuve.
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'
movies_4
List the movies in the Somali language.
List the movies refers to title; Somali language refers to language_name = 'Somali'
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'
movies_4
Provide the release date and language of the most popular movie.
language refers to langauge_name; most popular movie refers to max(popularity)
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
movies_4
What is the original language of the "Four Rooms" movie?
language refers to language_name; original language refers to language_role = 'Original'; "Four Rooms" refers to title = 'Four Rooms'
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'
movies_4
List the character names in the "Open Water" movie.
"Open Water" movie refers to title = 'Open Water'
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'
movies_4
Who is the main actor in the "Pirates of the Caribbean: At World's End" movie?
main actor refers to person_name where Min(cast_order); "Pirates of the Caribbean: At World's End" refers to title = 'Pirates of the Caribbean: At World''s End'
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
movies_4
List the names of camera supervisors in the crew.
names refers to person_name; camera supervisors refers to job = 'Camera Supervisor';
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'
movies_4
List the job titles of Sally Menke in the crew.
job titles refers to job
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'
movies_4
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.
names refers to person_name; departments refers to department_name; worked as a music editor refers to job = 'Music Editor'; "Pirates of the Caribbean: At World's End" refers to title = 'Pirates of the Caribbean: At World''s End'
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'
movies_4
Provide the titles and revenues of the movies produced by the DreamWorks company.
produced by the DreamWorks company refers to company_name = 'DreamWorks'
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'
movies_4
How many movies were produced in Canada?
produced in Canada refers to country_name = 'Canada'
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'
movies_4
List the genres of Forrest Gump movie.
genres refers to genre_name; Forrest Gump movie refers to title = 'Forrest Gump'
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'
movies_4
Find the difference in percentage of the movies under keywords of "woman director" and "independent film".
under keywords of "woman director" and "independent film" refers to keyword_name = 'woman director' and keyword_name = 'independent film'; difference in percentage = divide(subtract(count(movie_id) when keyword_name = 'woman director', count(movie_id) when keyword_name = 'independent film'), count(movie_id)) as percentage
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
movies_4
Which genre does the movie Dancer in the Dark belong to?
genre refers to genre_name; movie Dancer in the Dark refers to title = 'Dancer in the Dark'
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'
movies_4
What keyword can the user use to search for the movie Finding Nemo?
What keyword refers to keyword_name; Finding Nemo refers to title = 'Finding Nemo'
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'
movies_4
Name the horror movies with positive ratings greater than 7.
Name the horror movies refers to title where genre_name = 'horror'; positive ratings greater than 7 refers to vote_average > 7
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
movies_4
How many production companies made more than 150 movies?
more than 150 movies refers to COUNT(company_name) > 150
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 )
movies_4
What is the role of Mark Hammel?
role refers to job
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'
movies_4
How many main actors are there in the movie Pirates of the Caribbean: At World's End?
main actors refers to gender = 'male' and min(cast_order); Pirates of the Caribbean: At World's End refers to title = 'Pirates of the Caribbean: At World''s End'
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' )
movies_4
Which movies have the participation of actor Harrison Ford?
Which movies refers to title; actor refers to person_name
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'
movies_4
Which character did Orlando Bloom play in the movie Pirates of the Caribbean: The Curse of the Black Pearl?
Which character refers to character_name; movie Pirates of the Caribbean: The Curse of the Black Pearl refers to title = 'Pirates of the Caribbean: The Curse of the Black Pearl'
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'
movies_4
What is the average number of horror movies among all movies genre?
horror movies refers to genre_name = 'horror'; average number = divide(sum(movie_id) when genre_name = 'horror', count(movie_id))
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
movies_4
List the names of all the producers in the movie "Pirates of the Caribbean: At World's End".
List the names refers to person_name; producers refers to job = 'Producer'; "Pirates of the Caribbean: At World's End" refers to title = 'Pirates of the Caribbean: The Curse of the Black Pearl'
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'
codebase_comments
How many English language codes whose comments for the method are in the XML format?
English language refers to Lang = 'en'; the comments for this method is XML format refers to CommentIsXml = 1;
SELECT COUNT(Lang) FROM Method WHERE Lang = 'en' AND CommentIsXml = 1
codebase_comments
How many solution paths that needs to be compiled if user wants to implement it in "https://github.com/jeffdik/tachy.git"?
needs to be compiled if user wants to implement refers to WasCompiled = 0; https://github.com/jeffdik/tachy.git is url of repository
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
codebase_comments
How many solutions contain files found within the repository most people like?
more stars mean more people like this repository; most people like refers to max(Stars);
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 )
codebase_comments
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?
followed by over 1000 people refers to Forks >1000; can be implemented without needs of compilation refers to WasCompiled = 1;
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
codebase_comments
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?
longest processed time refers to max(Solution.ProcessedTime); needs to be compiled if user wants to implement it refers to WasCompiled = 0;
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
codebase_comments
Among the repositories with over 200 likes, how many of them have files contained by solutions with a processed time of under 636439500080712000?
over 200 likes refers to Stars > 200; ProcessedTime<636439500080712000;
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
codebase_comments
For the repository which got '8094' Stars, how many solutions does it contain?
repository refers to Repo.Id;
SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 8094
codebase_comments
For the repository with '8094' watchers , how many solutions does it contain?
repository refers to Repo.Id and RepoId; solutions a repository contains refers to Solution.Id;
SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Watchers = 8094
codebase_comments
How many solutions does the repository which has 1445 Forks contain?
solutions refers to Solution.Id; repository refers to Repository.Id;
SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks = 1445
codebase_comments
For the repository which got '189' Stars, how many solutions which needs to be compiled does it contain?
repository refers to Repository.Id; solution needs to be compiled refers to WasCompiled = 0;
SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 189 AND T2.WasCompiled = 0
codebase_comments
Give the number of solutions that the repository which has 3060 Stars contains.
solutions refers to Solution.Id; repository refers to Repository.Id;
SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 3060
codebase_comments
How many solutions are in "https://github.com/derickbailey/presentations-and-training.git"?
solutions refers to Solution.Id; https://github.com/derickbailey/presentations-and-training.git refers to Url; Url; = 'https://github.com/derickbailey/presentations-and-training.git';
SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/derickbailey/presentations-and-training.git'
codebase_comments
How many methods with solutions with path 'maravillas_linq-to-delicious\tasty.sln'?
solution refers to SolutionId;
SELECT COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'maravillas_linq-to-delicious\tasty.sln'
codebase_comments
How many solutions whose repository's stars are a third more than forks?
solutions refers to Solution.Id; repository stars are a third more than forks = (MULTIPLY(Stars, 1/3))>Forks;
SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks < T1.Stars * 1 / 3
codebase_comments
Among the repository "3", how many methods whose comments is XML format?
repository refers to RepoId; RepoId = 3; method refers to Name; method whose comment is XML format refers to CommentIsXml = 1;
SELECT COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.RepoId = 3 AND T2.CommentIsXml = 1
codebase_comments
How many solutions are there whose respositories received the number of stars more than one third of the number of forks?
number of solutions are there whose repositories received the number of stars more than one third of the number of forks refers to Stars>DIVIDE(Forks, 3);
SELECT COUNT(DISTINCT T1.Id) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars > CAST(T1.Forks AS REAL) / 3
codebase_comments
How many methods in the same repository share a tokenized name that begins with "query language..."?
methods refers to Name; tokenized name refers to NameTokenized; NameTokenized LIKE 'query language%';
SELECT COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized LIKE 'query language%'
codebase_comments
How many methods in repository 150 did not have a comment and a summary?
methods refers to Name; repository that did not have a comment and a summary refers to FullComment IS NULL AND Summary IS NULL;
SELECT COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.RepoId = 150 AND T2.FullComment IS NULL AND T2.Summary IS NULL
codebase_comments
How many path does the github address "https://github.com/jeffdik/tachy.git" have?
github address refers to Url; Url = 'https://github.com/jeffdik/tachy.git';
SELECT COUNT(DISTINCT 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'
codebase_comments
How many XML format does the github address "https://github.com/dogeth/vss2git.git" have?
Xml format refers to CommentisXml, github address refers to Url; Url = 'https://github.com/dogeth/vss2git.git';
SELECT COUNT(T3.CommentIsXml) 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/dogeth/vss2git.git' AND T3.CommentIsXml = 1
codebase_comments
How many solution path does the repository with 111 stars, 58 forks, and 111 watchers?
solution path refers to Path;
SELECT COUNT(T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 111 AND T1.Forks = 58 AND T1.Watchers = 111
codebase_comments
How many language code of method is used for the github address "https://github.com/managedfusion/managedfusion.git "?
language code of method refers to Lang; github address refers to Url; Url = 'https://github.com/managedfusion/managedfusion.git';
SELECT COUNT(DISTINCT T3.Lang) 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/managedfusion/managedfusion.git'
trains
How many trains are there that run in the east direction?
east is a direction
SELECT COUNT(id) FROM trains WHERE direction = 'east'
trains
How many cars are there on train no.1?
train no.1 refers to train_id = 1
SELECT COUNT(id) FROM cars WHERE train_id = 1
trains
What is the shape of the tail car on train no.1?
train no.1 refers to train_id = 1; tail car refers to position = 4
SELECT shape FROM cars WHERE train_id = 1 AND position = 4
trains
Please list the IDs of all the trains with at least one car in a non-regular shape.
non-regular shape refers to shape in ('elipse', 'bucket')
SELECT train_id FROM cars WHERE shape IN ('elipse', 'bucket') GROUP BY train_id
trains
How many cars on train no.1 have the roof open?
train no. 1 refers to train_id = 1; roof open refers to roof = 'none'
SELECT COUNT(id) FROM cars WHERE train_id = 1 AND roof = 'none'
trains
Please list the IDs of all the cars on train no.1 that have 2 wheels.
train no.1 refers to train_id = 1; 2 wheels refers to wheels = 2
SELECT id FROM cars WHERE train_id = 1 AND wheels = 2
trains
Among the trains that run in the east direction, how many of them have at least one car in a non-regular shape?
non-regular shape refers to shape in ('elipse', 'bucket')
SELECT SUM(CASE WHEN T1.shape IN ('bucket', 'elipse') THEN 1 ELSE 0 end)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'
trains
Please list the IDs of all the trains that run in the east direction and have less than 4 cars.
less than 4 cars refers to carsNum < 4
SELECT T1.id FROM trains AS T1 INNER JOIN ( SELECT train_id, MAX(position) AS carsNum FROM cars GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T1.direction = 'east' AND T2.carsNum < 4
trains
Please list the IDs of all the cars with double sides on trains that run in the west direction.
double sides on trains refers to sides = 'double'
SELECT T1.id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' AND T1.sides = 'double'
trains
Among the trains that run in the east direction, how many of them have more than 2 long cars?
more than 2 long cars refers to longCarsNum > 2
SELECT SUM(CASE WHEN T2.longCarsNum > 2 THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS longCarsNum FROM cars WHERE len = 'long' GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T1.direction = 'west'
trains
Please list the directions in which the trains with at least one empty-loaded car run.
at least one empty-loaded car run refers to load_num = 0
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.load_num = 0
trains
In which direction does the train with an ellipse-shape car run?
shape = 'ellipse'
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.shape = 'ellipse'
trains
What is the total number of short cars on all the trains that run in the east direction?
short cars refers to len = 'short'
SELECT SUM(CASE WHEN T1.len = 'short' then 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'
trains
Please list the shapes of all the head cars on the trains that run in the east direction.
head cars refers to position = 1;
SELECT T1.shape FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' AND T1.position = 1 GROUP BY T1.shape
trains
How many cars on a train that runs in the east direction have a flat roof?
flat roof refers to roof = 'flat'
SELECT SUM(CASE WHEN T1.roof = 'flat' THEN 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'
trains
Among the cars on a train that runs in the east direction, how many of them have a flat roof and a circle load shape?
flat roof refers to roof = 'flat'; load_shape = 'circle'
SELECT SUM(CASE WHEN T1.load_shape = 'circle' THEN 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' AND T1.roof = 'flat'
trains
Trains that run in which direction have more rectangle-shaped cars in total?
more rectangle-shaped cars refers to MAX(rectCarsNum)
SELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS rectCarsNum FROM cars WHERE shape = 'rectangle' GROUP BY train_id ) AS T2 ON T1.id = T2.train_id ORDER BY T2.rectCarsNum DESC
trains
Please list the directions in which the trains with 4 short cars run.
short refers to len = 'short'; 4 cars run refers to position = 4
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.len = 'short' AND T1.position = 4
trains
What is the average number of cars on trains that run in the east direction?
calculation = DIVIDE(count(id), count(train_id))
SELECT CAST(COUNT(T1.id) AS REAL) / COUNT(DISTINCT T1.train_id) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'
trains
Among the trains that have at least one non-regular shaped car, what is the percentage of it running in the east direction?
non-regular shaped car refers to shape in ('bucket', 'ellipse'); calculation = MULTIPLY(DIVIDE(count(direction = 'east' then train_id)), count(train_id), 100)
SELECT CAST(COUNT(DISTINCT CASE WHEN T2.direction = 'east' THEN T1.train_id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T1.train_id) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.shape IN ('bucket', 'ellipse')
trains
How many short cars are in the shape of hexagon?
short cars refers to len = 'short'; in the shape of hexagon refers to shape = 'hexagon'
SELECT COUNT(id) FROM cars WHERE shape = 'hexagon' AND len = 'short'
trains
How many trains are running west?
west is a direction
SELECT COUNT(id) FROM trains WHERE direction = 'west'
trains
What are the load shapes of all the short ellipse cars?
short refers to len = 'short'; ellipse cars refers to shape = 'ellipse'
SELECT load_shape FROM cars WHERE shape = 'ellipse' AND len = 'short'
trains
What are the ids of the train running east?
east is a direction
SELECT id FROM trains WHERE direction = 'east'
trains
How many wheels do the long cars have?
long cars refers to len = 'long'
SELECT SUM(wheels) FROM cars WHERE len = 'long'
trains
Which direction do the majority of the trains are running?
majority of train refers to MAX(count(id))
SELECT direction FROM trains GROUP BY direction ORDER BY COUNT(id) DESC
trains
Among the trains running east, how many trains have at least 4 cars?
east is a direction; at least 4 cars refers to carsNum > = 4
SELECT SUM(CASE WHEN T1.direction = 'east' THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS carsNum FROM cars GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T2.carsNum >= 4
trains
Which direction do most of the trains with rectangle-shaped second cars run?
most of the trains refers to MAX(count(id)); second cars refers to position = 2
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 2 AND T1.shape = 'rectangle' GROUP BY T2.direction ORDER BY COUNT(T2.id) DESC LIMIT 1
trains
How many trains running west have double sided cars in 3rd position?
west is a direction; double sided cars refers to sides = 'double'; 3rd position refers to position = 3
SELECT COUNT(T.train_id) FROM (SELECT T1.train_id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 3 AND T2.direction = 'west' AND T1.sides = 'double' GROUP BY T1.train_id)as T
trains
How many eastbound trains have rectangular-shaped head cars?
eastbound refers to direction = 'east'; head cars refers to position = 1
SELECT COUNT(T.train_id) FROM (SELECT T1.train_id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 1 AND T2.direction = 'east' AND T1.shape = 'rectangle' GROUP BY T1.train_id)as T