lianghsun/bird-text2sql-bench huggingface dataset:
### Database Schema
CREATE TABLE actor
(
    ActorID           INTEGER
        constraint actor_pk
            primary key,
    Name              TEXT,
    "Date of Birth"   DATE,
    "Birth City"      TEXT,
    "Birth Country"   TEXT,
    "Height (Inches)" INTEGER,
    Biography         TEXT,
    Gender            TEXT,
    Ethnicity         TEXT,
    NetWorth          TEXT
)

CREATE TABLE movie
(
    MovieID        INTEGER
        constraint movie_pk
            primary key,
    Title          TEXT,
    "MPAA Rating"  TEXT,
    Budget         INTEGER,
    Gross          INTEGER,
    "Release Date" TEXT,
    Genre          TEXT,
    Runtime        INTEGER,
    Rating         REAL,
    "Rating Count" INTEGER,
    Summary        TEXT
)

CREATE TABLE characters
(
    MovieID          INTEGER,
    ActorID          INTEGER,
    "Character Name" TEXT,
    creditOrder      INTEGER,
    pay              TEXT,
    screentime       TEXT,
    primary key (MovieID, ActorID),
    foreign key (ActorID) references actor(ActorID),
    foreign key (MovieID) references movie(MovieID)
)

### Question
Count the male actors born in USA that starred in Ghost.

### Hint
male refers to Gender = 'Male'; born in USA refers to Birth Country = 'USA'; Ghost refers to Title = 'Ghost'

### SQL
SELECT COUNT(*) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Ghost' AND T3.Gender = 'Male' AND T3.`Birth Country` = 'USA'
### Database Schema
CREATE TABLE actor
(
    ActorID           INTEGER
        constraint actor_pk
            primary key,
    Name              TEXT,
    "Date of Birth"   DATE,
    "Birth City"      TEXT,
    "Birth Country"   TEXT,
    "Height (Inches)" INTEGER,
    Biography         TEXT,
    Gender            TEXT,
    Ethnicity         TEXT,
    NetWorth          TEXT
)

CREATE TABLE movie
(
    MovieID        INTEGER
        constraint movie_pk
            primary key,
    Title          TEXT,
    "MPAA Rating"  TEXT,
    Budget         INTEGER,
    Gross          INTEGER,
    "Release Date" TEXT,
    Genre          TEXT,
    Runtime        INTEGER,
    Rating         REAL,
    "Rating Count" INTEGER,
    Summary        TEXT
)

CREATE TABLE characters
(
    MovieID          INTEGER,
    ActorID          INTEGER,
    "Character Name" TEXT,
    creditOrder      INTEGER,
    pay              TEXT,
    screentime       TEXT,
    primary key (MovieID, ActorID),
    foreign key (ActorID) references actor(ActorID),
    foreign key (MovieID) references movie(MovieID)
)

### Question
What is the MPAA rating and title of the movie starred by Leonardo DiCaprio with highest budget?

### Hint
starred by Leonardo DiCaprio refers to Name = 'Leonardo Dicaprio'; highest budget refers to max(Budget)

### SQL
SELECT T1.`MPAA Rating`, T1.Title FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Leonardo DiCaprio' ORDER BY T1.Budget DESC LIMIT 1
### Database Schema
CREATE TABLE actor
(
    ActorID           INTEGER
        constraint actor_pk
            primary key,
    Name              TEXT,
    "Date of Birth"   DATE,
    "Birth City"      TEXT,
    "Birth Country"   TEXT,
    "Height (Inches)" INTEGER,
    Biography         TEXT,
    Gender            TEXT,
    Ethnicity         TEXT,
    NetWorth          TEXT
)

CREATE TABLE movie
(
    MovieID        INTEGER
        constraint movie_pk
            primary key,
    Title          TEXT,
    "MPAA Rating"  TEXT,
    Budget         INTEGER,
    Gross          INTEGER,
    "Release Date" TEXT,
    Genre          TEXT,
    Runtime        INTEGER,
    Rating         REAL,
    "Rating Count" INTEGER,
    Summary        TEXT
)

