Dludora/DAIL-BIRD huggingface dataset:
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: How many percent more of the Forks for the repository of solution No.53546 than No.1502? solution No. refers to Solution.Id; percentage = DIVIDE(MULTIPLY(SUBTRACT(SUM(Solution.Id = 53546), SUM(Solution.Id = 1502)), 100)), SUM(Solution.Id = 1502); */
SELECT 
SELECT CAST(SUM(CASE WHEN T2.Id = 53546 THEN T1.Forks ELSE 0 END) - SUM(CASE WHEN T2.Id = 1502 THEN T1.Forks ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 1502 THEN T1.Forks ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: List all the methods with a solution with a "636449700980488000" processed time. methods refers to Name; solution refers to SolutionId; */
SELECT 
SELECT DISTINCT T2.Name FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.ProcessedTime = 636449700980488000
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: 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 
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'
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: What is the total processed time of all solutions from the repository with the most forks? total processed time = AVG(ProcessedTime where MAX(COUNT(Forks))); repository with the most forks refers to MAX(COUNT(Forks)); */
SELECT 
SELECT SUM(T2.ProcessedTime) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks = ( SELECT MAX(Forks) FROM Repo )
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: List all the path of solution from all the "it" lang code method. path of the solution refers to Path; solution refers to Solution.Id; */
SELECT 
SELECT DISTINCT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'it'
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: What is the path of solution of "spinachLexer.mT__55" method? path of the solution refers to Path; solution refers to Solution.Id; method refers to Name; Name = 'spinachLexer.mT__55'; */
SELECT 
SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'spinachLexer.mT__55'
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: What are the "en" methods with solutions from repository "1093" en methods refers to lang = 'en'; solution refers to Solution.Id; repository refers to RepoId; RepoId = 1093; */
SELECT 
SELECT DISTINCT T2.id FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.RepoId = 1093 AND T2.Lang = 'en'
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: What are the paths of solutions in repository "https://github.com/ecoffey/Bebop.git" path of solutions refers to Path; https://github.com/ecoffey/Bebop.git refers to Url; Url = 'https://github.com/ecoffey/Bebop.git'; */
SELECT 
SELECT DISTINCT T2.Path FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/ecoffey/Bebop.git'
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: List all the ids of repositories for solutions with "ro" methods. ids of repositories refers to RepoId; ro refers to lang = 'ro'; */
SELECT 
SELECT DISTINCT T1.RepoId FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'ro'
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: What is the repository id of the method with tokenized name "crc parameters get hash code"? repository id refers to RepoId; tokenized name refers to NameTokenized; NameTokenized = 'crc parameters get hash code'; */
SELECT 
SELECT T1.RepoId FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized = 'crc parameters get hash code'
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: How many methods with solutions with path 'maravillas_linq-to-delicious\tasty.sln'? solution refers to SolutionId; */
SELECT 
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'
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: List all the solutions ids of the repository with "636430969128176000" processed time solution ids refers to Solution.Id; */
SELECT 
SELECT T2.Id FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.ProcessedTime = 636430969128176000
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: What is the url for repository that has the longest processed time solution? Url for repository refers to Url; longest processed toe trefers to MAX(ProcessedTime); */
SELECT 
SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.ProcessedTime = ( SELECT MAX(ProcessedTime) FROM Solution )
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: List all the solutions of repositories with the Forks higher than half of the watchers. solutions refers to Solution.Id; forks higher than half of the watchers refers tto Forks>(Watchers/2);; */
SELECT 
SELECT DISTINCT T2.Id FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks > T1.Watchers / 2
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: What is the percentage of Forks to Stars of repository for solution "104086"? solution refers to Solution.Id; Solution.Id = 104086; percentage = MULTIPLY(DIVIDE(Forkk, Stars), 100); */
SELECT 
SELECT CAST(T1.Forks AS REAL) * 100 / T1.Stars FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 104086
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: Please provide the id of the respository that the most people like. repository that the most people like refers to MAX(Stars); */
SELECT 
SELECT Id FROM Repo WHERE Stars = ( SELECT MAX(Stars) FROM Repo )
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: What is the solution's path of method "HtmlSharp.HtmlParser.Feed"? solution's path refers to Path; method refers to Name; Name = 'HtmlSharp.HtmlParser.Feed'; */
SELECT 
SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'HtmlSharp.HtmlParser.Feed'
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: Please provide the number of forks that the repository of the solution 35 have. solution refers to Solution.Id; Solution.Id = 35; */
SELECT 
SELECT T1.Forks FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 35
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: Please provide the id of the solution whose repository has the most watchers. id of the solution refers to Solution.Id; repository has the most watchers refers to MAX(Watchers); */
SELECT 
SELECT T2.Id FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Watchers = ( SELECT MAX(Watchers) FROM Repo )
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: Please provide the number of stars that the repository of the solution 20 have. solution refers to Solution.ID; Solution.Id = 20; */
SELECT 
SELECT T1.Stars FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 20
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: How many methods does solution 1 have? And please tell me if solution 1 needs to be compiled. method refers to Name; solution refers to Solution.Id; Solution.Id = 1; solution needs to be compiled refers to WasCompiled = 0; */
SELECT 
SELECT COUNT(T2.SolutionId) , CASE WHEN T1.WasCompiled = 0 THEN 'Needs' ELSE 'NoNeeds' END needToCompile FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.SolutionId = 1
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: What is the percentage of the methods' solutions that need to be compiled among the methods whose comments is XML format? comment is XML format refers to CommentIsXml = 1; solution needs to be compiled refesr to WasCompiled = 0; percentage = MULTIPLY(DIVIDE(SUM(WasCompiled = 0), COUNT(Solution.Id)), 100); */
SELECT 
SELECT CAST(SUM(CASE WHEN T1.WasCompiled = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.CommentIsXml = 1
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: Please list the names of methods with the solution path "wallerdev_htmlsharp\HtmlSharp.sln". name of the methods refers to Name; solution path refers to Path; Path = 'wallerdev_htmlsharp\HtmlSharp.sln'; */
SELECT 
SELECT T2.Name FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'wallerdev_htmlsharpHtmlSharp.sln'
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: What is the percentage of respositories that receive more than 2,000 stars? stars>2000; percentage = DIVIDE(MULTIPLY(COUNT(Stars>2000), 100), COUNT(Id)); */
SELECT 
SELECT CAST(SUM(CASE WHEN Stars > 2000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Stars) FROM Repo
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: What is the url of solution 1? solution refers to Solution.Id; Solution.Id = 1; */
SELECT 
SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 1
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: Please provide the id of the respository that received the most forks among the respositories that receive 21 stars. repository that received the most forks refers to MAX(Forks); */
SELECT 
SELECT Id FROM Repo WHERE Stars = 21 AND Forks = ( SELECT MAX(Forks) FROM Repo WHERE Stars = 21 )
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: What the percentage of the english methods among the methods whose comments is XML format? english methods refers to lang = 'en'; comment is XML format refers to CommentIsXml = 1; */
SELECT 
SELECT CAST(SUM(CASE WHEN Lang = 'en' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Name) FROM Method WHERE CommentIsXml = 1
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: Please provide the path of solution of method whose tokenized name is html parser feed. path of solution refers to Path; method refers to Name; tokenized name refers to NameTokenized; Name = ''html parser feed'; */
SELECT 
SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized = 'html parser feed'
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: Please provide the solution id of the respository among the respository that receive 238 forks. solution id of the repository refers to solution.Id; */
SELECT 
SELECT T2.Id FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks = 238
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: Among the english methods,please list the tokenized names of methods whose solutions need to be compiled. english methods refers to lang = 'en'; tokenized name refers to NameTokenized; methods refers to Name; solution needs to be compiled refers to WasCompiled = 0; */
SELECT 
SELECT NameTokenized FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE Lang = 'en' AND WasCompiled = 0
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: 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 
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
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: Please provide the path of solution of method whose full comment is Feeds data into the parser. path of solution refers to Path; method refers to name; full comment = 'Feeds data into the parser'; */
SELECT 
SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.FullComment = 'Feeds data into the parser'
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: 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 
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
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: What is the percentage of solutions for the method that needs to be compiled in the English methods? method that needs to be compiled refers to WasCompiled = 0; English method refers to Lang = 'en'; percentage of solutions = MULTIPLY(DIVIDE(SUM(WasCompiled = 0), COUNT(Solution.Id)), 100); */
SELECT 
SELECT CAST(SUM(CASE WHEN T1.WasCompiled = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Lang) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'en'
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: How many more stars in percentage are there for the repository of solution "1" than solution "2"? solution refers to Solution.Id; Solution.Id = 1 OR 2; percentage = DIVIDE(MULTIPLY(SUBTRACT(SUM(Solution.Id = 1), SUM(Solution.Id = 2)), 100)), SUM(Solution.Id = 2); */
SELECT 
SELECT CAST(SUM(CASE WHEN T2.Id = 1 THEN T1.Stars ELSE 0 END) - SUM(CASE WHEN T2.Id = 2 THEN T1.Stars ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 2 THEN T1.Stars ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId
/* Given the following database schema: */
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE "Method"
(
    Id            INTEGER not null
        primary key autoincrement,
    Name          TEXT,
    FullComment   TEXT,
    Summary       TEXT,
    ApiCalls      TEXT,
    CommentIsXml  INTEGER,
    SampledAt     INTEGER,
    SolutionId    INTEGER,
    Lang          TEXT,
    NameTokenized TEXT
)

CREATE TABLE "MethodParameter"
(
    Id       INTEGER not null
        primary key autoincrement,
    MethodId TEXT,
    Type     TEXT,
    Name     TEXT
)

CREATE TABLE Repo
(
    Id            INTEGER not null
        primary key autoincrement,
    Url           TEXT,
    Stars         INTEGER,
    Forks         INTEGER,
    Watchers      INTEGER,
    ProcessedTime INTEGER
)

CREATE TABLE Solution
(
    Id            INTEGER not null
        primary key autoincrement,
    RepoId        INTEGER,
    Path          TEXT,
    ProcessedTime INTEGER,
    WasCompiled   INTEGER
)

/* Answer the following: 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 
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