lianghsun/bird-text2sql-bench huggingface dataset:
### Database Schema
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE Categories
(
    CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
    CategoryName TEXT,
    Description TEXT
)

CREATE TABLE Customers
(
    CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
    CustomerName TEXT,
    ContactName TEXT,
    Address TEXT,
    City TEXT,
    PostalCode TEXT,
    Country TEXT
)

CREATE TABLE Employees
(
    EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
    LastName TEXT,
    FirstName TEXT,
    BirthDate DATE,
    Photo TEXT,
    Notes TEXT
)

CREATE TABLE Shippers(
    ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
    ShipperName TEXT,
    Phone TEXT
)

CREATE TABLE Suppliers(
    SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
    SupplierName TEXT,
    ContactName TEXT,
    Address TEXT,
    City TEXT,
    PostalCode TEXT,
    Country TEXT,
    Phone TEXT
)

CREATE TABLE Products(
    ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
    ProductName TEXT,
    SupplierID INTEGER,
    CategoryID INTEGER,
    Unit TEXT,
    Price REAL DEFAULT 0,
	FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
	FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID)
)

CREATE TABLE Orders(
    OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
    CustomerID INTEGER,
    EmployeeID INTEGER,
    OrderDate DATETIME,
    ShipperID INTEGER,
    FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
    FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
    FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID)
)

CREATE TABLE OrderDetails(
    OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
    OrderID INTEGER,
    ProductID INTEGER,
    Quantity INTEGER,
	FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
	FOREIGN KEY (ProductID) REFERENCES Products (ProductID)
)

### Question
State the shipping company of order id 10260.

### Hint
shipping company refers to CompanyName

### SQL
SELECT T2.CompanyName FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T1.OrderID = 10260
### Database Schema
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE Categories
(
    CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
    CategoryName TEXT,
    Description TEXT
)

CREATE TABLE Customers
(
    CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
    CustomerName TEXT,
    ContactName TEXT,
    Address TEXT,
    City TEXT,
    PostalCode TEXT,
    Country TEXT
)

CREATE TABLE Employees
(
    EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
    LastName TEXT,
    FirstName TEXT,
    BirthDate DATE,
    Photo TEXT,
    Notes TEXT
)

CREATE TABLE Shippers(
    ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
    ShipperName TEXT,
    Phone TEXT
)

CREATE TABLE Suppliers(
    SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
    SupplierName TEXT,
    ContactName TEXT,
    Address TEXT,
    City TEXT,
    PostalCode TEXT,
    Country TEXT,
    Phone TEXT
)

CREATE TABLE Products(
    ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
    ProductName TEXT,
    SupplierID INTEGER,
    CategoryID INTEGER,
    Unit TEXT,
    Price REAL DEFAULT 0,
	FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
	FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID)
)

CREATE TABLE Orders(
    OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
    CustomerID INTEGER,
    EmployeeID INTEGER,
    OrderDate DATETIME,
    ShipperID INTEGER,
    FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
    FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
    FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID)
)

CREATE TABLE OrderDetails(
    OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
    OrderID INTEGER,
    ProductID INTEGER,
    Quantity INTEGER,
	FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
	FOREIGN KEY (ProductID) REFERENCES Products (ProductID)
)

### Question
How many orders have been shipped through United Package?

### Hint
shipped through refers to ShipVia; United Package refers to CompanyName = 'United Package'

### SQL
SELECT COUNT(T1.OrderID) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'United Package'
### Database Schema
CREATE TABLE sqlite_sequence(name,seq)

CREATE TABLE Categories
(
    CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
    CategoryName TEXT,
    Description TEXT
)

CREATE TABLE Customers
(
    CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
    CustomerName TEXT,
    ContactName TEXT,
    Address TEXT,
    City TEXT,
    PostalCode TEXT,
    Country TEXT
)

CREATE TABLE Employees
(
    EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
    LastName TEXT,
    FirstName TEXT,
    BirthDate DATE,
    Photo TEXT,
    Notes TEXT
)

CREATE TABLE Shippers(
    ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
    ShipperName TEXT,
    Phone TEXT
)