CREATE TABLE characters
(
    MovieID          INTEGER,
    ActorID          INTEGER,
    "Character Name" TEXT,
    creditOrder      INTEGER,
    pay              TEXT,
    screentime       TEXT,
    primary key (MovieID, ActorID),
    foreign key (ActorID) references actor(ActorID),
    foreign key (MovieID) references movie(MovieID)
)

### Question
Among the actors starred in Die Hard 2, list their net worth and birth date of actors with a height between 60 to 65.

### Hint
Die Hard 2 refers to Title = 'Die Hard 2'; height between 60 to 65 refers to Height (Inches) BETWEEN 60 AND 65

### SQL
SELECT T3.NetWorth, T3.`Date of Birth` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Die Hard 2' AND T3.`Height (Inches)` BETWEEN 60 AND 65
### Database Schema
CREATE TABLE actor
(
    ActorID           INTEGER
        constraint actor_pk
            primary key,
    Name              TEXT,
    "Date of Birth"   DATE,
    "Birth City"      TEXT,
    "Birth Country"   TEXT,
    "Height (Inches)" INTEGER,
    Biography         TEXT,
    Gender            TEXT,
    Ethnicity         TEXT,
    NetWorth          TEXT
)

CREATE TABLE movie
(
    MovieID        INTEGER
        constraint movie_pk
            primary key,
    Title          TEXT,
    "MPAA Rating"  TEXT,
    Budget         INTEGER,
    Gross          INTEGER,
    "Release Date" TEXT,
    Genre          TEXT,
    Runtime        INTEGER,
    Rating         REAL,
    "Rating Count" INTEGER,
    Summary        TEXT
)

CREATE TABLE characters
(
    MovieID          INTEGER,
    ActorID          INTEGER,
    "Character Name" TEXT,
    creditOrder      INTEGER,
    pay              TEXT,
    screentime       TEXT,
    primary key (MovieID, ActorID),
    foreign key (ActorID) references actor(ActorID),
    foreign key (MovieID) references movie(MovieID)
)

### Question
List the runtime of movies starred by an African-American actor born on December 28, 1954.

### Hint
African-American refers to Ethnicity = 'African American'; born on December 28 1954 refers to Date of Birth = '1954-12-28'

### SQL
SELECT T1.Runtime FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Ethnicity = 'African American' AND T3.`Date of Birth` = '1954-12-28'
### Database Schema
CREATE TABLE actor
(
    ActorID           INTEGER
        constraint actor_pk
            primary key,
    Name              TEXT,
    "Date of Birth"   DATE,
    "Birth City"      TEXT,
    "Birth Country"   TEXT,
    "Height (Inches)" INTEGER,
    Biography         TEXT,
    Gender            TEXT,
    Ethnicity         TEXT,
    NetWorth          TEXT
)

CREATE TABLE movie
(
    MovieID        INTEGER
        constraint movie_pk
            primary key,
    Title          TEXT,
    "MPAA Rating"  TEXT,
    Budget         INTEGER,
    Gross          INTEGER,
    "Release Date" TEXT,
    Genre          TEXT,
    Runtime        INTEGER,
    Rating         REAL,
    "Rating Count" INTEGER,
    Summary        TEXT
)

CREATE TABLE characters
(
    MovieID          INTEGER,
    ActorID          INTEGER,
    "Character Name" TEXT,
    creditOrder      INTEGER,
    pay              TEXT,
    screentime       TEXT,
    primary key (MovieID, ActorID),
    foreign key (ActorID) references actor(ActorID),
    foreign key (MovieID) references movie(MovieID)
)

### Question
Find the actor's name that played as Don Altobello in a drama movie that has a gross of 136766062.

### Hint
actor's name refers to Name; as Don Altobello refers to Character Name = 'Don Altobello'; drama movie refers to Genre = 'Drama'

### SQL
SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Gross = 136766062 AND T2.`Character Name` = 'Don Altobello' AND T1.Genre = 'Drama'
### Database Schema
CREATE TABLE actor
(
    ActorID           INTEGER
        constraint actor_pk
            primary key,
    Name              TEXT,
    "Date of Birth"   DATE,
    "Birth City"      TEXT,
    "Birth Country"   TEXT,
    "Height (Inches)" INTEGER,
    Biography         TEXT,
    Gender            TEXT,
    Ethnicity         TEXT,
    NetWorth          TEXT
)

