lianghsun/bird-text2sql-bench huggingface dataset:
### Database Schema
CREATE TABLE city
(
    city_id    INTEGER
            primary key,
    city_name  TEXT,
    state      TEXT,
    population INTEGER,
    area       REAL
)

CREATE TABLE customer
(
    cust_id        INTEGER
            primary key,
    cust_name      TEXT,
    annual_revenue INTEGER,
    cust_type      TEXT,
    address        TEXT,
    city           TEXT,
    state          TEXT,
    zip            REAL,
    phone          TEXT
)

CREATE TABLE driver
(
    driver_id  INTEGER
            primary key,
    first_name TEXT,
    last_name  TEXT,
    address    TEXT,
    city       TEXT,
    state      TEXT,
    zip_code   INTEGER,
    phone      TEXT
)

CREATE TABLE truck
(
    truck_id   INTEGER
            primary key,
    make       TEXT,
    model_year INTEGER
)

CREATE TABLE shipment
(
    ship_id   INTEGER
            primary key,
    cust_id   INTEGER,
    weight    REAL,
    truck_id  INTEGER,
    driver_id INTEGER,
    city_id   INTEGER,
    ship_date TEXT,
    foreign key (cust_id) references customer(cust_id),
    foreign key (city_id) references city(city_id),
    foreign key (driver_id) references driver(driver_id),
    foreign key (truck_id) references truck(truck_id)
)

### Question
What is the full name of the driver who delivered the most shipments to the least populated city?

### Hint
least populated city refers to Min(population); fullname refers to first_name, last_name; most shipment refers to driver_id where Max(Count (ship_id))

### SQL
SELECT T1.first_name, T1.last_name FROM driver AS T1 INNER JOIN shipment AS T2 ON T1.driver_id = T2.driver_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id GROUP BY T1.first_name, T1.last_name, T3.population HAVING T3.population = MAX(T3.population) ORDER BY COUNT(*) DESC LIMIT 1
### Database Schema
CREATE TABLE city
(
    city_id    INTEGER
            primary key,
    city_name  TEXT,
    state      TEXT,
    population INTEGER,
    area       REAL
)

CREATE TABLE customer
(
    cust_id        INTEGER
            primary key,
    cust_name      TEXT,
    annual_revenue INTEGER,
    cust_type      TEXT,
    address        TEXT,
    city           TEXT,
    state          TEXT,
    zip            REAL,
    phone          TEXT
)

CREATE TABLE driver
(
    driver_id  INTEGER
            primary key,
    first_name TEXT,
    last_name  TEXT,
    address    TEXT,
    city       TEXT,
    state      TEXT,
    zip_code   INTEGER,
    phone      TEXT
)

CREATE TABLE truck
(
    truck_id   INTEGER
            primary key,
    make       TEXT,
    model_year INTEGER
)

CREATE TABLE shipment
(
    ship_id   INTEGER
            primary key,
    cust_id   INTEGER,
    weight    REAL,
    truck_id  INTEGER,
    driver_id INTEGER,
    city_id   INTEGER,
    ship_date TEXT,
    foreign key (cust_id) references customer(cust_id),
    foreign key (city_id) references city(city_id),
    foreign key (driver_id) references driver(driver_id),
    foreign key (truck_id) references truck(truck_id)
)

### Question
How many shipments with weight of no more than 1,000 pounds were shipped by the oldest truck?

### Hint
weight of no more than 1000 pounds refers to weight < 1000; oldest truck refers to Min (model_year)

### SQL
SELECT COUNT(*) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.weight < 1000 ORDER BY T1.model_year ASC LIMIT 1
### Database Schema
CREATE TABLE city
(
    city_id    INTEGER
            primary key,
    city_name  TEXT,
    state      TEXT,
    population INTEGER,
    area       REAL
)

CREATE TABLE customer
(
    cust_id        INTEGER
            primary key,
    cust_name      TEXT,
    annual_revenue INTEGER,
    cust_type      TEXT,
    address        TEXT,
    city           TEXT,
    state          TEXT,
    zip            REAL,
    phone          TEXT
)