CREATE TABLE Suppliers(
    SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
    SupplierName TEXT,
    ContactName TEXT,
    Address TEXT,
    City TEXT,
    PostalCode TEXT,
    Country TEXT,
    Phone TEXT
)

CREATE TABLE Products(
    ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
    ProductName TEXT,
    SupplierID INTEGER,
    CategoryID INTEGER,
    Unit TEXT,
    Price REAL DEFAULT 0,
	FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
	FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID)
)

CREATE TABLE Orders(
    OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
    CustomerID INTEGER,
    EmployeeID INTEGER,
    OrderDate DATETIME,
    ShipperID INTEGER,
    FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
    FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
    FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID)
)

CREATE TABLE OrderDetails(
    OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
    OrderID INTEGER,
    ProductID INTEGER,
    Quantity INTEGER,
	FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
	FOREIGN KEY (ProductID) REFERENCES Products (ProductID)
)

### Question
List out the phone number of the shipping company of order id 10296.

### Hint
shipping company refers to Shippers; phone number refers to Phone

### SQL
SELECT T2.Phone FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T1.OrderID = 10260
### Database Schema
CREATE TABLE height_info
(
    height_id      INTEGER
            primary key,
    height_in_cm   INTEGER,
    height_in_inch TEXT
)

CREATE TABLE weight_info
(
    weight_id     INTEGER
            primary key,
    weight_in_kg  INTEGER,
    weight_in_lbs INTEGER
)

CREATE TABLE PlayerInfo
(
    ELITEID           INTEGER
            primary key,
    PlayerName        TEXT,
    birthdate         TEXT,
    birthyear         DATE,
    birthmonth        INTEGER,
    birthday          INTEGER,
    birthplace        TEXT,
    nation            TEXT,
    height            INTEGER,
    weight            INTEGER,
    position_info     TEXT,
    shoots            TEXT,
    draftyear         INTEGER,
    draftround        INTEGER,
    overall           INTEGER,
    overallby         TEXT,
    CSS_rank          INTEGER,
    sum_7yr_GP        INTEGER,
    sum_7yr_TOI       INTEGER,
    GP_greater_than_0 TEXT,
    foreign key (height) references height_info(height_id),
    foreign key (weight) references weight_info(weight_id)
)

CREATE TABLE SeasonStatus
(
    ELITEID   INTEGER,
    SEASON    TEXT,
    TEAM      TEXT,
    LEAGUE    TEXT,
    GAMETYPE  TEXT,
    GP        INTEGER,
    G         INTEGER,
    A         INTEGER,
    P         INTEGER,
    PIM       INTEGER,
    PLUSMINUS INTEGER,
    foreign key (ELITEID) references PlayerInfo(ELITEID)
)

### Question
What is the height of David Bornhammar in inches?

### Hint
heigh in inches refers to height_in_inch;

### SQL
SELECT T2.height_in_inch FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.PlayerName = 'David Bornhammar'
### Database Schema
CREATE TABLE height_info
(
    height_id      INTEGER
            primary key,
    height_in_cm   INTEGER,
    height_in_inch TEXT
)

CREATE TABLE weight_info
(
    weight_id     INTEGER
            primary key,
    weight_in_kg  INTEGER,
    weight_in_lbs INTEGER
)

CREATE TABLE PlayerInfo
(
    ELITEID           INTEGER
            primary key,
    PlayerName        TEXT,
    birthdate         TEXT,
    birthyear         DATE,
    birthmonth        INTEGER,
    birthday          INTEGER,
    birthplace        TEXT,
    nation            TEXT,
    height            INTEGER,
    weight            INTEGER,
    position_info     TEXT,
    shoots            TEXT,
    draftyear         INTEGER,
    draftround        INTEGER,
    overall           INTEGER,
    overallby         TEXT,
    CSS_rank          INTEGER,
    sum_7yr_GP        INTEGER,
    sum_7yr_TOI       INTEGER,
    GP_greater_than_0 TEXT,
    foreign key (height) references height_info(height_id),
    foreign key (weight) references weight_info(weight_id)
)

