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】 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 on average in one act in Twelfth Night? Twelfth Night refers to Title = 'Twelfth Night'; average scene = divide(sum(Scene), count(Act))

    【Evidence】
    Twelfth Night refers to Title = 'Twelfth Night'; average scene = divide(sum(Scene), count(Act))

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

SQL: 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'
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 comedies did Shakespeare create? comedies refers to GenreType = 'Comedy'

    【Evidence】
    comedies refers to GenreType = 'Comedy'

    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 GenreType = 'Comedy'
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】
    When did Shakespeare write the first poem? first poem refers to GenreType = 'Poem' and Date = 'min'

    【Evidence】
    first poem refers to GenreType = 'Poem' and Date = 'min'

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

SQL: SELECT MIN(Date) FROM works WHERE GenreType = 'Poem'
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】
    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'

    【Evidence】
    abbreviation name refers to Abbrev; character "Earl of Westmoreland" refers to CharName = 'Earl of Westmoreland'

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

SQL: SELECT DISTINCT Abbrev FROM characters WHERE CharName = 'Earl of Westmoreland'
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】
    Which chapter has the most paragraphs? Give the description of the chapter. most paragraphs refers to max(count(chapter_id))

    【Evidence】
    most paragraphs refers to max(count(chapter_id))

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

SQL: 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
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】
    Which character was mentioned in the paragraph "Would he do so, I'ld beg your precious mistress, Which he counts but a trifle."? Give the character name. paragraph "Would he do so, I'ld beg your precious mistress, Which he counts but a trifle."  refers to PlainText = 'Would he do so, I'ld beg your precious mistress, Which he counts but a trifle.'

    【Evidence】
    paragraph "Would he do so, I'ld beg your precious mistress, Which he counts but a trifle."  refers to PlainText = 'Would he do so, I'ld beg your precious mistress, Which he counts but a trifle.'

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

SQL: SELECT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.PlainText = 'Would he do so, I''ld beg your precious mistress,Which he counts but a trifle.'
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 characters are there in Titus Andronicus? Titus Andronicus refers to Title = 'Titus Andronicus'

    【Evidence】
    Titus Andronicus refers to Title = 'Titus Andronicus'

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

SQL: 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'
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】
    List the number of acts in Two Gentlemen of Verona. Two Gentlemen of Verona refers to LongTitle = 'Two Gentlemen of Verona'

    【Evidence】
    Two Gentlemen of Verona refers to LongTitle = 'Two Gentlemen of Verona'

    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.Act FROM chapters AS T1 INNER JOIN works AS T2 ON T1.id = T1.work_id WHERE T2.LongTitle = 'Two Gentlemen of Verona'
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】
    What is the description for the character mentioned in paragraph No.640171? paragraph No.640171 refers to paragraphs.id = '640171'

    【Evidence】
    paragraph No.640171 refers to paragraphs.id = '640171'

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

SQL: SELECT T1.Description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.id = '640171'
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】
    Give the title of the work that contains the character "Shylock". character "Shylock" refers to CharName = 'Shylock'

    【Evidence】
    character "Shylock" refers to CharName = 'Shylock'

    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.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'
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 King John? King John refers to Title = 'King John'

    【Evidence】
    King John refers to Title = 'King John'

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

SQL: SELECT COUNT(T2.Scene) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'King John'
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 chapters does the character Demetrius show in the story? character Demetrius refers to CharName = 'Demetrius'

    【Evidence】
    character Demetrius refers to CharName = 'Demetrius'

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

SQL: 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'
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】
    Which Shakespeare story with character ID 324 has description of 'this friend of Caesar'?

    【Evidence】
    

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

SQL: SELECT 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 T2.id = '324' AND T2.Description = 'friend to Caesar'