CREATE TABLE movie
(
    MovieID        INTEGER
        constraint movie_pk
            primary key,
    Title          TEXT,
    "MPAA Rating"  TEXT,
    Budget         INTEGER,
    Gross          INTEGER,
    "Release Date" TEXT,
    Genre          TEXT,
    Runtime        INTEGER,
    Rating         REAL,
    "Rating Count" INTEGER,
    Summary        TEXT
)

CREATE TABLE characters
(
    MovieID          INTEGER,
    ActorID          INTEGER,
    "Character Name" TEXT,
    creditOrder      INTEGER,
    pay              TEXT,
    screentime       TEXT,
    primary key (MovieID, ActorID),
    foreign key (ActorID) references actor(ActorID),
    foreign key (MovieID) references movie(MovieID)
)

### Question
What is the gross of a comedy movie with a rating lower than 7 and starred by an actor with a net worth greater than $375,000,000.00?

### Hint
comedy movie refers to Genre = 'Comedy'; rating lower than 7 refers to Rating < 7; net worth greater than $375,000,000.00 refers to NetWorth > '$375,000,000.00'

### SQL
SELECT SUM(T1.Gross) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) > 375000000 AND T1.Rating < 7 AND T1.Genre = 'Comedy'
### Database Schema
CREATE TABLE actor
(
    ActorID           INTEGER
        constraint actor_pk
            primary key,
    Name              TEXT,
    "Date of Birth"   DATE,
    "Birth City"      TEXT,
    "Birth Country"   TEXT,
    "Height (Inches)" INTEGER,
    Biography         TEXT,
    Gender            TEXT,
    Ethnicity         TEXT,
    NetWorth          TEXT
)

CREATE TABLE movie
(
    MovieID        INTEGER
        constraint movie_pk
            primary key,
    Title          TEXT,
    "MPAA Rating"  TEXT,
    Budget         INTEGER,
    Gross          INTEGER,
    "Release Date" TEXT,
    Genre          TEXT,
    Runtime        INTEGER,
    Rating         REAL,
    "Rating Count" INTEGER,
    Summary        TEXT
)

CREATE TABLE characters
(
    MovieID          INTEGER,
    ActorID          INTEGER,
    "Character Name" TEXT,
    creditOrder      INTEGER,
    pay              TEXT,
    screentime       TEXT,
    primary key (MovieID, ActorID),
    foreign key (ActorID) references actor(ActorID),
    foreign key (MovieID) references movie(MovieID)
)

### Question
What is the runtime of the movie starred by Jackie Chan with a rating greater than 7?

### Hint
starred by Jackie Chan refers to Name = 'Jackie Chan'; rating greater than 7 refers to Rating > 7

### SQL
SELECT T1.Runtime FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Jackie Chan' AND T1.Rating > 7
### Database Schema
CREATE TABLE actor
(
    ActorID           INTEGER
        constraint actor_pk
            primary key,
    Name              TEXT,
    "Date of Birth"   DATE,
    "Birth City"      TEXT,
    "Birth Country"   TEXT,
    "Height (Inches)" INTEGER,
    Biography         TEXT,
    Gender            TEXT,
    Ethnicity         TEXT,
    NetWorth          TEXT
)

CREATE TABLE movie
(
    MovieID        INTEGER
        constraint movie_pk
            primary key,
    Title          TEXT,
    "MPAA Rating"  TEXT,
    Budget         INTEGER,
    Gross          INTEGER,
    "Release Date" TEXT,
    Genre          TEXT,
    Runtime        INTEGER,
    Rating         REAL,
    "Rating Count" INTEGER,
    Summary        TEXT
)

CREATE TABLE characters
(
    MovieID          INTEGER,
    ActorID          INTEGER,
    "Character Name" TEXT,
    creditOrder      INTEGER,
    pay              TEXT,
    screentime       TEXT,
    primary key (MovieID, ActorID),
    foreign key (ActorID) references actor(ActorID),
    foreign key (MovieID) references movie(MovieID)
)

### Question
Among the movies with drama genre, what is the percentage of the actors with net worth greater than $400,000,000.00?