CREATE TABLE SeasonStatus
(
    ELITEID   INTEGER,
    SEASON    TEXT,
    TEAM      TEXT,
    LEAGUE    TEXT,
    GAMETYPE  TEXT,
    GP        INTEGER,
    G         INTEGER,
    A         INTEGER,
    P         INTEGER,
    PIM       INTEGER,
    PLUSMINUS INTEGER,
    foreign key (ELITEID) references PlayerInfo(ELITEID)
)

### Question
Please list the names of all the players with a height of over 6'2" inches.

### Hint
name of the players refers to PlayerName; height of over 6'2" inches refers to height_in_inch > '6''2"' ;

### SQL
SELECT DISTINCT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T2.height_in_inch > '6''2"'
### Database Schema
CREATE TABLE height_info
(
    height_id      INTEGER
            primary key,
    height_in_cm   INTEGER,
    height_in_inch TEXT
)

CREATE TABLE weight_info
(
    weight_id     INTEGER
            primary key,
    weight_in_kg  INTEGER,
    weight_in_lbs INTEGER
)

CREATE TABLE PlayerInfo
(
    ELITEID           INTEGER
            primary key,
    PlayerName        TEXT,
    birthdate         TEXT,
    birthyear         DATE,
    birthmonth        INTEGER,
    birthday          INTEGER,
    birthplace        TEXT,
    nation            TEXT,
    height            INTEGER,
    weight            INTEGER,
    position_info     TEXT,
    shoots            TEXT,
    draftyear         INTEGER,
    draftround        INTEGER,
    overall           INTEGER,
    overallby         TEXT,
    CSS_rank          INTEGER,
    sum_7yr_GP        INTEGER,
    sum_7yr_TOI       INTEGER,
    GP_greater_than_0 TEXT,
    foreign key (height) references height_info(height_id),
    foreign key (weight) references weight_info(weight_id)
)

CREATE TABLE SeasonStatus
(
    ELITEID   INTEGER,
    SEASON    TEXT,
    TEAM      TEXT,
    LEAGUE    TEXT,
    GAMETYPE  TEXT,
    GP        INTEGER,
    G         INTEGER,
    A         INTEGER,
    P         INTEGER,
    PIM       INTEGER,
    PLUSMINUS INTEGER,
    foreign key (ELITEID) references PlayerInfo(ELITEID)
)

### Question
Among the players with a height of over 6'2" inches, how many of them were born in Sweden?

### Hint
height of over 6'2" inches refers to height_in_inch > '6''2"'; born in Sweden refers to nation = 'Sweden' ;

### SQL
SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T2.height_in_inch > '6''2"' AND T1.nation = 'Sweden'
### Database Schema
CREATE TABLE height_info
(
    height_id      INTEGER
            primary key,
    height_in_cm   INTEGER,
    height_in_inch TEXT
)

CREATE TABLE weight_info
(
    weight_id     INTEGER
            primary key,
    weight_in_kg  INTEGER,
    weight_in_lbs INTEGER
)

CREATE TABLE PlayerInfo
(
    ELITEID           INTEGER
            primary key,
    PlayerName        TEXT,
    birthdate         TEXT,
    birthyear         DATE,
    birthmonth        INTEGER,
    birthday          INTEGER,
    birthplace        TEXT,
    nation            TEXT,
    height            INTEGER,
    weight            INTEGER,
    position_info     TEXT,
    shoots            TEXT,
    draftyear         INTEGER,
    draftround        INTEGER,
    overall           INTEGER,
    overallby         TEXT,
    CSS_rank          INTEGER,
    sum_7yr_GP        INTEGER,
    sum_7yr_TOI       INTEGER,
    GP_greater_than_0 TEXT,
    foreign key (height) references height_info(height_id),
    foreign key (weight) references weight_info(weight_id)
)