CREATE TABLE driver
(
    driver_id  INTEGER
            primary key,
    first_name TEXT,
    last_name  TEXT,
    address    TEXT,
    city       TEXT,
    state      TEXT,
    zip_code   INTEGER,
    phone      TEXT
)

CREATE TABLE truck
(
    truck_id   INTEGER
            primary key,
    make       TEXT,
    model_year INTEGER
)

CREATE TABLE shipment
(
    ship_id   INTEGER
            primary key,
    cust_id   INTEGER,
    weight    REAL,
    truck_id  INTEGER,
    driver_id INTEGER,
    city_id   INTEGER,
    ship_date TEXT,
    foreign key (cust_id) references customer(cust_id),
    foreign key (city_id) references city(city_id),
    foreign key (driver_id) references driver(driver_id),
    foreign key (truck_id) references truck(truck_id)
)

### Question
How much is the annual revenue of the customer with the most number of shipments?

### Hint
customer with the most number of shipment refers to cust_id where Max(Count(ship_id))

### SQL
SELECT T2.annual_revenue FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_id ORDER BY COUNT(T1.cust_id) DESC LIMIT 1
### Database Schema
CREATE TABLE city
(
    city_id    INTEGER
            primary key,
    city_name  TEXT,
    state      TEXT,
    population INTEGER,
    area       REAL
)

CREATE TABLE customer
(
    cust_id        INTEGER
            primary key,
    cust_name      TEXT,
    annual_revenue INTEGER,
    cust_type      TEXT,
    address        TEXT,
    city           TEXT,
    state          TEXT,
    zip            REAL,
    phone          TEXT
)

CREATE TABLE driver
(
    driver_id  INTEGER
            primary key,
    first_name TEXT,
    last_name  TEXT,
    address    TEXT,
    city       TEXT,
    state      TEXT,
    zip_code   INTEGER,
    phone      TEXT
)

CREATE TABLE truck
(
    truck_id   INTEGER
            primary key,
    make       TEXT,
    model_year INTEGER
)

CREATE TABLE shipment
(
    ship_id   INTEGER
            primary key,
    cust_id   INTEGER,
    weight    REAL,
    truck_id  INTEGER,
    driver_id INTEGER,
    city_id   INTEGER,
    ship_date TEXT,
    foreign key (cust_id) references customer(cust_id),
    foreign key (city_id) references city(city_id),
    foreign key (driver_id) references driver(driver_id),
    foreign key (truck_id) references truck(truck_id)
)

### Question
Among the shipments for Downey, how many shipments were shipped to California in 2016?

### Hint
"Downey" is the city_name; 'California' is the state, whose abbreviation is CA; in 2016 refers to year(ship_date) = 2016,

### SQL
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.city_name = 'Downey' AND STRFTIME('%Y', T1.ship_date) = '2016' AND T3.state = 'CA'
### Database Schema
CREATE TABLE city
(
    city_id    INTEGER
            primary key,
    city_name  TEXT,
    state      TEXT,
    population INTEGER,
    area       REAL
)

CREATE TABLE customer
(
    cust_id        INTEGER
            primary key,
    cust_name      TEXT,
    annual_revenue INTEGER,
    cust_type      TEXT,
    address        TEXT,
    city           TEXT,
    state          TEXT,
    zip            REAL,
    phone          TEXT
)

CREATE TABLE driver
(
    driver_id  INTEGER
            primary key,
    first_name TEXT,
    last_name  TEXT,
    address    TEXT,
    city       TEXT,
    state      TEXT,
    zip_code   INTEGER,
    phone      TEXT
)

CREATE TABLE truck
(
    truck_id   INTEGER
            primary key,
    make       TEXT,
    model_year INTEGER
)

CREATE TABLE shipment
(
    ship_id   INTEGER
            primary key,
    cust_id   INTEGER,
    weight    REAL,
    truck_id  INTEGER,
    driver_id INTEGER,
    city_id   INTEGER,
    ship_date TEXT,
    foreign key (cust_id) references customer(cust_id),
    foreign key (city_id) references city(city_id),
    foreign key (driver_id) references driver(driver_id),
    foreign key (truck_id) references truck(truck_id)
)

### Question
How many shipments did Holger Nohr transport to North Las Vegas overall?

### Hint
"North Las Vegas" is the city_name