### Hint
drama genre refers to Genre = 'Drama'; net worth greater than $400,000,000.00 refers to NetWorth > '$400,000,000.00'; percentage = divide(count(ActorID where NetWorth > '$400,000,000.00'), COUNT(ActorID))*100%

### SQL
SELECT SUM(CASE WHEN CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) > 400000000 THEN 1 ELSE 0 END) - SUM(CASE WHEN CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) < 400000000 THEN 1 ELSE 0 END) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Genre = 'Drama'
### Database Schema
CREATE TABLE actor
(
    ActorID           INTEGER
        constraint actor_pk
            primary key,
    Name              TEXT,
    "Date of Birth"   DATE,
    "Birth City"      TEXT,
    "Birth Country"   TEXT,
    "Height (Inches)" INTEGER,
    Biography         TEXT,
    Gender            TEXT,
    Ethnicity         TEXT,
    NetWorth          TEXT
)

CREATE TABLE movie
(
    MovieID        INTEGER
        constraint movie_pk
            primary key,
    Title          TEXT,
    "MPAA Rating"  TEXT,
    Budget         INTEGER,
    Gross          INTEGER,
    "Release Date" TEXT,
    Genre          TEXT,
    Runtime        INTEGER,
    Rating         REAL,
    "Rating Count" INTEGER,
    Summary        TEXT
)

CREATE TABLE characters
(
    MovieID          INTEGER,
    ActorID          INTEGER,
    "Character Name" TEXT,
    creditOrder      INTEGER,
    pay              TEXT,
    screentime       TEXT,
    primary key (MovieID, ActorID),
    foreign key (ActorID) references actor(ActorID),
    foreign key (MovieID) references movie(MovieID)
)

### Question
List the character's name of actress born in Sherman Oaks and starred in the movie Bruce Almighty with height greater than the 50% of average height of all actors listed.

### Hint
actress refers to Gender = 'Female'; born in Sherman Oaks refers to Birth City = 'Sherman Oaks'; movie Bruce Almighty refers to Title = 'Bruce Almighty'; height greater than the 50% of average height refers to Height (Inches) > multiply(avg(Height (Inches)), 0.5)

### SQL
SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Gender = 'Female' AND T1.Title = 'Godzilla' AND T3.`Birth City` = 'Sherman Oaks' AND T3.`Height (Inches)` * 100 > ( SELECT AVG(`Height (Inches)`) FROM actor ) * 50
### Database Schema
CREATE TABLE location
(
    LocationID INTEGER
        constraint location_pk
            primary key,
    Country    TEXT,
    State      TEXT,
    StateCode  TEXT,
    City       TEXT
)

CREATE TABLE user
(
    UserID TEXT
        constraint user_pk
            primary key,
    Gender TEXT
)

CREATE TABLE twitter
(
    TweetID         TEXT
            primary key,
    Weekday         TEXT,
    Hour         INTEGER,
    Day          INTEGER,
    Lang         TEXT,
    IsReshare    TEXT,
    Reach        INTEGER,
    RetweetCount INTEGER,
    Likes        INTEGER,
    Klout        INTEGER,
    Sentiment    REAL,
    "text"         TEXT,
    LocationID   INTEGER,
    UserID       TEXT,
    foreign key (LocationID) references location(LocationID),
    foreign key (UserID) references user(UserID)
)

### Question
How many tweets are in English?

### Hint
english is the language and refers to Lang = 'en'

### SQL
SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Lang = 'en'
### Database Schema
CREATE TABLE location
(
    LocationID INTEGER
        constraint location_pk
            primary key,
    Country    TEXT,
    State      TEXT,
    StateCode  TEXT,
    City       TEXT
)

CREATE TABLE user
(
    UserID TEXT
        constraint user_pk
            primary key,
    Gender TEXT
)

CREATE TABLE twitter
(
    TweetID         TEXT
            primary key,
    Weekday         TEXT,
    Hour         INTEGER,
    Day          INTEGER,
    Lang         TEXT,
    IsReshare    TEXT,
    Reach        INTEGER,
    RetweetCount INTEGER,
    Likes        INTEGER,
    Klout        INTEGER,
    Sentiment    REAL,
    "text"         TEXT,
    LocationID   INTEGER,
    UserID       TEXT,
    foreign key (LocationID) references location(LocationID),
    foreign key (UserID) references user(UserID)
)

