QIAN-ME/bird_schema_data huggingface dataset:
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 european_football_1
【Schema】
# Table: divisions
[
(division:TEXT, Primary Key, Examples: [B1, D1, D2]),
(name:TEXT, Examples: [Division 1A, Bundesliga, 2. Bundesliga]),
(country:TEXT, Examples: [Belgium, Deutschland, England])
]
# Table: matchs
[
(Div:TEXT, Examples: [B1, D1, D2]),
(Date:DATE, Examples: [2020-08-08]),
(HomeTeam:TEXT, Examples: [Club Brugge, Antwerp, Standard]),
(AwayTeam:TEXT, Examples: [Charleroi, Mouscron, Cercle Brugge]),
(FTHG:INTEGER, Examples: [0, 1, 2]),
(FTAG:INTEGER, Examples: [1, 0, 2]),
(FTR:TEXT, Examples: [A, D, H]),
(season:INTEGER, Examples: [2021, 2020, 2019])
]
【Foreign keys】
matchs.Div=divisions.division

    【Question】
    How many matches were held during the 2021 season's Premier League? Premier League is the name of division;

    【Evidence】
    Premier League is the name of division;

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

SQL: SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T2.name = 'Premier League'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 european_football_1
【Schema】
# Table: divisions
[
(division:TEXT, Primary Key, Examples: [B1, D1, D2]),
(name:TEXT, Examples: [Division 1A, Bundesliga, 2. Bundesliga]),
(country:TEXT, Examples: [Belgium, Deutschland, England])
]
# Table: matchs
[
(Div:TEXT, Examples: [B1, D1, D2]),
(Date:DATE, Examples: [2020-08-08]),
(HomeTeam:TEXT, Examples: [Club Brugge, Antwerp, Standard]),
(AwayTeam:TEXT, Examples: [Charleroi, Mouscron, Cercle Brugge]),
(FTHG:INTEGER, Examples: [0, 1, 2]),
(FTAG:INTEGER, Examples: [1, 0, 2]),
(FTR:TEXT, Examples: [A, D, H]),
(season:INTEGER, Examples: [2021, 2020, 2019])
]
【Foreign keys】
matchs.Div=divisions.division

    【Question】
    Which team was the home team in the match of the Bundesliga division on 2020/10/2? Bundesliga is the name of division; Date = '2020/10/2';

    【Evidence】
    Bundesliga is the name of division; Date = '2020/10/2';

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

SQL: SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-10-02' AND T2.name = 'Bundesliga'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 european_football_1
【Schema】
# Table: divisions
[
(division:TEXT, Primary Key, Examples: [B1, D1, D2]),
(name:TEXT, Examples: [Division 1A, Bundesliga, 2. Bundesliga]),
(country:TEXT, Examples: [Belgium, Deutschland, England])
]
# Table: matchs
[
(Div:TEXT, Examples: [B1, D1, D2]),
(Date:DATE, Examples: [2020-08-08]),
(HomeTeam:TEXT, Examples: [Club Brugge, Antwerp, Standard]),
(AwayTeam:TEXT, Examples: [Charleroi, Mouscron, Cercle Brugge]),
(FTHG:INTEGER, Examples: [0, 1, 2]),
(FTAG:INTEGER, Examples: [1, 0, 2]),
(FTR:TEXT, Examples: [A, D, H]),
(season:INTEGER, Examples: [2021, 2020, 2019])
]
【Foreign keys】
matchs.Div=divisions.division

    【Question】
    Which team won the match of the Bundesliga division on 2020/10/2? Bundesliga is the name of division; Date = '2020/10/2'; won the match refers to FTR = 'H';

    【Evidence】
    Bundesliga is the name of division; Date = '2020/10/2'; won the match refers to FTR = 'H';

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