CREATE TABLE SeasonStatus
(
    ELITEID   INTEGER,
    SEASON    TEXT,
    TEAM      TEXT,
    LEAGUE    TEXT,
    GAMETYPE  TEXT,
    GP        INTEGER,
    G         INTEGER,
    A         INTEGER,
    P         INTEGER,
    PIM       INTEGER,
    PLUSMINUS INTEGER,
    foreign key (ELITEID) references PlayerInfo(ELITEID)
)

### Question
What is the name of the tallest player?

### Hint
tallest player refers to MAX(height_in_cm);

### SQL
SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id ORDER BY T2.height_in_cm DESC LIMIT 1
### Database Schema
CREATE TABLE height_info
(
    height_id      INTEGER
            primary key,
    height_in_cm   INTEGER,
    height_in_inch TEXT
)

CREATE TABLE weight_info
(
    weight_id     INTEGER
            primary key,
    weight_in_kg  INTEGER,
    weight_in_lbs INTEGER
)

CREATE TABLE PlayerInfo
(
    ELITEID           INTEGER
            primary key,
    PlayerName        TEXT,
    birthdate         TEXT,
    birthyear         DATE,
    birthmonth        INTEGER,
    birthday          INTEGER,
    birthplace        TEXT,
    nation            TEXT,
    height            INTEGER,
    weight            INTEGER,
    position_info     TEXT,
    shoots            TEXT,
    draftyear         INTEGER,
    draftround        INTEGER,
    overall           INTEGER,
    overallby         TEXT,
    CSS_rank          INTEGER,
    sum_7yr_GP        INTEGER,
    sum_7yr_TOI       INTEGER,
    GP_greater_than_0 TEXT,
    foreign key (height) references height_info(height_id),
    foreign key (weight) references weight_info(weight_id)
)

CREATE TABLE SeasonStatus
(
    ELITEID   INTEGER,
    SEASON    TEXT,
    TEAM      TEXT,
    LEAGUE    TEXT,
    GAMETYPE  TEXT,
    GP        INTEGER,
    G         INTEGER,
    A         INTEGER,
    P         INTEGER,
    PIM       INTEGER,
    PLUSMINUS INTEGER,
    foreign key (ELITEID) references PlayerInfo(ELITEID)
)

### Question
How much does David Bornhammar weigh in kilograms?

### Hint
weigh in kilograms refers to weight_in_kg;

### SQL
SELECT T2.weight_in_kg FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.PlayerName = 'David Bornhammar'
### Database Schema
CREATE TABLE height_info
(
    height_id      INTEGER
            primary key,
    height_in_cm   INTEGER,
    height_in_inch TEXT
)

CREATE TABLE weight_info
(
    weight_id     INTEGER
            primary key,
    weight_in_kg  INTEGER,
    weight_in_lbs INTEGER
)

CREATE TABLE PlayerInfo
(
    ELITEID           INTEGER
            primary key,
    PlayerName        TEXT,
    birthdate         TEXT,
    birthyear         DATE,
    birthmonth        INTEGER,
    birthday          INTEGER,
    birthplace        TEXT,
    nation            TEXT,
    height            INTEGER,
    weight            INTEGER,
    position_info     TEXT,
    shoots            TEXT,
    draftyear         INTEGER,
    draftround        INTEGER,
    overall           INTEGER,
    overallby         TEXT,
    CSS_rank          INTEGER,
    sum_7yr_GP        INTEGER,
    sum_7yr_TOI       INTEGER,
    GP_greater_than_0 TEXT,
    foreign key (height) references height_info(height_id),
    foreign key (weight) references weight_info(weight_id)
)

CREATE TABLE SeasonStatus
(
    ELITEID   INTEGER,
    SEASON    TEXT,
    TEAM      TEXT,
    LEAGUE    TEXT,
    GAMETYPE  TEXT,
    GP        INTEGER,
    G         INTEGER,
    A         INTEGER,
    P         INTEGER,
    PIM       INTEGER,
    PLUSMINUS INTEGER,
    foreign key (ELITEID) references PlayerInfo(ELITEID)
)

### Question
How many players weigh more than 90 kg?

### Hint
weigh more than 90 kg refers to weight_in_kg > 90;