### Question
Please list the texts of all the tweets that are reshared.

### Hint
reshared refers to Isreshare = 'TRUE'

### SQL
SELECT text FROM twitter WHERE IsReshare = 'TRUE'
### Database Schema
CREATE TABLE location
(
    LocationID INTEGER
        constraint location_pk
            primary key,
    Country    TEXT,
    State      TEXT,
    StateCode  TEXT,
    City       TEXT
)

CREATE TABLE user
(
    UserID TEXT
        constraint user_pk
            primary key,
    Gender TEXT
)

CREATE TABLE twitter
(
    TweetID         TEXT
            primary key,
    Weekday         TEXT,
    Hour         INTEGER,
    Day          INTEGER,
    Lang         TEXT,
    IsReshare    TEXT,
    Reach        INTEGER,
    RetweetCount INTEGER,
    Likes        INTEGER,
    Klout        INTEGER,
    Sentiment    REAL,
    "text"         TEXT,
    LocationID   INTEGER,
    UserID       TEXT,
    foreign key (LocationID) references location(LocationID),
    foreign key (UserID) references user(UserID)
)

### Question
How many tweets are seen by more than 1000 unique users?

### Hint
seen by more than 1000 unique users refers to Reach > 1000

### SQL
SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Reach > 1000
### Database Schema
CREATE TABLE location
(
    LocationID INTEGER
        constraint location_pk
            primary key,
    Country    TEXT,
    State      TEXT,
    StateCode  TEXT,
    City       TEXT
)

CREATE TABLE user
(
    UserID TEXT
        constraint user_pk
            primary key,
    Gender TEXT
)

CREATE TABLE twitter
(
    TweetID         TEXT
            primary key,
    Weekday         TEXT,
    Hour         INTEGER,
    Day          INTEGER,
    Lang         TEXT,
    IsReshare    TEXT,
    Reach        INTEGER,
    RetweetCount INTEGER,
    Likes        INTEGER,
    Klout        INTEGER,
    Sentiment    REAL,
    "text"         TEXT,
    LocationID   INTEGER,
    UserID       TEXT,
    foreign key (LocationID) references location(LocationID),
    foreign key (UserID) references user(UserID)
)

### Question
Among all the tweets that have a positive sentiment, how many of them are posted on Thursday?

### Hint
positive sentiment refers to Sentiment > 0; posted on Thursday refers to Weekday = 'Thursday'

### SQL
SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Sentiment > 0 AND Weekday = 'Thursday'
### Database Schema
CREATE TABLE location
(
    LocationID INTEGER
        constraint location_pk
            primary key,
    Country    TEXT,
    State      TEXT,
    StateCode  TEXT,
    City       TEXT
)

CREATE TABLE user
(
    UserID TEXT
        constraint user_pk
            primary key,
    Gender TEXT
)

CREATE TABLE twitter
(
    TweetID         TEXT
            primary key,
    Weekday         TEXT,
    Hour         INTEGER,
    Day          INTEGER,
    Lang         TEXT,
    IsReshare    TEXT,
    Reach        INTEGER,
    RetweetCount INTEGER,
    Likes        INTEGER,
    Klout        INTEGER,
    Sentiment    REAL,
    "text"         TEXT,
    LocationID   INTEGER,
    UserID       TEXT,
    foreign key (LocationID) references location(LocationID),
    foreign key (UserID) references user(UserID)
)

### Question
What is the text of the tweet that got the most `likes`?

### Hint
got the most like refers to Max(Likes)

### SQL
SELECT text FROM twitter WHERE Likes = ( SELECT MAX( Likes) FROM twitter )
### Database Schema
CREATE TABLE location
(
    LocationID INTEGER
        constraint location_pk
            primary key,
    Country    TEXT,
    State      TEXT,
    StateCode  TEXT,
    City       TEXT
)

CREATE TABLE user
(
    UserID TEXT
        constraint user_pk
            primary key,
    Gender TEXT
)