SQL: SELECT CASE WHEN T1.FTR = 'H' THEN T1.HomeTeam WHEN T1.FTR = 'A' THEN T1.AwayTeam END WINNER FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-10-02' AND T2.name = 'Bundesliga'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 european_football_1
【Schema】
# Table: divisions
[
(division:TEXT, Primary Key, Examples: [B1, D1, D2]),
(name:TEXT, Examples: [Division 1A, Bundesliga, 2. Bundesliga]),
(country:TEXT, Examples: [Belgium, Deutschland, England])
]
# Table: matchs
[
(Div:TEXT, Examples: [B1, D1, D2]),
(Date:DATE, Examples: [2020-08-08]),
(HomeTeam:TEXT, Examples: [Club Brugge, Antwerp, Standard]),
(AwayTeam:TEXT, Examples: [Charleroi, Mouscron, Cercle Brugge]),
(FTHG:INTEGER, Examples: [0, 1, 2]),
(FTAG:INTEGER, Examples: [1, 0, 2]),
(FTR:TEXT, Examples: [A, D, H]),
(season:INTEGER, Examples: [2021, 2020, 2019])
]
【Foreign keys】
matchs.Div=divisions.division

    【Question】
    Which team has the most victories as the home team in matches of the Bundesliga division? Bundesliga is the name of division; the most victories as the home team refers to MAX(COUNT(FTR = 'H'));

    【Evidence】
    Bundesliga is the name of division; the most victories as the home team refers to MAX(COUNT(FTR = 'H'));

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

SQL: SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'H' GROUP BY T1.HomeTeam ORDER BY COUNT(T1.FTR) DESC LIMIT 1
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 european_football_1
【Schema】
# Table: divisions
[
(division:TEXT, Primary Key, Examples: [B1, D1, D2]),
(name:TEXT, Examples: [Division 1A, Bundesliga, 2. Bundesliga]),
(country:TEXT, Examples: [Belgium, Deutschland, England])
]
# Table: matchs
[
(Div:TEXT, Examples: [B1, D1, D2]),
(Date:DATE, Examples: [2020-08-08]),
(HomeTeam:TEXT, Examples: [Club Brugge, Antwerp, Standard]),
(AwayTeam:TEXT, Examples: [Charleroi, Mouscron, Cercle Brugge]),
(FTHG:INTEGER, Examples: [0, 1, 2]),
(FTAG:INTEGER, Examples: [1, 0, 2]),
(FTR:TEXT, Examples: [A, D, H]),
(season:INTEGER, Examples: [2021, 2020, 2019])
]
【Foreign keys】
matchs.Div=divisions.division

    【Question】
    How many times did the team Werder Bremen win as the away team in matches of the Bundesliga division? Bundesliga is the name of division; win as the away team refers to FTR = 'A', where 'A' stands for away victory;

    【Evidence】
    Bundesliga is the name of division; win as the away team refers to FTR = 'A', where 'A' stands for away victory;

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

SQL: SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.AwayTeam = 'Werder Bremen' AND T1.FTR = 'A'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 european_football_1
【Schema】
# Table: divisions
[
(division:TEXT, Primary Key, Examples: [B1, D1, D2]),
(name:TEXT, Examples: [Division 1A, Bundesliga, 2. Bundesliga]),
(country:TEXT, Examples: [Belgium, Deutschland, England])
]
# Table: matchs
[
(Div:TEXT, Examples: [B1, D1, D2]),
(Date:DATE, Examples: [2020-08-08]),
(HomeTeam:TEXT, Examples: [Club Brugge, Antwerp, Standard]),
(AwayTeam:TEXT, Examples: [Charleroi, Mouscron, Cercle Brugge]),
(FTHG:INTEGER, Examples: [0, 1, 2]),
(FTAG:INTEGER, Examples: [1, 0, 2]),
(FTR:TEXT, Examples: [A, D, H]),
(season:INTEGER, Examples: [2021, 2020, 2019])
]
【Foreign keys】
matchs.Div=divisions.division

    【Question】
    How many matches of the Bundesliga division ended with an away victory in the 2021 season? Bundesliga is the name of division; away victory refers to FTR = 'A', where 'A' stands for away victory;

    【Evidence】
    Bundesliga is the name of division; away victory refers to FTR = 'A', where 'A' stands for away victory;

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

