lianghsun/bird-text2sql-bench huggingface dataset:
### Database Schema
CREATE TABLE "Author"
(
    Id          INTEGER
        constraint Author_pk
            primary key,
    Name        TEXT,
    Affiliation TEXT
)

CREATE TABLE "Conference"
(
    Id        INTEGER
        constraint Conference_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE "Journal"
(
    Id        INTEGER
        constraint Journal_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE Paper
(
    Id           INTEGER
            primary key,
    Title        TEXT,
    Year         INTEGER,
    ConferenceId INTEGER,
    JournalId    INTEGER,
    Keyword      TEXT,
    foreign key (ConferenceId) references Conference(Id),
    foreign key (JournalId) references Journal(Id)
)

CREATE TABLE PaperAuthor
(
    PaperId     INTEGER,
    AuthorId    INTEGER,
    Name        TEXT,
    Affiliation TEXT,
    foreign key (PaperId) references Paper(Id),
    foreign key (AuthorId) references Author(Id)
)

### Question
Provide the average number of papers that are published in the journal named 'Information Sciences' annually.

### Hint
'Information Sciences' is the FullName of journal; average = DIVIDE(COUNT(JournalId = 48), COUNT(Years))

### SQL
SELECT CAST(COUNT(T2.JournalId) AS REAL) / COUNT(DISTINCT T2.Year) FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'Information Sciences'
### Database Schema
CREATE TABLE "Author"
(
    Id          INTEGER
        constraint Author_pk
            primary key,
    Name        TEXT,
    Affiliation TEXT
)

CREATE TABLE "Conference"
(
    Id        INTEGER
        constraint Conference_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE "Journal"
(
    Id        INTEGER
        constraint Journal_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE Paper
(
    Id           INTEGER
            primary key,
    Title        TEXT,
    Year         INTEGER,
    ConferenceId INTEGER,
    JournalId    INTEGER,
    Keyword      TEXT,
    foreign key (ConferenceId) references Conference(Id),
    foreign key (JournalId) references Journal(Id)
)

CREATE TABLE PaperAuthor
(
    PaperId     INTEGER,
    AuthorId    INTEGER,
    Name        TEXT,
    Affiliation TEXT,
    foreign key (PaperId) references Paper(Id),
    foreign key (AuthorId) references Author(Id)
)

### Question
How many publications were published by author named 'Howard F. Lipson'?

### Hint
'Howard F. Lipson' is the name of author

### SQL
SELECT COUNT(PaperId) FROM PaperAuthor WHERE Name = 'Howard F. Lipson'
### Database Schema
CREATE TABLE "Author"
(
    Id          INTEGER
        constraint Author_pk
            primary key,
    Name        TEXT,
    Affiliation TEXT
)

CREATE TABLE "Conference"
(
    Id        INTEGER
        constraint Conference_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE "Journal"
(
    Id        INTEGER
        constraint Journal_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE Paper
(
    Id           INTEGER
            primary key,
    Title        TEXT,
    Year         INTEGER,
    ConferenceId INTEGER,
    JournalId    INTEGER,
    Keyword      TEXT,
    foreign key (ConferenceId) references Conference(Id),
    foreign key (JournalId) references Journal(Id)
)

CREATE TABLE PaperAuthor
(
    PaperId     INTEGER,
    AuthorId    INTEGER,
    Name        TEXT,
    Affiliation TEXT,
    foreign key (PaperId) references Paper(Id),
    foreign key (AuthorId) references Author(Id)
)

### Question
Among all publications containing keywords 'Turbulent Fluids', what percentage of them was published in the journal named 'Physics of Fluids'?

### Hint
'Physics of Fluids' is the FullName of journal; percentage = DIVIDE(SUM(Keyword = 'Turbulent Fluids'), SUM(FullName = 'Physics of Fluids')) as percentage

### SQL
SELECT CAST(SUM(CASE WHEN T1.Keyword = 'Turbulent Fluids' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.FullName = 'Physics of Fluids' THEN 1 ELSE 0 END) FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id
### Database Schema
CREATE TABLE "Author"
(
    Id          INTEGER
        constraint Author_pk
            primary key,
    Name        TEXT,
    Affiliation TEXT
)

CREATE TABLE "Conference"
(
    Id        INTEGER
        constraint Conference_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE "Journal"
(
    Id        INTEGER
        constraint Journal_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE Paper
(
    Id           INTEGER
            primary key,
    Title        TEXT,
    Year         INTEGER,
    ConferenceId INTEGER,
    JournalId    INTEGER,
    Keyword      TEXT,
    foreign key (ConferenceId) references Conference(Id),
    foreign key (JournalId) references Journal(Id)
)

CREATE TABLE PaperAuthor
(
    PaperId     INTEGER,
    AuthorId    INTEGER,
    Name        TEXT,
    Affiliation TEXT,
    foreign key (PaperId) references Paper(Id),
    foreign key (AuthorId) references Author(Id)
)

### Question
Indicate the number of authors affiliated with the organization named 'Arizona State University'.

### Hint
'Arizona State University' is an affiliation

### SQL
SELECT COUNT(Name) FROM Author WHERE Affiliation = 'Arizona State University'
### Database Schema
CREATE TABLE "Author"
(
    Id          INTEGER
        constraint Author_pk
            primary key,
    Name        TEXT,
    Affiliation TEXT
)

CREATE TABLE "Conference"
(
    Id        INTEGER
        constraint Conference_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE "Journal"
(
    Id        INTEGER
        constraint Journal_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE Paper
(
    Id           INTEGER
            primary key,
    Title        TEXT,
    Year         INTEGER,
    ConferenceId INTEGER,
    JournalId    INTEGER,
    Keyword      TEXT,
    foreign key (ConferenceId) references Conference(Id),
    foreign key (JournalId) references Journal(Id)
)

CREATE TABLE PaperAuthor
(
    PaperId     INTEGER,
    AuthorId    INTEGER,
    Name        TEXT,
    Affiliation TEXT,
    foreign key (PaperId) references Paper(Id),
    foreign key (AuthorId) references Author(Id)
)

### Question
List out the full name and URL link of ICCI?

### Hint
'ICCI' is the ShortName of conference; URL refer to HomePage

### SQL
SELECT FullName, HomePage FROM Conference WHERE ShortName = 'ICCI'
### Database Schema
CREATE TABLE "Author"
(
    Id          INTEGER
        constraint Author_pk
            primary key,
    Name        TEXT,
    Affiliation TEXT
)

CREATE TABLE "Conference"
(
    Id        INTEGER
        constraint Conference_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE "Journal"
(
    Id        INTEGER
        constraint Journal_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE Paper
(
    Id           INTEGER
            primary key,
    Title        TEXT,
    Year         INTEGER,
    ConferenceId INTEGER,
    JournalId    INTEGER,
    Keyword      TEXT,
    foreign key (ConferenceId) references Conference(Id),
    foreign key (JournalId) references Journal(Id)
)

CREATE TABLE PaperAuthor
(
    PaperId     INTEGER,
    AuthorId    INTEGER,
    Name        TEXT,
    Affiliation TEXT,
    foreign key (PaperId) references Paper(Id),
    foreign key (AuthorId) references Author(Id)
)

### Question
Mention the titile of paper writen by Joe Lograsso.

### Hint
'Joe Lograsso' is name of paper author

### SQL
SELECT T1.Title FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name = 'Joe Lograsso'
### Database Schema
CREATE TABLE "Author"
(
    Id          INTEGER
        constraint Author_pk
            primary key,
    Name        TEXT,
    Affiliation TEXT
)

CREATE TABLE "Conference"
(
    Id        INTEGER
        constraint Conference_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE "Journal"
(
    Id        INTEGER
        constraint Journal_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE Paper
(
    Id           INTEGER
            primary key,
    Title        TEXT,
    Year         INTEGER,
    ConferenceId INTEGER,
    JournalId    INTEGER,
    Keyword      TEXT,
    foreign key (ConferenceId) references Conference(Id),
    foreign key (JournalId) references Journal(Id)
)

CREATE TABLE PaperAuthor
(
    PaperId     INTEGER,
    AuthorId    INTEGER,
    Name        TEXT,
    Affiliation TEXT,
    foreign key (PaperId) references Paper(Id),
    foreign key (AuthorId) references Author(Id)
)

### Question
How many papers were written by authors who cooperated with University of Hong Kong?

### Hint
University of Hong Kong' is an affiliation

### SQL
SELECT COUNT(T2.PaperId) FROM Author AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.AuthorId WHERE T1.Affiliation = 'University of Hong Kong'
### Database Schema
CREATE TABLE "Author"
(
    Id          INTEGER
        constraint Author_pk
            primary key,
    Name        TEXT,
    Affiliation TEXT
)

CREATE TABLE "Conference"
(
    Id        INTEGER
        constraint Conference_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE "Journal"
(
    Id        INTEGER
        constraint Journal_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE Paper
(
    Id           INTEGER
            primary key,
    Title        TEXT,
    Year         INTEGER,
    ConferenceId INTEGER,
    JournalId    INTEGER,
    Keyword      TEXT,
    foreign key (ConferenceId) references Conference(Id),
    foreign key (JournalId) references Journal(Id)
)

CREATE TABLE PaperAuthor
(
    PaperId     INTEGER,
    AuthorId    INTEGER,
    Name        TEXT,
    Affiliation TEXT,
    foreign key (PaperId) references Paper(Id),
    foreign key (AuthorId) references Author(Id)
)

### Question
State the year and title of papers written by Barrasa.

### Hint
'Barassa' is name of paper author

### SQL
SELECT T1.Year, T1.Title FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name = 'Barrasa'
### Database Schema
CREATE TABLE "Author"
(
    Id          INTEGER
        constraint Author_pk
            primary key,
    Name        TEXT,
    Affiliation TEXT
)

CREATE TABLE "Conference"
(
    Id        INTEGER
        constraint Conference_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE "Journal"
(
    Id        INTEGER
        constraint Journal_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE Paper
(
    Id           INTEGER
            primary key,
    Title        TEXT,
    Year         INTEGER,
    ConferenceId INTEGER,
    JournalId    INTEGER,
    Keyword      TEXT,
    foreign key (ConferenceId) references Conference(Id),
    foreign key (JournalId) references Journal(Id)
)

CREATE TABLE PaperAuthor
(
    PaperId     INTEGER,
    AuthorId    INTEGER,
    Name        TEXT,
    Affiliation TEXT,
    foreign key (PaperId) references Paper(Id),
    foreign key (AuthorId) references Author(Id)
)

### Question
Sate the author name and published year for paper id 2?

### Hint
published year refers to year

### SQL
SELECT T1.Name, T3.Year FROM Author AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.AuthorId INNER JOIN Paper AS T3 ON T2.PaperId = T3.Id WHERE T2.PaperId = 2
### Database Schema
CREATE TABLE "Author"
(
    Id          INTEGER
        constraint Author_pk
            primary key,
    Name        TEXT,
    Affiliation TEXT
)

CREATE TABLE "Conference"
(
    Id        INTEGER
        constraint Conference_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE "Journal"
(
    Id        INTEGER
        constraint Journal_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE Paper
(
    Id           INTEGER
            primary key,
    Title        TEXT,
    Year         INTEGER,
    ConferenceId INTEGER,
    JournalId    INTEGER,
    Keyword      TEXT,
    foreign key (ConferenceId) references Conference(Id),
    foreign key (JournalId) references Journal(Id)
)

CREATE TABLE PaperAuthor
(
    PaperId     INTEGER,
    AuthorId    INTEGER,
    Name        TEXT,
    Affiliation TEXT,
    foreign key (PaperId) references Paper(Id),
    foreign key (AuthorId) references Author(Id)
)

### Question
Mention the name of author for paper id 5 and state the keyword of this page.

### SQL
SELECT T1.Name, T3.Keyword FROM Author AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.AuthorId INNER JOIN Paper AS T3 ON T2.PaperId = T3.Id WHERE T2.PaperId = 5
### Database Schema
CREATE TABLE "Author"
(
    Id          INTEGER
        constraint Author_pk
            primary key,
    Name        TEXT,
    Affiliation TEXT
)

CREATE TABLE "Conference"
(
    Id        INTEGER
        constraint Conference_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE "Journal"
(
    Id        INTEGER
        constraint Journal_pk
            primary key,
    ShortName TEXT,
    FullName  TEXT,
    HomePage  TEXT
)

CREATE TABLE Paper
(
    Id           INTEGER
            primary key,
    Title        TEXT,
    Year         INTEGER,
    ConferenceId INTEGER,
    JournalId    INTEGER,
    Keyword      TEXT,
    foreign key (ConferenceId) references Conference(Id),
    foreign key (JournalId) references Journal(Id)
)

CREATE TABLE PaperAuthor
(
    PaperId     INTEGER,
    AuthorId    INTEGER,
    Name        TEXT,
    Affiliation TEXT,
    foreign key (PaperId) references Paper(Id),
    foreign key (AuthorId) references Author(Id)
)

### Question
What is the full name of the conference in which the paper "2004 YD5" was published?

### Hint
'2004 YD5' is the title of paper

### SQL
SELECT T1.FullName FROM Conference AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.ConferenceId WHERE T2.Title = '2004 YD5'
### Database Schema
CREATE TABLE cites
(
    cited_paper_id  TEXT not null,
    citing_paper_id TEXT not null,
    primary key (cited_paper_id, citing_paper_id)
)

CREATE TABLE paper
(
    paper_id    TEXT  not null
        primary key,
    class_label TEXT not null
)

CREATE TABLE content
(
    paper_id     TEXT not null,
    word_cited_id TEXT not null,
    primary key (paper_id, word_cited_id),
    foreign key (paper_id) references paper(paper_id)
)

### Question
Among all the citation, what is the percentage of paper ID under the Agents classification?

### Hint
classification refers to class_label; class_label = 'Agents'; percentage = (divide(count(paper_id where class_label = 'Agents')), (count(paper_id)))*100;

### SQL
SELECT CAST(COUNT(CASE WHEN class_label = 'Agents' THEN paper_id ELSE NULL END) AS REAL) * 100 / COUNT(paper_id) FROM paper
### Database Schema
CREATE TABLE cites
(
    cited_paper_id  TEXT not null,
    citing_paper_id TEXT not null,
    primary key (cited_paper_id, citing_paper_id)
)

CREATE TABLE paper
(
    paper_id    TEXT  not null
        primary key,
    class_label TEXT not null
)

CREATE TABLE content
(
    paper_id     TEXT not null,
    word_cited_id TEXT not null,
    primary key (paper_id, word_cited_id),
    foreign key (paper_id) references paper(paper_id)
)

### Question
What is the most cited word? How many papers was that word cited in?

### Hint
most cited word refers to max(count(word_cited_id);

### SQL
SELECT word_cited_id, COUNT(paper_id) FROM content GROUP BY word_cited_id ORDER BY COUNT(word_cited_id) DESC LIMIT 1
### Database Schema
CREATE TABLE cites
(
    cited_paper_id  TEXT not null,
    citing_paper_id TEXT not null,
    primary key (cited_paper_id, citing_paper_id)
)

CREATE TABLE paper
(
    paper_id    TEXT  not null
        primary key,
    class_label TEXT not null
)

CREATE TABLE content
(
    paper_id     TEXT not null,
    word_cited_id TEXT not null,
    primary key (paper_id, word_cited_id),
    foreign key (paper_id) references paper(paper_id)
)

### Question
What is the total number of word cited under that class labelled 'AI'?

### SQL
SELECT COUNT(DISTINCT T2.word_cited_id) FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'AI'
### Database Schema
CREATE TABLE cites
(
    cited_paper_id  TEXT not null,
    citing_paper_id TEXT not null,
    primary key (cited_paper_id, citing_paper_id)
)

CREATE TABLE paper
(
    paper_id    TEXT  not null
        primary key,
    class_label TEXT not null
)

CREATE TABLE content
(
    paper_id     TEXT not null,
    word_cited_id TEXT not null,
    primary key (paper_id, word_cited_id),
    foreign key (paper_id) references paper(paper_id)
)

### Question
For all words cited in paper ID 315017, state the other paper ID and class label which also cited those words.

### SQL
SELECT T1.class_label, T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.paper_id = 315017
### Database Schema
CREATE TABLE cites
(
    cited_paper_id  TEXT not null,
    citing_paper_id TEXT not null,
    primary key (cited_paper_id, citing_paper_id)
)

CREATE TABLE paper
(
    paper_id    TEXT  not null
        primary key,
    class_label TEXT not null
)

CREATE TABLE content
(
    paper_id     TEXT not null,
    word_cited_id TEXT not null,
    primary key (paper_id, word_cited_id),
    foreign key (paper_id) references paper(paper_id)
)

### Question
Among all the DB class type citation, which word is the most frequently cited?

### Hint
class type refers to class_label; class_label = 'DB'; word that is most frequently cited refers to max(count(word_cited_id);

### SQL
SELECT T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'DB' GROUP BY T2.word_cited_id ORDER BY COUNT(T2.word_cited_id) DESC LIMIT 1
### Database Schema
CREATE TABLE cites
(
    cited_paper_id  TEXT not null,
    citing_paper_id TEXT not null,
    primary key (cited_paper_id, citing_paper_id)
)

CREATE TABLE paper
(
    paper_id    TEXT  not null
        primary key,
    class_label TEXT not null
)

CREATE TABLE content
(
    paper_id     TEXT not null,
    word_cited_id TEXT not null,
    primary key (paper_id, word_cited_id),
    foreign key (paper_id) references paper(paper_id)
)

### Question
Calculate the percentage of words used in Agents class label.

### Hint
percentage = (divide(count(word_cited_id where class_label = 'Agents')), (count(word_cited_id)))*100;

### SQL
SELECT CAST(COUNT(DISTINCT CASE WHEN T1.class_label = 'Agents' THEN T2.word_cited_id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T2.word_cited_id) FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id
### Database Schema
CREATE TABLE cites
(
    cited_paper_id  TEXT not null,
    citing_paper_id TEXT not null,
    primary key (cited_paper_id, citing_paper_id)
)

CREATE TABLE paper
(
    paper_id    TEXT  not null
        primary key,
    class_label TEXT not null
)

CREATE TABLE content
(
    paper_id     TEXT not null,
    word_cited_id TEXT not null,
    primary key (paper_id, word_cited_id),
    foreign key (paper_id) references paper(paper_id)
)

### Question
Which paper ID cited the most word? In which class label does it belongs to?

### Hint
most cited word refers to max(word_cited_id);

### SQL
SELECT T1.paper_id, T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id GROUP BY T1.paper_id, T1.class_label ORDER BY COUNT(T2.word_cited_id) DESC LIMIT 1
### Database Schema
CREATE TABLE cites
(
    cited_paper_id  TEXT not null,
    citing_paper_id TEXT not null,
    primary key (cited_paper_id, citing_paper_id)
)

CREATE TABLE paper
(
    paper_id    TEXT  not null
        primary key,
    class_label TEXT not null
)

CREATE TABLE content
(
    paper_id     TEXT not null,
    word_cited_id TEXT not null,
    primary key (paper_id, word_cited_id),
    foreign key (paper_id) references paper(paper_id)
)

### Question
List all the paper ID and its class type that cited the word 'word1002'.

### Hint
class type refers to class_label;

### SQL
SELECT T1.paper_id, T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T2.word_cited_id = 'word1002'
### Database Schema
CREATE TABLE cites
(
    cited_paper_id  TEXT not null,
    citing_paper_id TEXT not null,
    primary key (cited_paper_id, citing_paper_id)
)

CREATE TABLE paper
(
    paper_id    TEXT  not null
        primary key,
    class_label TEXT not null
)

CREATE TABLE content
(
    paper_id     TEXT not null,
    word_cited_id TEXT not null,
    primary key (paper_id, word_cited_id),
    foreign key (paper_id) references paper(paper_id)
)

### Question
List all words cited in the AI class label.

### SQL
SELECT DISTINCT T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'AI'
### Database Schema
CREATE TABLE cites
(
    cited_paper_id  TEXT not null,
    citing_paper_id TEXT not null,
    primary key (cited_paper_id, citing_paper_id)
)

CREATE TABLE paper
(
    paper_id    TEXT  not null
        primary key,
    class_label TEXT not null
)

CREATE TABLE content
(
    paper_id     TEXT not null,
    word_cited_id TEXT not null,
    primary key (paper_id, word_cited_id),
    foreign key (paper_id) references paper(paper_id)
)

### Question
What is the class label of paper ID 'chakrabarti01integrating'. How many words were cited by this paper ID?

### SQL
SELECT DISTINCT T1.class_label, COUNT(T2.word_cited_id) FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.paper_id = 'chakrabarti01integrating' GROUP BY T1.class_label
### Database Schema
CREATE TABLE cites
(
    cited_paper_id  TEXT not null,
    citing_paper_id TEXT not null,
    primary key (cited_paper_id, citing_paper_id)
)

CREATE TABLE paper
(
    paper_id    TEXT  not null
        primary key,
    class_label TEXT not null
)

CREATE TABLE content
(
    paper_id     TEXT not null,
    word_cited_id TEXT not null,
    primary key (paper_id, word_cited_id),
    foreign key (paper_id) references paper(paper_id)
)

### Question
List all paper ID and its class type with more than 20 cited words.

### Hint
class type refers to class_label; count(word_cited_id)>20

### SQL
SELECT DISTINCT T1.paper_id, T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id GROUP BY T2.paper_id, T1.class_label HAVING COUNT(T2.word_cited_id) > 20
### Database Schema
CREATE TABLE cites
(
    cited_paper_id  TEXT not null,
    citing_paper_id TEXT not null,
    primary key (cited_paper_id, citing_paper_id)
)

CREATE TABLE paper
(
    paper_id    TEXT  not null
        primary key,
    class_label TEXT not null
)

CREATE TABLE content
(
    paper_id     TEXT not null,
    word_cited_id TEXT not null,
    primary key (paper_id, word_cited_id),
    foreign key (paper_id) references paper(paper_id)
)

### Question
List the words that are cited in both AI and IR class label.

### SQL
SELECT DISTINCT T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'AI' OR T1.class_label = 'IR'