CREATE TABLE twitter
(
    TweetID         TEXT
            primary key,
    Weekday         TEXT,
    Hour         INTEGER,
    Day          INTEGER,
    Lang         TEXT,
    IsReshare    TEXT,
    Reach        INTEGER,
    RetweetCount INTEGER,
    Likes        INTEGER,
    Klout        INTEGER,
    Sentiment    REAL,
    "text"         TEXT,
    LocationID   INTEGER,
    UserID       TEXT,
    foreign key (LocationID) references location(LocationID),
    foreign key (UserID) references user(UserID)
)

### Question
Please list all the cities in Argentina.

### Hint
"Argentina" is the Country

### SQL
SELECT City FROM location WHERE City IS NOT NULL AND Country = 'Argentina'
### Database Schema
CREATE TABLE location
(
    LocationID INTEGER
        constraint location_pk
            primary key,
    Country    TEXT,
    State      TEXT,
    StateCode  TEXT,
    City       TEXT
)

CREATE TABLE user
(
    UserID TEXT
        constraint user_pk
            primary key,
    Gender TEXT
)

CREATE TABLE twitter
(
    TweetID         TEXT
            primary key,
    Weekday         TEXT,
    Hour         INTEGER,
    Day          INTEGER,
    Lang         TEXT,
    IsReshare    TEXT,
    Reach        INTEGER,
    RetweetCount INTEGER,
    Likes        INTEGER,
    Klout        INTEGER,
    Sentiment    REAL,
    "text"         TEXT,
    LocationID   INTEGER,
    UserID       TEXT,
    foreign key (LocationID) references location(LocationID),
    foreign key (UserID) references user(UserID)
)

### Question
How many tweets in total were posted by a user in Argentina?

### Hint
"Argentina" is the Country

### SQL
SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina' LIMIT 1
### Database Schema
CREATE TABLE location
(
    LocationID INTEGER
        constraint location_pk
            primary key,
    Country    TEXT,
    State      TEXT,
    StateCode  TEXT,
    City       TEXT
)

CREATE TABLE user
(
    UserID TEXT
        constraint user_pk
            primary key,
    Gender TEXT
)

CREATE TABLE twitter
(
    TweetID         TEXT
            primary key,
    Weekday         TEXT,
    Hour         INTEGER,
    Day          INTEGER,
    Lang         TEXT,
    IsReshare    TEXT,
    Reach        INTEGER,
    RetweetCount INTEGER,
    Likes        INTEGER,
    Klout        INTEGER,
    Sentiment    REAL,
    "text"         TEXT,
    LocationID   INTEGER,
    UserID       TEXT,
    foreign key (LocationID) references location(LocationID),
    foreign key (UserID) references user(UserID)
)

### Question
Users in which city of Argentina post the most tweets?

### Hint
"Argentina" is the Country; post the most tweets refers to Max(Count(TweetID))

### SQL
SELECT T2.City FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina' GROUP BY T2.City ORDER BY COUNT(T1.TweetID) DESC LIMIT 1
### Database Schema
CREATE TABLE location
(
    LocationID INTEGER
        constraint location_pk
            primary key,
    Country    TEXT,
    State      TEXT,
    StateCode  TEXT,
    City       TEXT
)

CREATE TABLE user
(
    UserID TEXT
        constraint user_pk
            primary key,
    Gender TEXT
)

CREATE TABLE twitter
(
    TweetID         TEXT
            primary key,
    Weekday         TEXT,
    Hour         INTEGER,
    Day          INTEGER,
    Lang         TEXT,
    IsReshare    TEXT,
    Reach        INTEGER,
    RetweetCount INTEGER,
    Likes        INTEGER,
    Klout        INTEGER,
    Sentiment    REAL,
    "text"         TEXT,
    LocationID   INTEGER,
    UserID       TEXT,
    foreign key (LocationID) references location(LocationID),
    foreign key (UserID) references user(UserID)
)

### Question
Among all the tweets that are reshared, how many of them are posted by a user in Buenos Aires?

### Hint
reshared refers to Isreshare = 'TRUE'; 'Buenos Aires' is the City

### SQL
SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.City = 'Buenos Aires' AND T1.IsReshare = 'TRUE'