SQL: SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'A' AND T1.season = 2021
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 european_football_1
【Schema】
# Table: divisions
[
(division:TEXT, Primary Key, Examples: [B1, D1, D2]),
(name:TEXT, Examples: [Division 1A, Bundesliga, 2. Bundesliga]),
(country:TEXT, Examples: [Belgium, Deutschland, England])
]
# Table: matchs
[
(Div:TEXT, Examples: [B1, D1, D2]),
(Date:DATE, Examples: [2020-08-08]),
(HomeTeam:TEXT, Examples: [Club Brugge, Antwerp, Standard]),
(AwayTeam:TEXT, Examples: [Charleroi, Mouscron, Cercle Brugge]),
(FTHG:INTEGER, Examples: [0, 1, 2]),
(FTAG:INTEGER, Examples: [1, 0, 2]),
(FTR:TEXT, Examples: [A, D, H]),
(season:INTEGER, Examples: [2021, 2020, 2019])
]
【Foreign keys】
matchs.Div=divisions.division

    【Question】
    Of the matches in all seasons of the Bundesliga division, how many of them ended with a tie? Bundesliga is the name of division; tie refers to FTR = 'D', where D stands for draft;

    【Evidence】
    Bundesliga is the name of division; tie refers to FTR = 'D', where D stands for draft;

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

SQL: SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'D'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 european_football_1
【Schema】
# Table: divisions
[
(division:TEXT, Primary Key, Examples: [B1, D1, D2]),
(name:TEXT, Examples: [Division 1A, Bundesliga, 2. Bundesliga]),
(country:TEXT, Examples: [Belgium, Deutschland, England])
]
# Table: matchs
[
(Div:TEXT, Examples: [B1, D1, D2]),
(Date:DATE, Examples: [2020-08-08]),
(HomeTeam:TEXT, Examples: [Club Brugge, Antwerp, Standard]),
(AwayTeam:TEXT, Examples: [Charleroi, Mouscron, Cercle Brugge]),
(FTHG:INTEGER, Examples: [0, 1, 2]),
(FTAG:INTEGER, Examples: [1, 0, 2]),
(FTR:TEXT, Examples: [A, D, H]),
(season:INTEGER, Examples: [2021, 2020, 2019])
]
【Foreign keys】
matchs.Div=divisions.division

    【Question】
    How many home victories does the Bundesliga division have in more or less than the Premier League division in the 2021 season? Bundesliga and the Premier League are names of division; home victories refer to FTR = 'H', where H stands for home victory; SUBTRACT(COUNT(FTR = 'H' where season = 2021, name = 'Bundesliga'), COUNT(FTR = 'H' where season = 2021, name = 'Premier League'));

    【Evidence】
    Bundesliga and the Premier League are names of division; home victories refer to FTR = 'H', where H stands for home victory; SUBTRACT(COUNT(FTR = 'H' where season = 2021, name = 'Bundesliga'), COUNT(FTR = 'H' where season = 2021, name = 'Premier League'));

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

