db_id
stringclasses
68 values
question
stringlengths
24
325
evidence
stringlengths
0
580
SQL
stringlengths
23
728
professional_basketball
How many games did team of the scoring champion win in 2001 NBA season?
the scoring champion refers to max(won); 2001 refers to year = 2001; NBA refers to lgID = 'NBA'
SELECT T2.W FROM teams AS T1 INNER JOIN series_post AS T2 ON T1.tmID = T2.tmIDLoser AND T1.year = T2.year WHERE T2.year = 2001 ORDER BY T1.o_fgm DESC LIMIT 1
professional_basketball
What is the number of NBA titles that Ray Allen has won throughout his NBA career?
NBA refers to lgID = 'NBA'
SELECT COUNT(T1.playerID) FROM player_allstar AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE first_name = 'Ray' AND last_name = 'Allen'
professional_basketball
How much did the win rate increase for the team after getting the No.1 NBA draft pick in the 2003 season than previous season?
No.1 draft pick refers to draftRound = 1; in the 2003 season refers to draftyear = 2003; increase = subtract(divide(sum(won), add(sum(won), sum(lost))) where draftyear = 2004, divide(sum(won), add(sum(won), sum(lost))) where draftyear = 2003)
SELECT (CAST(SUM(CASE WHEN T1.year = 2004 THEN T1.won ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.year = 2004 THEN T1.won + T1.lost ELSE 0 END)) - (CAST(SUM(CASE WHEN T1.year = 2003 THEN T1.won ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.year = 2003 THEN T1.won + T1.lost ELSE 0 END)) FROM teams AS T1 INNER JOIN draft AS T2 ON T1.tmID = T2.tmID WHERE T2.draftRound = 1 AND T2.draftYear = 2003
professional_basketball
Among the coaches who won the 'NBA coach of the year' award from 1971 - 1975, how many of them were in 'POR' team?
the 'NBA coach of the year' award refers to award = 'NBA coach of the year'; from 1971 - 1975 refers to year between 1971 and 1975; 'POR' team refers to tmID = 'POR'
SELECT COUNT(T1.id) FROM awards_coaches AS T1 INNER JOIN teams AS T2 ON T1.year = T2.year WHERE T1.year BETWEEN 1971 AND 1975 AND T1.award = 'NBA Coach of the Year' AND T2.tmID = 'POR'
professional_basketball
Which NBA team that didn't play in playoffs had the most winning rate in the 2000 NBA regular season?
NBA refers to lgID = 'NBA'; didn't play in the playoffs refers to PostGP = 0; 2000 refers to year = 2000; the most winning rate refers to max(divide(won, add(won, lost)))
SELECT T2.tmID FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.PostGP = 0 AND T1.year = 2000 ORDER BY CAST(T2.won AS REAL) / (T2.won + T2.lost) DESC LIMIT 1
professional_basketball
Which non-playoffs team had the most points in the regular season in the year 1998?
non-playoff refers to PostGP = 0; in the year 1998 refers to year = 1998; the most points refers to max(o_pts)
SELECT T2.tmID FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 1998 AND T1.PostGP = 0 ORDER BY T1.points DESC LIMIT 1
professional_basketball
What's the full name of the team that won the most games in 2001 but didn't make the playoffs?
full name of the team refers to teams.name; in 2001 refers to year = 2001; didn't make the playoffs refers to PostGP = 0; won the most games refers to max(won)
SELECT T2.tmID FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.PostGP = 0 ORDER BY T2.won DESC LIMIT 1
professional_basketball
Which team that didn't play in playoffs had the most total rebounds in the year 1997?
didn't play in playoffs refers to PostGP = 0; in the year 1997 refers to year = 1997; the most total rebounds refers to max(o_tmRebound)
SELECT T2.tmID FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.PostGP = 0 AND T1.year = 1997 ORDER BY T1.rebounds DESC LIMIT 1
professional_basketball
For the player who was drafted in the 1st round, 6th position in 1976, which team did he play in that year?
drafted in the 1st round refers to draftRound = 1; 6th position refers to draftSelection = 6; in 1976 refers to year = 1976; team refers to tmID
SELECT T2.tmID FROM draft AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.draftYear = T2.year WHERE T1.draftRound = 1 AND T1.draftSelection = 6 AND T1.draftYear = 1976
professional_basketball
In the year 1998, how many home wins did the team which had the 1st round, 12th pick have that year?
in 1998 refers to year = 1998; 1st round refers to draftRound = 1; 12th pick refers to draftSelection = 12; home win refers to homeWon
SELECT T2.homeWon FROM draft AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.draftYear = T2.year WHERE T1.draftRound = 1 AND T1.draftSelection = 12 AND T1.draftYear = 1998
professional_basketball
In the year 1997 allstar game, which teams did the players had the most rebounds play in? List their team ids.
in 1997 refers to year = 1997; the most rebounds refers to max(rebounds); team id refers to tmID
SELECT T2.tmID FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN player_allstar AS T3 ON T3.playerID = T1.playerID WHERE T3.season_id = 1997 ORDER BY T1.rebounds DESC LIMIT 1
professional_basketball
In 2000, which team did the player who played the least minutes without missing a single game play in? Give the full name of the team.
in 2000 refers to year = 2000; played the least minutes refers to min(minutes); without missing a single game refers to GP = 82; full name of the team refers to teams.name
SELECT T1.tmID FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T2.GP = 82 AND T2.year = 2000 GROUP BY T1.tmID ORDER BY SUM(T2.PostMinutes) ASC LIMIT 1
professional_basketball
For the player in 2011 who started every game he played, which team had the player who had the most steals?
in 2011 refers to year = 2011; started every game refers to GP = GS; the most steals refers to max(steals); team refers to tmID
SELECT T1.tmID FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 2011 AND T2.GP = T2.GS GROUP BY T1.tmID, T2.steals ORDER BY T2.steals DESC LIMIT 1
professional_basketball
Which team had the most same starting players througout the season? Give the full name of the team.
the same starting player refers to GP = GS; full name of the team refers to teams.name
SELECT DISTINCT T1.tmID FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T2.GP = T2.GS
professional_basketball
Which team did the all league rebound champion play in 1997? Give the full name of the team.
rebound champion refers to max(rebounds); 1997 refers to 1997; full name refers to teams.name
SELECT T1.name FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T2.year = 1997 GROUP BY T1.name ORDER BY SUM(rebounds + dRebounds) DESC LIMIT 1
professional_basketball
Which team had more than one player who grabbed more than 600 rebounds in 2011? Give the full name of the team.
more than one player refers to count(playerID) > 1; grabbed more than 600 rebounds refers to rebounds > 600; in 2011 refers to 2011; full name refers to teams.name
SELECT T1.tmID FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 2011 AND T2.rebounds > 600
shakespeare
How many of Shakespeare's works were finished before the year 1602?
finished before the year 1602 refers to Date < 1602
SELECT COUNT(id) FROM works WHERE Date < 1602
shakespeare
How many scenes are there in Act 1 in Twelfth Night?
Twelfth Night refers to Title = 'Twelfth Night'
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'
shakespeare
What is the description of Act 1, Scene 2 in Twelfth Night?
Twelfth Night refers to Title = 'Twelfth Night'
SELECT T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Twelfth Night' AND T2.Act = 1 AND T2.Scene = 2
shakespeare
Which work is the character Lord Abergavenny from? Please give its short or abbreviated title.
Lord Abergavenny refers to CharName = 'Lord Abergavenny'; short or abbreviated title refers to Title
SELECT DISTINCT T1.Title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T4.CharName = 'Lord Abergavenny'
shakespeare
Please list the character names of all the characters from the work Twelfth Night.
character names refers to CharName; Twelfth Night refers to Title = 'Twelfth Night'
SELECT DISTINCT T4.CharName FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.Title = 'Twelfth Night'
shakespeare
How many paragraphs are there in Act 1, Scene 1 in Twelfth Night?
Twelfth Night refers to Title = 'Twelfth Night'
SELECT SUM(T3.ParagraphNum) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T2.Act = 1 AND T2.Scene = 1 AND T1.Title = 'Twelfth Night'
shakespeare
Please list all the paragraphs in Act 1, Scene 1 in Twelfth Night.
Twelfth Night refers to Title = 'Twelfth Night'; list the paragraphs refers to PlainText
SELECT T3.PlainText FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T2.Act = 1 AND T2.Scene = 1 AND T1.Title = 'Twelfth Night'
shakespeare
How many paragraphs contain the character Lord Abergavenny?
Lord Abergavenny refers to CharName = 'Lord Abergavenny'
SELECT SUM(T1.ParagraphNum) FROM paragraphs AS T1 INNER JOIN characters AS T2 ON T1.character_id = T2.id WHERE T2.CharName = 'Lord Abergavenny'
shakespeare
Please list the IDs of the paragraphs in which the character "son to Tamora" appears.
character "son to Tamora"  refers to characters.Description = 'son to Tamora'
SELECT T1.id FROM paragraphs AS T1 INNER JOIN characters AS T2 ON T1.character_id = T2.id WHERE T2.Description = 'son to Tamora'
shakespeare
For how many times has the scene "OLIVIA’S house." appeared in Twelfth Night?
"OLIVIA’S house."  refers to chapters.Description = 'OLIVIA’S house.'; Twelfth Night refers to Title = 'Twelfth Night'
SELECT COUNT(T2.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Description = 'OLIVIA’S house.' AND T1.Title = 'Twelfth Night'
shakespeare
How many characters are there in Twelfth Night?
Twelfth Night refers to Title = 'Twelfth Night'
SELECT COUNT(DISTINCT T4.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.Title = 'Twelfth Night'
shakespeare
Please give the title of the work of Shakespeare that has the most characters.
most characters refers to max(count(character_id))
SELECT T.Title FROM ( SELECT T1.Title, COUNT(T3.character_id) AS num FROM works T1 INNER JOIN chapters T2 ON T1.id = T2.work_id INNER JOIN paragraphs T3 ON T2.id = T3.chapter_id INNER JOIN characters T4 ON T3.character_id = T4.id GROUP BY T3.character_id, T1.Title ) T ORDER BY T.num DESC LIMIT 1
shakespeare
What is the average number of characters in all the works of Shakespeare?
average number = divide(sum(character_id), count(work_id))
SELECT SUM(DISTINCT T4.id) / COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id
shakespeare
How many scenes are there on average in one act in Twelfth Night?
Twelfth Night refers to Title = 'Twelfth Night'; average scene = divide(sum(Scene), count(Act))
SELECT SUM(T2.Scene) / COUNT(T2.Act) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Twelfth Night'
shakespeare
How many comedies did Shakespeare create?
comedies refers to GenreType = 'Comedy'
SELECT COUNT(id) FROM works WHERE GenreType = 'Comedy'
shakespeare
When did Shakespeare write the first poem?
first poem refers to GenreType = 'Poem' and Date = 'min'
SELECT MIN(Date) FROM works WHERE GenreType = 'Poem'
shakespeare
Give the abbreviation name for the character "Earl of Westmoreland".
abbreviation name refers to Abbrev; character "Earl of Westmoreland" refers to CharName = 'Earl of Westmoreland'
SELECT DISTINCT Abbrev FROM characters WHERE CharName = 'Earl of Westmoreland'
shakespeare
Which chapter has the most paragraphs? Give the description of the chapter.
most paragraphs refers to max(count(chapter_id))
SELECT T1.Description FROM chapters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.chapter_id ORDER BY T2.ParagraphNum DESC LIMIT 1
shakespeare
How many characters are there in Titus Andronicus?
Titus Andronicus refers to Title = 'Titus Andronicus'
SELECT COUNT(DISTINCT T3.character_id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T1.Title = 'Titus Andronicus'
shakespeare
What is the description for the character mentioned in paragraph No.640171?
paragraph No.640171 refers to paragraphs.id = '640171'
SELECT T1.Description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.id = '640171'
shakespeare
Give the title of the work that contains the character "Shylock".
character "Shylock" refers to CharName = 'Shylock'
SELECT DISTINCT T1.Title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T4.CharName = 'Shylock'
shakespeare
How many scenes are there in King John?
King John refers to Title = 'King John'
SELECT COUNT(T2.Scene) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'King John'
shakespeare
How many chapters does the character Demetrius show in the story?
character Demetrius refers to CharName = 'Demetrius'
SELECT COUNT(DISTINCT T2.chapter_id) FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Demetrius'
shakespeare
Give the description for the Act No.2, Scene No.2 of Midsummer Night's Dream.
Act No.2 refers to Act = '2'; Scene No.2  refers to Scene = '2'; Midsummer Night's Dream refers to Title = 'Midsummer Night''s Dream'
SELECT T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = '2' AND T2.Scene = '2' AND T1.Title = 'Midsummer Night''s Dream'
shakespeare
Which Shakespeare tragedy has the most scenes? Give the long title.
tragedy refers to GenreType = 'Tragedy'; most scenes refers to max(count(Scene))
SELECT T.LongTitle FROM ( SELECT T1.LongTitle, COUNT(T2.Scene) AS num FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.GenreType = 'Tragedy' GROUP BY T1.LongTitle, T2.Scene ) AS T ORDER BY T.num DESC LIMIT 1
shakespeare
How many paragraphs are there in the scene whose description is "A Sea-port in Cyprus. An open place near the quay."?
SELECT SUM(T2.ParagraphNum) FROM chapters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.chapter_id WHERE T1.Description = 'A Sea-port in Cyprus. An open place near the quay.'
shakespeare
Gives the average number of chapters in Shakespeare's 1599 work.
1599 work refers to Date = '1599'; average number refers to divide(count(chapters.id), count(works.id))
SELECT CAST(COUNT(T1.id) AS REAL) / COUNT(DISTINCT T2.id) FROM chapters AS T1 INNER JOIN works AS T2 ON T1.work_id = T2.id WHERE T2.Date = '1599'
shakespeare
How many "servant to Timon" characters are there?
servant to Timon refers to characters.Description = 'servant to Timon'
SELECT COUNT(id) FROM characters WHERE Description = 'servant to Timon'
shakespeare
What is the title of the first ever work of William Shakespeare?
first ever work refers to min(Date)
SELECT Title FROM works WHERE Date = ( SELECT MIN(Date) FROM works )
shakespeare
How many poems did Shakespeare write?
poems refers to GenreType = 'Poem'
SELECT COUNT(id) FROM works WHERE GenreType = 'Poem'
shakespeare
How many scenes are there in work id 7, act 1?
SELECT COUNT(id) FROM chapters WHERE work_id = 7 AND Act = 1
shakespeare
In the year 1500s, how many tragedies did Shakespeare write?
year 1500s refers to Date between 1500 and 1599; tragedies refers to GenreType = 'Tragedy'
SELECT COUNT(id) FROM works WHERE GenreType = 'Tragedy' AND Date BETWEEN 1500 AND 1599
shakespeare
Who is the daughter of Capulet?
daughter of Capulet refers to characters.Description = 'Daughter to Capulet'
SELECT CharName FROM characters WHERE Description = 'Daughter to Capulet'
shakespeare
How many paragraphs are there in "Ay, surely, mere the truth: I know his lady."?
"Ay, surely, mere the truth: I know his lady." refers to PlainText = 'Ay, surely, mere the truth: I know his lady.'
SELECT ParagraphNum FROM paragraphs WHERE PlainText = 'Ay, surely, mere the truth: I know his lady.'
shakespeare
What is the long title of the work with the highest number of scenes in act 1?
highest number of scenes refers to max(count(Scene))
SELECT T2.LongTitle FROM chapters AS T1 INNER JOIN works AS T2 ON T1.work_id = T2.id WHERE T1.Act = 1 ORDER BY T1.Scene DESC LIMIT 1
shakespeare
What is the description of the chapter with the longest number of paragraphs?
chapter with the longest number of paragraphs refers to max(ParagraphNum)
SELECT T2.Description FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id ORDER BY T1.ParagraphNum DESC LIMIT 1
shakespeare
In "Twelfth Night, Or What You Will", what is the description of the chapter in 2nd scene, Act 2?
"Twelfth Night, Or What You Will"  refers to LongTitle = 'Twelfth Night, Or What You Will'; 2nd scene refers to Scene = 2
SELECT T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.LongTitle = 'Twelfth Night, Or What You Will' AND T2.Scene = 2 AND T2.Act = 2
shakespeare
What are the descriptions of the short chapters?
short chapters refers to ParagraphNum < 150
SELECT DISTINCT T2.Description FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id WHERE T1.ParagraphNum < 150
shakespeare
Which of Shakespeare's work has chapter description of "A field near Windsor"?
SELECT T2.Title FROM chapters AS T1 INNER JOIN works AS T2 ON T1.work_id = T2.id WHERE T1.Description = 'A field near Windsor.'
shakespeare
How many paragraphs are there in the chapter with the highest amount of scenes in act 1?
How many paragraphs refers to ParagraphNum; highest amount of scenes refers to max(count(Scene))
SELECT T1.ParagraphNum FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id WHERE T2.Act = 1 ORDER BY T2.Scene DESC LIMIT 1
shakespeare
Other than "stage directions", what is the name of the character that appeared 5 times in "the sea-coast"?
Other than "stage directions" refers to CharName ! = '(stage directions)'; name of the character refers to CharName; appeared 5 times in "the sea-coast" refers to chapters.Description = 'The sea-coast.' and count(character_id) = 5
SELECT T.CharName FROM ( SELECT T3.CharName, COUNT(T3.id) AS num FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id INNER JOIN characters AS T3 ON T1.character_id = T3.id WHERE T2.Description = 'The sea-coast.' AND T3.CharName != '(stage directions)' AND T1.chapter_id = 18709 GROUP BY T3.id, T3.CharName ) AS T WHERE T.num = 5
shakespeare
Among the chapters in "As You Like It", how many chapters have a paragraph number of no more than 50?
"As You Like It" refers to Title = 'As You Like It' ;paragraph number of no more than 50 refers to ParagraphNum < 50
SELECT COUNT(T3.chapter_id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T1.Title = 'As You Like It' AND T3.ParagraphNum < 50
shakespeare
In "Florence. Without the walls. A tucket afar off", what is the id of the character that was mentioned in "His name, I pray you."?
"Florence. Without the walls. A tucket afar off" refers to chapters.Description = 'Florence. Without the walls. A tucket afar off.'; "His name, I pray you." refers to PlainText = 'His name, I pray you.'
SELECT T1.character_id FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id WHERE T1.PlainText = 'His name, I pray you.' AND T2.Description = 'Florence. Without the walls. A tucket afar off.'
shakespeare
How many characters are there in Hamlet?
Hamlet refers to Title = 'Hamlet'
SELECT COUNT(DISTINCT T3.character_id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T1.Title = 'Hamlet'
shakespeare
How many scenes are there in the 5th act of "History of Henry VIII"?
5th act refers to Act = 5; "History of Henry VIII" refers to LongTitle = 'History of Henry VIII'
SELECT SUM(T2.Scene) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = 5 AND T1.LongTitle = 'History of Henry VIII'
shakespeare
Among the history works written by Shakespeare, how many works whose 1st acts have no more than 2 scenes?
history refers to GenreType = 'History' ; 1st acts  refers to Act = 1; no more than 2 scenes refers to count(Scene) < 2
SELECT COUNT(DISTINCT T2.work_id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = 1 AND T2.Scene < 2 AND T1.GenreType = 'History'
shakespeare
How many acts are there in Sonnets?
Sonnets refers to Title = 'Sonnets'
SELECT SUM(DISTINCT T2.Act) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Sonnets'
shakespeare
What is the description of the chapter where the character whose abrreviated name is 1Play appeared first?
abbreviated name is 1Play; appeared first refers to Abbrev = '1Play' and min(chapter_id)
SELECT T2.Description FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id INNER JOIN characters AS T3 ON T1.character_id = T3.id WHERE T3.Abbrev = '1Play' ORDER BY T1.chapter_id LIMIT 1
shakespeare
What are the titles and genres of the one-act works of Shakespeare?
one-act works refers to count(Act) = 1; genre refers to GenreType
SELECT DISTINCT T1.Title, T1.GenreType FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = 1
shakespeare
How many paragraphs are there in the longest chapter where Sir Richard Ratcliff appeared?
longest chapter refers to max(ParagraphNum); Sir Richard Ratcliff  refers to CharName = 'Sir Richard Ratcliff'
SELECT MAX(T2.ParagraphNum) FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Sir Richard Ratcliff'
shakespeare
When did Shakespeare create his work that has 154 scenes?
When refers to Date; has 154 scenes refers to count(Scene) = 154
SELECT T1.Date, T1.id FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Scene = 154
shakespeare
On average, how many scenes are there in each of the comedy works written by Shakespeare?
comedy refers to GenreType = 'Comedy'; average = divide(sum(count(Scene)), count(work.id))
SELECT CAST(SUM(T2.Scene) AS REAL) / COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.GenreType = 'Comedy'
shakespeare
What is the paragraph number with plain text "This is Illyria, lady"?
paragraph number refers to ParagraphNum
SELECT ParagraphNum FROM paragraphs WHERE PlainText = 'This is Illyria, lady.'
shakespeare
How many number of paragraphs are there in chapter ID 18881?
number of paragraphs refers to ParagraphNum
SELECT COUNT(ParagraphNum) FROM paragraphs WHERE chapter_id = 18881
shakespeare
List down any 5 titles in the history genre.
in the history genre refers to GenreType = 'History'
SELECT Title FROM works WHERE GenreType = 'History' LIMIT 5
shakespeare
How many scenes are there in Act 5 of work ID 9?
SELECT COUNT(Scene) FROM chapters WHERE work_id = 9 AND Act = 5
shakespeare
List the character names and descriptions of chapter ID 18710.
character names refers to CharName
SELECT DISTINCT T1.CharName, T1.Description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.Chapter_id = 18710
shakespeare
How many chapters are there in "Midsummer Night's Dream"?
in "Midsummer Night's Dream" refers to Title = 'Midsummer Night's Dream'
SELECT COUNT(T2.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Midsummer Night''s Dream'
shakespeare
How many paragraphs are there in Act 5 Scene 1 of "Comedy of Errors"?
"Comedy of Errors" refers to Title = 'Comedy of Errors'
SELECT COUNT(T3.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T2.Act = 5 AND T2.Scene = 1 AND T1.Title = 'Comedy of Errors'
shakespeare
What are the character names and descriptions of characters in "Venus and Adonis"?
character names refers to CharName; "Venus and Adonis" refers to Title = 'Venus and Adonis'
SELECT DISTINCT T4.CharName, T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.Title = 'Venus and Adonis'
shakespeare
What is the title which has character named "Froth"?
character named "Froth" refers to CharName = 'Froth'
SELECT DISTINCT T1.title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T4.CharName = 'Froth'
shakespeare
How many chapters include the character name "First Witch"?
character name "First Witch" refers to CharName = 'First Witch'
SELECT COUNT(T2.chapter_id) FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'First Witch'
shakespeare
List the scenes and descriptions in Act 1 of " Pericles, Prince of Tyre".
" Pericles, Prince of Tyre" refers to LongTitle = 'Pericles, Prince of Tyre'
SELECT T2.Scene, T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.LongTitle = 'Pericles, Prince of Tyre' AND T2.Act = 1
shakespeare
Describe the full title which had the character named Servant to Montague.
full title refers to LongTitle; character named Servant to Montague refers to characters.Description = 'Servant to Montague'
SELECT DISTINCT T1.LongTitle FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T4.Description = 'Servant to Montague'
shakespeare
Describe the scene number, act, and title of work which had the description of "The house of ANTIPHOLUS of Ephesus" in chapter.
SELECT T2.Act, T2.Scene, T1.Title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Description = 'The house of ANTIPHOLUS of Ephesus.'
shakespeare
Provide the character name, paragraph number, and plain text of "cousin to the king" description.
character name refers to CharName; paragraph number refers to ParagraphNum
SELECT T1.CharName, T2.ParagraphNum, T2.PlainText FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.Description = 'cousin to the king'
shakespeare
Calculate average scene per act in Antony and Cleopatra.
Antony and Cleopatra refers to Title = 'Antony and Cleopatra'; average scene per act = divide(sum(Scene), count(act))
SELECT CAST(SUM(T2.Scene) AS REAL) / COUNT(T2.act) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Antony and Cleopatra'
shakespeare
How many "all" character names have the "all" abbreviation?
character names refers to CharName;"all" abbreviation refers to Abbrev = 'all'
SELECT COUNT(id) FROM characters WHERE Abbrev = 'All'
shakespeare
Please name the latest historical work.
name refers to LongTitle; latest historical work refers to GenreType = 'History' and max(Date)
SELECT LongTitle FROM works WHERE GenreType = 'History' ORDER BY Date DESC LIMIT 1
shakespeare
What are the work numbers that are related to King Henry?
work numbers refers to works.id; related to King Henry refers to Title = '%Henry%'
SELECT id FROM works WHERE Title LIKE '%Henry%'
shakespeare
What is the name of the character that can be found in paragraph 8 of chapter 18820?
name of the character refers to CharName; paragraph 8 refers to ParagraphNum = 8; chapter 18820 refers to chapter_id = 18820
SELECT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.ParagraphNum = 8 AND T2.chapter_id = 18820
shakespeare
What is the description of chapter 18704, where there is a character called Orsino?
chapter 18704 refers to chapters.id = 18704; character called Orsino refers to CharName = 'Orsino'
SELECT DISTINCT T3.Description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id INNER JOIN chapters AS T3 ON T2.chapter_id = T3.id WHERE T1.CharName = 'Orsino' AND T3.ID = 18704
shakespeare
How many scenes can be found in "Twelfth Night, Or What You Will"?
"Twelfth Night, Or What You Will" refers to LongTitle
SELECT COUNT(T2.Scene) AS cnt FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.LongTitle = 'Cymbeline, King of Britain'
shakespeare
Please list all of the character descriptions in paragraph 20.
paragraph 20 refers to ParagraphNum = 20
SELECT T1.Description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.ParagraphNum = 20
shakespeare
How many chapters have the name Gratiano as a character for "friend to Antonio and Bassiano"?
name Gratiano as a character refers to CharName = 'Gratiano'; "friend to Antonio and Bassiano" refers to characters.Description = 'friend to Antonio and Bassiano'
SELECT COUNT(DISTINCT T2.chapter_id) FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Gratiano' AND T1.Description = 'friend to Antonio and Bassiano'
shakespeare
What are the character names in paragraph 3?
character names refers to CharName; paragraph 3 refers to ParagraphNum = 3
SELECT DISTINCT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.ParagraphNum = 3
shakespeare
Please list all of the paragraphs that have the character name Aedile.
paragraphs  refers to ParagraphNum; character name Aedile refers to CharName = 'Aedile'
SELECT T2.ParagraphNum FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Aedile'
shakespeare
Please list any two character names in chapter 18708.
character names refers to CharName; chapter 18708 refers to chapter_id = 18708
SELECT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.chapter_id = 18708 LIMIT 2
shakespeare
How many acts can be found in the comedy "Two Gentlemen of Verona"?
comedy refers to GenreType = 'comedy'; "Two Gentlemen of Verona" refers to Title = 'Two Gentlemen of Verona'
SELECT COUNT(T1.ACT) FROM chapters AS T1 LEFT JOIN works AS T2 ON T1.work_id = T2.id WHERE T2.GenreType = 'Comedy' AND T2.Title = 'Two Gentlemen of Verona'
shakespeare
How many of the works of Shakespeare are Tragedy?
Tragedy refers to GenreType = 'Tragedy'
SELECT COUNT(id) FROM works WHERE GenreType = 'Tragedy'
shakespeare
Among the works of Shakespeare, how many of them have the word "Henry" on its title?
works refers to Title; have the word "Henry" on its title refers to Title = '%Henry%'
SELECT COUNT(id) FROM works WHERE Title LIKE '%Henry%'
shakespeare
Give the character's ID of the character that said the paragraph "O my poor brother! and so perchance may he be."
"O my poor brother! and so perchance may he be." refers to  PlainText = 'O my poor brother! and so perchance may he be.'
SELECT character_id FROM paragraphs WHERE PlainText = 'O my poor brother! and so perchance may he be.'
shakespeare
List the paragraph number and paragraphs said by the character named "Sir Andrew Aguecheek".
paragraph number refers to ParagraphNum; character named "Sir Andrew Aguecheek" refers to CharName = 'Sir Andrew Aguecheek'
SELECT T2.ParagraphNum, T2.id FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Sir Andrew Aguecheek'
shakespeare
Give the title and the characters name of the most recent work of Shakespeare.
characters name refers to CharName; most recent work refers to max(Date)
SELECT T1.Title, T4.CharName FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id ORDER BY T1.Date DESC LIMIT 1