### SQL
SELECT COUNT(*) FROM driver AS T1 INNER JOIN shipment AS T2 ON T1.driver_id = T2.driver_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T1.first_name = 'Holger' AND T1.last_name = 'Nohr' AND T3.city_name = 'North Las Vegas'
### Database Schema
CREATE TABLE city
(
    city_id    INTEGER
            primary key,
    city_name  TEXT,
    state      TEXT,
    population INTEGER,
    area       REAL
)

CREATE TABLE customer
(
    cust_id        INTEGER
            primary key,
    cust_name      TEXT,
    annual_revenue INTEGER,
    cust_type      TEXT,
    address        TEXT,
    city           TEXT,
    state          TEXT,
    zip            REAL,
    phone          TEXT
)

CREATE TABLE driver
(
    driver_id  INTEGER
            primary key,
    first_name TEXT,
    last_name  TEXT,
    address    TEXT,
    city       TEXT,
    state      TEXT,
    zip_code   INTEGER,
    phone      TEXT
)

CREATE TABLE truck
(
    truck_id   INTEGER
            primary key,
    make       TEXT,
    model_year INTEGER
)

CREATE TABLE shipment
(
    ship_id   INTEGER
            primary key,
    cust_id   INTEGER,
    weight    REAL,
    truck_id  INTEGER,
    driver_id INTEGER,
    city_id   INTEGER,
    ship_date TEXT,
    foreign key (cust_id) references customer(cust_id),
    foreign key (city_id) references city(city_id),
    foreign key (driver_id) references driver(driver_id),
    foreign key (truck_id) references truck(truck_id)
)

### Question
How many shipments were shipped to the most densely populated city?

### Hint
most densely populated city refers to Max(Divide(area, population))

### SQL
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T2.area / T2.population DESC LIMIT 1
### Database Schema
CREATE TABLE city
(
    city_id    INTEGER
            primary key,
    city_name  TEXT,
    state      TEXT,
    population INTEGER,
    area       REAL
)

CREATE TABLE customer
(
    cust_id        INTEGER
            primary key,
    cust_name      TEXT,
    annual_revenue INTEGER,
    cust_type      TEXT,
    address        TEXT,
    city           TEXT,
    state          TEXT,
    zip            REAL,
    phone          TEXT
)

CREATE TABLE driver
(
    driver_id  INTEGER
            primary key,
    first_name TEXT,
    last_name  TEXT,
    address    TEXT,
    city       TEXT,
    state      TEXT,
    zip_code   INTEGER,
    phone      TEXT
)

CREATE TABLE truck
(
    truck_id   INTEGER
            primary key,
    make       TEXT,
    model_year INTEGER
)

CREATE TABLE shipment
(
    ship_id   INTEGER
            primary key,
    cust_id   INTEGER,
    weight    REAL,
    truck_id  INTEGER,
    driver_id INTEGER,
    city_id   INTEGER,
    ship_date TEXT,
    foreign key (cust_id) references customer(cust_id),
    foreign key (city_id) references city(city_id),
    foreign key (driver_id) references driver(driver_id),
    foreign key (truck_id) references truck(truck_id)
)

### Question
Determine the percentage of manufacturers who are from Texas among all of Lorenzo's customers.

### Hint
"Texas" refers to state = 'TX'; 'manufacturer' is the cust_type; percentage = Divide (Count(cust_id where state = 'TX'), Count(cust_id)) * 100