SQL: SELECT COUNT(CASE WHEN T2.name = 'Bundesliga' THEN 1 ELSE NULL END) - COUNT(CASE WHEN T2.name = 'Premier League' THEN 1 ELSE NULL END) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.FTR = 'H'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 european_football_1
【Schema】
# Table: divisions
[
(division:TEXT, Primary Key, Examples: [B1, D1, D2]),
(name:TEXT, Examples: [Division 1A, Bundesliga, 2. Bundesliga]),
(country:TEXT, Examples: [Belgium, Deutschland, England])
]
# Table: matchs
[
(Div:TEXT, Examples: [B1, D1, D2]),
(Date:DATE, Examples: [2020-08-08]),
(HomeTeam:TEXT, Examples: [Club Brugge, Antwerp, Standard]),
(AwayTeam:TEXT, Examples: [Charleroi, Mouscron, Cercle Brugge]),
(FTHG:INTEGER, Examples: [0, 1, 2]),
(FTAG:INTEGER, Examples: [1, 0, 2]),
(FTR:TEXT, Examples: [A, D, H]),
(season:INTEGER, Examples: [2021, 2020, 2019])
]
【Foreign keys】
matchs.Div=divisions.division

    【Question】
    Please list the home teams in the matches of the Bundesliga division that ended with a home victory in the 2021 season. Bundesliga is the name of division; home victory refers to refer to FTR = 'H', where H stands for home victory;

    【Evidence】
    Bundesliga is the name of division; home victory refers to refer to FTR = 'H', where H stands for home victory;

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