### SQL
SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90
### Database Schema
CREATE TABLE height_info
(
    height_id      INTEGER
            primary key,
    height_in_cm   INTEGER,
    height_in_inch TEXT
)

CREATE TABLE weight_info
(
    weight_id     INTEGER
            primary key,
    weight_in_kg  INTEGER,
    weight_in_lbs INTEGER
)

CREATE TABLE PlayerInfo
(
    ELITEID           INTEGER
            primary key,
    PlayerName        TEXT,
    birthdate         TEXT,
    birthyear         DATE,
    birthmonth        INTEGER,
    birthday          INTEGER,
    birthplace        TEXT,
    nation            TEXT,
    height            INTEGER,
    weight            INTEGER,
    position_info     TEXT,
    shoots            TEXT,
    draftyear         INTEGER,
    draftround        INTEGER,
    overall           INTEGER,
    overallby         TEXT,
    CSS_rank          INTEGER,
    sum_7yr_GP        INTEGER,
    sum_7yr_TOI       INTEGER,
    GP_greater_than_0 TEXT,
    foreign key (height) references height_info(height_id),
    foreign key (weight) references weight_info(weight_id)
)

CREATE TABLE SeasonStatus
(
    ELITEID   INTEGER,
    SEASON    TEXT,
    TEAM      TEXT,
    LEAGUE    TEXT,
    GAMETYPE  TEXT,
    GP        INTEGER,
    G         INTEGER,
    A         INTEGER,
    P         INTEGER,
    PIM       INTEGER,
    PLUSMINUS INTEGER,
    foreign key (ELITEID) references PlayerInfo(ELITEID)
)

### Question
Among the players that weigh more than 90 kg, how many of them have a position of defense?

### Hint
weigh more than 90 kg refers to weight_in_kg > 90; position of defense refers to position_info = 'D' ;

### SQL
SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.position_info = 'D'
### Database Schema
CREATE TABLE height_info
(
    height_id      INTEGER
            primary key,
    height_in_cm   INTEGER,
    height_in_inch TEXT
)

CREATE TABLE weight_info
(
    weight_id     INTEGER
            primary key,
    weight_in_kg  INTEGER,
    weight_in_lbs INTEGER
)

CREATE TABLE PlayerInfo
(
    ELITEID           INTEGER
            primary key,
    PlayerName        TEXT,
    birthdate         TEXT,
    birthyear         DATE,
    birthmonth        INTEGER,
    birthday          INTEGER,
    birthplace        TEXT,
    nation            TEXT,
    height            INTEGER,
    weight            INTEGER,
    position_info     TEXT,
    shoots            TEXT,
    draftyear         INTEGER,
    draftround        INTEGER,
    overall           INTEGER,
    overallby         TEXT,
    CSS_rank          INTEGER,
    sum_7yr_GP        INTEGER,
    sum_7yr_TOI       INTEGER,
    GP_greater_than_0 TEXT,
    foreign key (height) references height_info(height_id),
    foreign key (weight) references weight_info(weight_id)
)

CREATE TABLE SeasonStatus
(
    ELITEID   INTEGER,
    SEASON    TEXT,
    TEAM      TEXT,
    LEAGUE    TEXT,
    GAMETYPE  TEXT,
    GP        INTEGER,
    G         INTEGER,
    A         INTEGER,
    P         INTEGER,
    PIM       INTEGER,
    PLUSMINUS INTEGER,
    foreign key (ELITEID) references PlayerInfo(ELITEID)
)

### Question
Among the players that weigh more than 90 kg, what is the name of the player that has the most attendance in the player's first 7 years of NHL career?

### Hint
weigh more than 90 kg refers to weight_in_kg > 90; name of the player refers to PlayerName; most attendance in the player's first 7 years of NHL career refers to MAX(sum_7yr_GP);

### SQL
SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.sum_7yr_GP = ( SELECT MAX(T1.sum_7yr_GP) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 )
### Database Schema
CREATE TABLE height_info
(
    height_id      INTEGER
            primary key,
    height_in_cm   INTEGER,
    height_in_inch TEXT
)