### SQL
SELECT CAST(SUM(CASE WHEN cust_type = 'manufacturer' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer WHERE state = 'TX'
### Database Schema
CREATE TABLE city
(
    city_id    INTEGER
            primary key,
    city_name  TEXT,
    state      TEXT,
    population INTEGER,
    area       REAL
)

CREATE TABLE customer
(
    cust_id        INTEGER
            primary key,
    cust_name      TEXT,
    annual_revenue INTEGER,
    cust_type      TEXT,
    address        TEXT,
    city           TEXT,
    state          TEXT,
    zip            REAL,
    phone          TEXT
)

CREATE TABLE driver
(
    driver_id  INTEGER
            primary key,
    first_name TEXT,
    last_name  TEXT,
    address    TEXT,
    city       TEXT,
    state      TEXT,
    zip_code   INTEGER,
    phone      TEXT
)

CREATE TABLE truck
(
    truck_id   INTEGER
            primary key,
    make       TEXT,
    model_year INTEGER
)

CREATE TABLE shipment
(
    ship_id   INTEGER
            primary key,
    cust_id   INTEGER,
    weight    REAL,
    truck_id  INTEGER,
    driver_id INTEGER,
    city_id   INTEGER,
    ship_date TEXT,
    foreign key (cust_id) references customer(cust_id),
    foreign key (city_id) references city(city_id),
    foreign key (driver_id) references driver(driver_id),
    foreign key (truck_id) references truck(truck_id)
)

### Question
Identify the total weight of shipments transported to San Mateo, California, in 2016.

### Hint
"San Mateo" is the city_name; in 2016 refers to Cast(ship_date as DATE) = 2016

### SQL
SELECT SUM(T1.weight) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'San Mateo' AND STRFTIME('%Y', T1.ship_date) = '2016'
### Database Schema
CREATE TABLE city
(
    city_id    INTEGER
            primary key,
    city_name  TEXT,
    state      TEXT,
    population INTEGER,
    area       REAL
)

CREATE TABLE customer
(
    cust_id        INTEGER
            primary key,
    cust_name      TEXT,
    annual_revenue INTEGER,
    cust_type      TEXT,
    address        TEXT,
    city           TEXT,
    state          TEXT,
    zip            REAL,
    phone          TEXT
)

CREATE TABLE driver
(
    driver_id  INTEGER
            primary key,
    first_name TEXT,
    last_name  TEXT,
    address    TEXT,
    city       TEXT,
    state      TEXT,
    zip_code   INTEGER,
    phone      TEXT
)

CREATE TABLE truck
(
    truck_id   INTEGER
            primary key,
    make       TEXT,
    model_year INTEGER
)

CREATE TABLE shipment
(
    ship_id   INTEGER
            primary key,
    cust_id   INTEGER,
    weight    REAL,
    truck_id  INTEGER,
    driver_id INTEGER,
    city_id   INTEGER,
    ship_date TEXT,
    foreign key (cust_id) references customer(cust_id),
    foreign key (city_id) references city(city_id),
    foreign key (driver_id) references driver(driver_id),
    foreign key (truck_id) references truck(truck_id)
)

### Question
Identify the total weight of shipments transported in 2016 by the newest Peterbilt.

### Hint
transported in 2016 refers to CAST(ship_date as DATE) = 2016; 'Peterbilt' is the make; newest refers to Max(model_year)

### SQL
SELECT SUM(T2.weight) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Peterbilt' AND STRFTIME('%Y', T2.ship_date) = '2016' ORDER BY T1.model_year DESC LIMIT 1
### Database Schema
CREATE TABLE city
(
    city_id    INTEGER
            primary key,
    city_name  TEXT,
    state      TEXT,
    population INTEGER,
    area       REAL
)

CREATE TABLE customer
(
    cust_id        INTEGER
            primary key,
    cust_name      TEXT,
    annual_revenue INTEGER,
    cust_type      TEXT,
    address        TEXT,
    city           TEXT,
    state          TEXT,
    zip            REAL,
    phone          TEXT
)

CREATE TABLE driver
(
    driver_id  INTEGER
            primary key,
    first_name TEXT,
    last_name  TEXT,
    address    TEXT,
    city       TEXT,
    state      TEXT,
    zip_code   INTEGER,
    phone      TEXT
)

CREATE TABLE truck
(
    truck_id   INTEGER
            primary key,
    make       TEXT,
    model_year INTEGER
)

CREATE TABLE shipment
(
    ship_id   INTEGER
            primary key,
    cust_id   INTEGER,
    weight    REAL,
    truck_id  INTEGER,
    driver_id INTEGER,
    city_id   INTEGER,
    ship_date TEXT,
    foreign key (cust_id) references customer(cust_id),
    foreign key (city_id) references city(city_id),
    foreign key (driver_id) references driver(driver_id),
    foreign key (truck_id) references truck(truck_id)
)

### Question
What was the maximum weight of the shipment carried to Boston? Name the customer of that shipment.

### Hint
"Boston" is the city_name; maximum weight refers to Max(weight); customer refers to cust_name

### SQL
SELECT T1.weight, T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T1.city_id WHERE T3.city_name = 'Boston' ORDER BY T1.weight DESC LIMIT 1
### Database Schema
CREATE TABLE city
(
    city_id    INTEGER
            primary key,
    city_name  TEXT,
    state      TEXT,
    population INTEGER,
    area       REAL
)

CREATE TABLE customer
(
    cust_id        INTEGER
            primary key,
    cust_name      TEXT,
    annual_revenue INTEGER,
    cust_type      TEXT,
    address        TEXT,
    city           TEXT,
    state          TEXT,
    zip            REAL,
    phone          TEXT
)

CREATE TABLE driver
(
    driver_id  INTEGER
            primary key,
    first_name TEXT,
    last_name  TEXT,
    address    TEXT,
    city       TEXT,
    state      TEXT,
    zip_code   INTEGER,
    phone      TEXT
)

CREATE TABLE truck
(
    truck_id   INTEGER
            primary key,
    make       TEXT,
    model_year INTEGER
)

CREATE TABLE shipment
(
    ship_id   INTEGER
            primary key,
    cust_id   INTEGER,
    weight    REAL,
    truck_id  INTEGER,
    driver_id INTEGER,
    city_id   INTEGER,
    ship_date TEXT,
    foreign key (cust_id) references customer(cust_id),
    foreign key (city_id) references city(city_id),
    foreign key (driver_id) references driver(driver_id),
    foreign key (truck_id) references truck(truck_id)
)

### Question
Where was shipment no. 1002 headed?

### Hint
shipment no. 1002 refers to ship_id = 1002; where shipment was headed refers to city_name

### SQL
SELECT T2.city_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1002'
### Database Schema
CREATE TABLE city
(
    city_id    INTEGER
            primary key,
    city_name  TEXT,
    state      TEXT,
    population INTEGER,
    area       REAL
)

CREATE TABLE customer
(
    cust_id        INTEGER
            primary key,
    cust_name      TEXT,
    annual_revenue INTEGER,
    cust_type      TEXT,
    address        TEXT,
    city           TEXT,
    state          TEXT,
    zip            REAL,
    phone          TEXT
)

CREATE TABLE driver
(
    driver_id  INTEGER
            primary key,
    first_name TEXT,
    last_name  TEXT,
    address    TEXT,
    city       TEXT,
    state      TEXT,
    zip_code   INTEGER,
    phone      TEXT
)

CREATE TABLE truck
(
    truck_id   INTEGER
            primary key,
    make       TEXT,
    model_year INTEGER
)

CREATE TABLE shipment
(
    ship_id   INTEGER
            primary key,
    cust_id   INTEGER,
    weight    REAL,
    truck_id  INTEGER,
    driver_id INTEGER,
    city_id   INTEGER,
    ship_date TEXT,
    foreign key (cust_id) references customer(cust_id),
    foreign key (city_id) references city(city_id),
    foreign key (driver_id) references driver(driver_id),
    foreign key (truck_id) references truck(truck_id)
)

### Question
What is the average shipment weight carried by the oldest Mack?

### Hint
"Mack" is the make; oldest refers to Min(model_year); average shipment weight refers to AVG(weight)

### SQL
SELECT AVG(T2.weight) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Mack'
### Database Schema
CREATE TABLE city
(
    city_id    INTEGER
            primary key,
    city_name  TEXT,
    state      TEXT,
    population INTEGER,
    area       REAL
)

CREATE TABLE customer
(
    cust_id        INTEGER
            primary key,
    cust_name      TEXT,
    annual_revenue INTEGER,
    cust_type      TEXT,
    address        TEXT,
    city           TEXT,
    state          TEXT,
    zip            REAL,
    phone          TEXT
)

CREATE TABLE driver
(
    driver_id  INTEGER
            primary key,
    first_name TEXT,
    last_name  TEXT,
    address    TEXT,
    city       TEXT,
    state      TEXT,
    zip_code   INTEGER,
    phone      TEXT
)

CREATE TABLE truck
(
    truck_id   INTEGER
            primary key,
    make       TEXT,
    model_year INTEGER
)

CREATE TABLE shipment
(
    ship_id   INTEGER
            primary key,
    cust_id   INTEGER,
    weight    REAL,
    truck_id  INTEGER,
    driver_id INTEGER,
    city_id   INTEGER,
    ship_date TEXT,
    foreign key (cust_id) references customer(cust_id),
    foreign key (city_id) references city(city_id),
    foreign key (driver_id) references driver(driver_id),
    foreign key (truck_id) references truck(truck_id)
)

### Question
Identify the full name of the driver who delivered a shipment to the city of New York in February 2016.

### Hint
"New York" is the city_name; in February 2016 refers to ship_date LIKE '2016-02%'; full name refers to first_name, last_name

### SQL
SELECT T3.first_name, T3.last_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T2.city_name = 'New York' AND T1.ship_date LIKE '2016-02%'
### Database Schema
CREATE TABLE city
(
    city_id    INTEGER
            primary key,
    city_name  TEXT,
    state      TEXT,
    population INTEGER,
    area       REAL
)

CREATE TABLE customer
(
    cust_id        INTEGER
            primary key,
    cust_name      TEXT,
    annual_revenue INTEGER,
    cust_type      TEXT,
    address        TEXT,
    city           TEXT,
    state          TEXT,
    zip            REAL,
    phone          TEXT
)

CREATE TABLE driver
(
    driver_id  INTEGER
            primary key,
    first_name TEXT,
    last_name  TEXT,
    address    TEXT,
    city       TEXT,
    state      TEXT,
    zip_code   INTEGER,
    phone      TEXT
)

CREATE TABLE truck
(
    truck_id   INTEGER
            primary key,
    make       TEXT,
    model_year INTEGER
)

CREATE TABLE shipment
(
    ship_id   INTEGER
            primary key,
    cust_id   INTEGER,
    weight    REAL,
    truck_id  INTEGER,
    driver_id INTEGER,
    city_id   INTEGER,
    ship_date TEXT,
    foreign key (cust_id) references customer(cust_id),
    foreign key (city_id) references city(city_id),
    foreign key (driver_id) references driver(driver_id),
    foreign key (truck_id) references truck(truck_id)
)

### Question
Name the customer who sent the shipment to Oak Park.

### Hint
"Oak Park" is the city_name; customer name refers to cust_name

### SQL
SELECT T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T1.city_id WHERE T3.city_name = 'Oak Park'
### Database Schema
CREATE TABLE city
(
    city_id    INTEGER
            primary key,
    city_name  TEXT,
    state      TEXT,
    population INTEGER,
    area       REAL
)

CREATE TABLE customer
(
    cust_id        INTEGER
            primary key,
    cust_name      TEXT,
    annual_revenue INTEGER,
    cust_type      TEXT,
    address        TEXT,
    city           TEXT,
    state          TEXT,
    zip            REAL,
    phone          TEXT
)

CREATE TABLE driver
(
    driver_id  INTEGER
            primary key,
    first_name TEXT,
    last_name  TEXT,
    address    TEXT,
    city       TEXT,
    state      TEXT,
    zip_code   INTEGER,
    phone      TEXT
)

CREATE TABLE truck
(
    truck_id   INTEGER
            primary key,
    make       TEXT,
    model_year INTEGER
)

CREATE TABLE shipment
(
    ship_id   INTEGER
            primary key,
    cust_id   INTEGER,
    weight    REAL,
    truck_id  INTEGER,
    driver_id INTEGER,
    city_id   INTEGER,
    ship_date TEXT,
    foreign key (cust_id) references customer(cust_id),
    foreign key (city_id) references city(city_id),
    foreign key (driver_id) references driver(driver_id),
    foreign key (truck_id) references truck(truck_id)
)

### Question
Determine the number of shipments delivered by Andrea Simons to Huntsville in 2016.

### Hint
"Huntsville" is the city_name; in 2016 refers to Cast(ship_date AS DATE) = 2016; number of shipment refers to Count(ship_id)

### SQL
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T3.first_name = 'Andrea' AND T3.last_name = 'Simons' AND T2.city_name = 'Huntsville' AND STRFTIME('%Y', T1.ship_date) = '2016'