SQL: SELECT DISTINCT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.FTR = 'H' AND T2.name = 'Bundesliga'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 european_football_1
【Schema】
# Table: divisions
[
(division:TEXT, Primary Key, Examples: [B1, D1, D2]),
(name:TEXT, Examples: [Division 1A, Bundesliga, 2. Bundesliga]),
(country:TEXT, Examples: [Belgium, Deutschland, England])
]
# Table: matchs
[
(Div:TEXT, Examples: [B1, D1, D2]),
(Date:DATE, Examples: [2020-08-08]),
(HomeTeam:TEXT, Examples: [Club Brugge, Antwerp, Standard]),
(AwayTeam:TEXT, Examples: [Charleroi, Mouscron, Cercle Brugge]),
(FTHG:INTEGER, Examples: [0, 1, 2]),
(FTAG:INTEGER, Examples: [1, 0, 2]),
(FTR:TEXT, Examples: [A, D, H]),
(season:INTEGER, Examples: [2021, 2020, 2019])
]
【Foreign keys】
matchs.Div=divisions.division

    【Question】
    Which team had more home victories in the 2021 season's matches of the Bundesliga division, Augsburg or Mainz? Bundesliga is the name of division; more home victories refer to MAX(FTR = 'H)'; Augsburg and Mainz are names of teams and refer to HomeTeam;

    【Evidence】
    Bundesliga is the name of division; more home victories refer to MAX(FTR = 'H)'; Augsburg and Mainz are names of teams and refer to HomeTeam;

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

SQL: SELECT CASE WHEN COUNT(CASE WHEN T1.HomeTeam = 'Augsburg' THEN 1 ELSE NULL END) - COUNT(CASE WHEN T1.HomeTeam = ' Mainz' THEN 1 ELSE NULL END) > 0 THEN 'Augsburg' ELSE 'Mainz' END FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.FTR = 'H'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 european_football_1
【Schema】
# Table: divisions
[
(division:TEXT, Primary Key, Examples: [B1, D1, D2]),
(name:TEXT, Examples: [Division 1A, Bundesliga, 2. Bundesliga]),
(country:TEXT, Examples: [Belgium, Deutschland, England])
]
# Table: matchs
[
(Div:TEXT, Examples: [B1, D1, D2]),
(Date:DATE, Examples: [2020-08-08]),
(HomeTeam:TEXT, Examples: [Club Brugge, Antwerp, Standard]),
(AwayTeam:TEXT, Examples: [Charleroi, Mouscron, Cercle Brugge]),
(FTHG:INTEGER, Examples: [0, 1, 2]),
(FTAG:INTEGER, Examples: [1, 0, 2]),
(FTR:TEXT, Examples: [A, D, H]),
(season:INTEGER, Examples: [2021, 2020, 2019])
]
【Foreign keys】
matchs.Div=divisions.division

    【Question】
    Which team had the most final-time home-team goals in the 2021 season's matches of the Bundesliga division? Bundesliga is the name of division; the most final-time home-team goals refers to MAX(FTHG);

    【Evidence】
    Bundesliga is the name of division; the most final-time home-team goals refers to MAX(FTHG);

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

SQL: SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.season = 2021 ORDER BY T1.FTHG DESC LIMIT 1
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 european_football_1
【Schema】
# Table: divisions
[
(division:TEXT, Primary Key, Examples: [B1, D1, D2]),
(name:TEXT, Examples: [Division 1A, Bundesliga, 2. Bundesliga]),
(country:TEXT, Examples: [Belgium, Deutschland, England])
]
# Table: matchs
[
(Div:TEXT, Examples: [B1, D1, D2]),
(Date:DATE, Examples: [2020-08-08]),
(HomeTeam:TEXT, Examples: [Club Brugge, Antwerp, Standard]),
(AwayTeam:TEXT, Examples: [Charleroi, Mouscron, Cercle Brugge]),
(FTHG:INTEGER, Examples: [0, 1, 2]),
(FTAG:INTEGER, Examples: [1, 0, 2]),
(FTR:TEXT, Examples: [A, D, H]),
(season:INTEGER, Examples: [2021, 2020, 2019])
]
【Foreign keys】
matchs.Div=divisions.division

    【Question】
    How many final-time home-team goals were there in total in all the matches of the Bundesliga division in the 2021 season? Bundesliga is the name of division; final-time home-team goals refers to FTHG;

    【Evidence】
    Bundesliga is the name of division; final-time home-team goals refers to FTHG;

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

SQL: SELECT SUM(T1.FTHG) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.season = 2021
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 european_football_1
【Schema】
# Table: divisions
[
(division:TEXT, Primary Key, Examples: [B1, D1, D2]),
(name:TEXT, Examples: [Division 1A, Bundesliga, 2. Bundesliga]),
(country:TEXT, Examples: [Belgium, Deutschland, England])
]
# Table: matchs
[
(Div:TEXT, Examples: [B1, D1, D2]),
(Date:DATE, Examples: [2020-08-08]),
(HomeTeam:TEXT, Examples: [Club Brugge, Antwerp, Standard]),
(AwayTeam:TEXT, Examples: [Charleroi, Mouscron, Cercle Brugge]),
(FTHG:INTEGER, Examples: [0, 1, 2]),
(FTAG:INTEGER, Examples: [1, 0, 2]),
(FTR:TEXT, Examples: [A, D, H]),
(season:INTEGER, Examples: [2021, 2020, 2019])
]
【Foreign keys】
matchs.Div=divisions.division

    【Question】
    What's the winning rate of Club Brugge in the 2021 Premier League? Premier League is name of division; season = 2021; Club Brugge is name of team; Club Brugge wins implies HomeTeam = 'Club Brugge' and FTR = 'H' and AwayTeam = 'Club Brugge' and FTR = 'A'; DIVIDE(SUM(COUNT(FTR = 'H' where HomeTeam = 'Club Brugge', name = 'Premier League', season = 2021), COUNT(FTR = 'A'where AwayTeam = 'Club Brugge', name = 'Premier League', season = 2021)), COUNT(Div where name = 'Premier League', season = 2021));

    【Evidence】
    Premier League is name of division; season = 2021; Club Brugge is name of team; Club Brugge wins implies HomeTeam = 'Club Brugge' and FTR = 'H' and AwayTeam = 'Club Brugge' and FTR = 'A'; DIVIDE(SUM(COUNT(FTR = 'H' where HomeTeam = 'Club Brugge', name = 'Premier League', season = 2021), COUNT(FTR = 'A'where AwayTeam = 'Club Brugge', name = 'Premier League', season = 2021)), COUNT(Div where name = 'Premier League', season = 2021));

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

SQL: SELECT CAST(COUNT(CASE WHEN T1.FTR = 'H' THEN 1 ELSE NULL END) + COUNT(CASE WHEN T1.FTR = 'A' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(t1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.AwayTeam = 'Club Brugge' OR T1.HomeTeam = 'Club Brugge'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 shakespeare
【Schema】
# Table: works
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Title:TEXT, Examples: [Twelfth Night]),
(LongTitle:TEXT, Examples: [Twelfth Night, Or What You Will]),
(Date:INTEGER, Examples: [1599, 1602, 1606]),
(GenreType:TEXT, Examples: [Comedy, Tragedy, History])
]
# Table: characters
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(CharName:TEXT, Examples: [First Apparition, First Citizen, First Conspirator]),
(Abbrev:TEXT, Examples: [First Apparition, First Citizen, First Conspirator]),
(Description:TEXT, Examples: [A senator of Venice])
]
# Table: paragraphs
[
(id:INTEGER, Primary Key, Examples: [630863, 630864, 630865]),
(ParagraphNum:INTEGER, Examples: [3, 4, 19]),
(PlainText:TEXT),
(character_id:INTEGER, Examples: [1261, 840, 297]),
(chapter_id:INTEGER, Examples: [18704, 18705, 18706])
]
# Table: chapters
[
(id:INTEGER, Primary Key, Examples: [18704, 18705, 18706]),
(Act:INTEGER, Examples: [1, 2, 3]),
(Scene:INTEGER, Examples: [1, 2, 3]),
(Description:TEXT, Examples: [DUKE ORSINO’s palace.]),
(work_id:INTEGER, Examples: [1, 2, 3])
]
【Foreign keys】
paragraphs.chapter_id=chapters.id
paragraphs.character_id=characters.id
chapters.work_id=works.id

    【Question】
    How many of Shakespeare's works were finished before the year 1602? finished before the year 1602 refers to Date < 1602

    【Evidence】
    finished before the year 1602 refers to Date < 1602

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

SQL: SELECT COUNT(id) FROM works WHERE Date < 1602
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 shakespeare
【Schema】
# Table: works
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Title:TEXT, Examples: [Twelfth Night]),
(LongTitle:TEXT, Examples: [Twelfth Night, Or What You Will]),
(Date:INTEGER, Examples: [1599, 1602, 1606]),
(GenreType:TEXT, Examples: [Comedy, Tragedy, History])
]
# Table: characters
[
(id:INTEGER, Primary Key, Examples: [1, 2, 3]),
(CharName:TEXT, Examples: [First Apparition, First Citizen, First Conspirator]),
(Abbrev:TEXT, Examples: [First Apparition, First Citizen, First Conspirator]),
(Description:TEXT, Examples: [A senator of Venice])
]
# Table: paragraphs
[
(id:INTEGER, Primary Key, Examples: [630863, 630864, 630865]),
(ParagraphNum:INTEGER, Examples: [3, 4, 19]),
(PlainText:TEXT),
(character_id:INTEGER, Examples: [1261, 840, 297]),
(chapter_id:INTEGER, Examples: [18704, 18705, 18706])
]
# Table: chapters
[
(id:INTEGER, Primary Key, Examples: [18704, 18705, 18706]),
(Act:INTEGER, Examples: [1, 2, 3]),
(Scene:INTEGER, Examples: [1, 2, 3]),
(Description:TEXT, Examples: [DUKE ORSINO’s palace.]),
(work_id:INTEGER, Examples: [1, 2, 3])
]
【Foreign keys】
paragraphs.chapter_id=chapters.id
paragraphs.character_id=characters.id
chapters.work_id=works.id

    【Question】
    How many scenes are there in Act 1 in Twelfth Night? Twelfth Night refers to Title = 'Twelfth Night'

    【Evidence】
    Twelfth Night refers to Title = 'Twelfth Night'

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

SQL: SELECT COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = 1 AND T1.Title = 'Twelfth Night'