CREATE TABLE weight_info
(
    weight_id     INTEGER
            primary key,
    weight_in_kg  INTEGER,
    weight_in_lbs INTEGER
)

CREATE TABLE PlayerInfo
(
    ELITEID           INTEGER
            primary key,
    PlayerName        TEXT,
    birthdate         TEXT,
    birthyear         DATE,
    birthmonth        INTEGER,
    birthday          INTEGER,
    birthplace        TEXT,
    nation            TEXT,
    height            INTEGER,
    weight            INTEGER,
    position_info     TEXT,
    shoots            TEXT,
    draftyear         INTEGER,
    draftround        INTEGER,
    overall           INTEGER,
    overallby         TEXT,
    CSS_rank          INTEGER,
    sum_7yr_GP        INTEGER,
    sum_7yr_TOI       INTEGER,
    GP_greater_than_0 TEXT,
    foreign key (height) references height_info(height_id),
    foreign key (weight) references weight_info(weight_id)
)

CREATE TABLE SeasonStatus
(
    ELITEID   INTEGER,
    SEASON    TEXT,
    TEAM      TEXT,
    LEAGUE    TEXT,
    GAMETYPE  TEXT,
    GP        INTEGER,
    G         INTEGER,
    A         INTEGER,
    P         INTEGER,
    PIM       INTEGER,
    PLUSMINUS INTEGER,
    foreign key (ELITEID) references PlayerInfo(ELITEID)
)

### Question
What is the weight of the player with the longest time on ice in the player’s first 7 years of NHL career in kilograms?

### Hint
weight in kilograms refers to weight_in_kg; longest time on ice in the player's first 7 years of NHL career refers to MAX(sum_7yr_TOI);

### SQL
SELECT T2.weight_in_kg FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.sum_7yr_TOI = ( SELECT MAX(t.sum_7yr_TOI) FROM PlayerInfo t )
### Database Schema
CREATE TABLE height_info
(
    height_id      INTEGER
            primary key,
    height_in_cm   INTEGER,
    height_in_inch TEXT
)

CREATE TABLE weight_info
(
    weight_id     INTEGER
            primary key,
    weight_in_kg  INTEGER,
    weight_in_lbs INTEGER
)

CREATE TABLE PlayerInfo
(
    ELITEID           INTEGER
            primary key,
    PlayerName        TEXT,
    birthdate         TEXT,
    birthyear         DATE,
    birthmonth        INTEGER,
    birthday          INTEGER,
    birthplace        TEXT,
    nation            TEXT,
    height            INTEGER,
    weight            INTEGER,
    position_info     TEXT,
    shoots            TEXT,
    draftyear         INTEGER,
    draftround        INTEGER,
    overall           INTEGER,
    overallby         TEXT,
    CSS_rank          INTEGER,
    sum_7yr_GP        INTEGER,
    sum_7yr_TOI       INTEGER,
    GP_greater_than_0 TEXT,
    foreign key (height) references height_info(height_id),
    foreign key (weight) references weight_info(weight_id)
)

CREATE TABLE SeasonStatus
(
    ELITEID   INTEGER,
    SEASON    TEXT,
    TEAM      TEXT,
    LEAGUE    TEXT,
    GAMETYPE  TEXT,
    GP        INTEGER,
    G         INTEGER,
    A         INTEGER,
    P         INTEGER,
    PIM       INTEGER,
    PLUSMINUS INTEGER,
    foreign key (ELITEID) references PlayerInfo(ELITEID)
)

### Question
How much taller is David Bornhammar than Pauli Levokari in centimeters?

### Hint
how much taller = SUBTRACT(SUM(height_in_cm WHERE PlayerName = 'David Bornhammar'), SUM(height_in_cm WHERE PlayerName = 'Pauli Levokari')); height in centimeters refers to height_in_cm;

### SQL
SELECT ( SELECT T2.height_in_cm FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.PlayerName = 'David Bornhammar' ) - ( SELECT T2.height_in_cm FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.PlayerName = 'Pauli Levokari' )