db_id
stringclasses 140
values | messages
listlengths 2
2
|
---|---|
match_season | [
{
"content": "Translate the following question to SQL: Show the name of colleges that have at least two players.\n\nSchema: CREATE TABLE country (\n Country_id INT PRIMARY KEY,\n Country_name TEXT,\n Capital TEXT,\n Official_native_language TEXT,\n UNIQUE (Country_id)\n);\n\nCREATE TABLE team (\n Team_id INT PRIMARY KEY,\n Name TEXT,\n UNIQUE (Team_id)\n);\n\nCREATE TABLE match_season (\n Season REAL PRIMARY KEY,\n Player TEXT,\n Position TEXT,\n Country INT,\n Team INT,\n Draft_Pick_Number INT,\n Draft_Class TEXT,\n College TEXT,\n UNIQUE (Season),\n FOREIGN KEY (Team) REFERENCES team(Team_id),\n FOREIGN KEY (Country) REFERENCES country(Country_id)\n);\n\nCREATE TABLE player (\n Player_ID INT PRIMARY KEY,\n Player TEXT,\n Years_Played TEXT,\n Total_WL TEXT,\n Singles_WL TEXT,\n Doubles_WL TEXT,\n Team INT,\n UNIQUE (Player_ID),\n FOREIGN KEY (Team) REFERENCES team(Team_id)\n);",
"role": "user"
},
{
"content": "SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2",
"role": "assistant"
}
] |
match_season | [
{
"content": "Translate the following question to SQL: What are the names of all colleges that have two or more players?\n\nSchema: CREATE TABLE country (\n Country_id INT PRIMARY KEY,\n Country_name TEXT,\n Capital TEXT,\n Official_native_language TEXT,\n UNIQUE (Country_id)\n);\n\nCREATE TABLE team (\n Team_id INT PRIMARY KEY,\n Name TEXT,\n UNIQUE (Team_id)\n);\n\nCREATE TABLE match_season (\n Season REAL PRIMARY KEY,\n Player TEXT,\n Position TEXT,\n Country INT,\n Team INT,\n Draft_Pick_Number INT,\n Draft_Class TEXT,\n College TEXT,\n UNIQUE (Season),\n FOREIGN KEY (Team) REFERENCES team(Team_id),\n FOREIGN KEY (Country) REFERENCES country(Country_id)\n);\n\nCREATE TABLE player (\n Player_ID INT PRIMARY KEY,\n Player TEXT,\n Years_Played TEXT,\n Total_WL TEXT,\n Singles_WL TEXT,\n Doubles_WL TEXT,\n Team INT,\n UNIQUE (Player_ID),\n FOREIGN KEY (Team) REFERENCES team(Team_id)\n);",
"role": "user"
},
{
"content": "SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2",
"role": "assistant"
}
] |
match_season | [
{
"content": "Translate the following question to SQL: Show the name of colleges that have at least two players in descending alphabetical order.\n\nSchema: CREATE TABLE country (\n Country_id INT PRIMARY KEY,\n Country_name TEXT,\n Capital TEXT,\n Official_native_language TEXT,\n UNIQUE (Country_id)\n);\n\nCREATE TABLE team (\n Team_id INT PRIMARY KEY,\n Name TEXT,\n UNIQUE (Team_id)\n);\n\nCREATE TABLE match_season (\n Season REAL PRIMARY KEY,\n Player TEXT,\n Position TEXT,\n Country INT,\n Team INT,\n Draft_Pick_Number INT,\n Draft_Class TEXT,\n College TEXT,\n UNIQUE (Season),\n FOREIGN KEY (Team) REFERENCES team(Team_id),\n FOREIGN KEY (Country) REFERENCES country(Country_id)\n);\n\nCREATE TABLE player (\n Player_ID INT PRIMARY KEY,\n Player TEXT,\n Years_Played TEXT,\n Total_WL TEXT,\n Singles_WL TEXT,\n Doubles_WL TEXT,\n Team INT,\n UNIQUE (Player_ID),\n FOREIGN KEY (Team) REFERENCES team(Team_id)\n);",
"role": "user"
},
{
"content": "SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC",
"role": "assistant"
}
] |
match_season | [
{
"content": "Translate the following question to SQL: What are the names of colleges that have two or more players, listed in descending alphabetical order?\n\nSchema: CREATE TABLE country (\n Country_id INT PRIMARY KEY,\n Country_name TEXT,\n Capital TEXT,\n Official_native_language TEXT,\n UNIQUE (Country_id)\n);\n\nCREATE TABLE team (\n Team_id INT PRIMARY KEY,\n Name TEXT,\n UNIQUE (Team_id)\n);\n\nCREATE TABLE match_season (\n Season REAL PRIMARY KEY,\n Player TEXT,\n Position TEXT,\n Country INT,\n Team INT,\n Draft_Pick_Number INT,\n Draft_Class TEXT,\n College TEXT,\n UNIQUE (Season),\n FOREIGN KEY (Team) REFERENCES team(Team_id),\n FOREIGN KEY (Country) REFERENCES country(Country_id)\n);\n\nCREATE TABLE player (\n Player_ID INT PRIMARY KEY,\n Player TEXT,\n Years_Played TEXT,\n Total_WL TEXT,\n Singles_WL TEXT,\n Doubles_WL TEXT,\n Team INT,\n UNIQUE (Player_ID),\n FOREIGN KEY (Team) REFERENCES team(Team_id)\n);",
"role": "user"
},
{
"content": "SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC",
"role": "assistant"
}
] |
match_season | [
{
"content": "Translate the following question to SQL: What are the names of teams that do no have match season record?\n\nSchema: CREATE TABLE country (\n Country_id INT PRIMARY KEY,\n Country_name TEXT,\n Capital TEXT,\n Official_native_language TEXT,\n UNIQUE (Country_id)\n);\n\nCREATE TABLE team (\n Team_id INT PRIMARY KEY,\n Name TEXT,\n UNIQUE (Team_id)\n);\n\nCREATE TABLE match_season (\n Season REAL PRIMARY KEY,\n Player TEXT,\n Position TEXT,\n Country INT,\n Team INT,\n Draft_Pick_Number INT,\n Draft_Class TEXT,\n College TEXT,\n UNIQUE (Season),\n FOREIGN KEY (Team) REFERENCES team(Team_id),\n FOREIGN KEY (Country) REFERENCES country(Country_id)\n);\n\nCREATE TABLE player (\n Player_ID INT PRIMARY KEY,\n Player TEXT,\n Years_Played TEXT,\n Total_WL TEXT,\n Singles_WL TEXT,\n Doubles_WL TEXT,\n Team INT,\n UNIQUE (Player_ID),\n FOREIGN KEY (Team) REFERENCES team(Team_id)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)",
"role": "assistant"
}
] |
match_season | [
{
"content": "Translate the following question to SQL: Return the names of teams that have no match season record.\n\nSchema: CREATE TABLE country (\n Country_id INT PRIMARY KEY,\n Country_name TEXT,\n Capital TEXT,\n Official_native_language TEXT,\n UNIQUE (Country_id)\n);\n\nCREATE TABLE team (\n Team_id INT PRIMARY KEY,\n Name TEXT,\n UNIQUE (Team_id)\n);\n\nCREATE TABLE match_season (\n Season REAL PRIMARY KEY,\n Player TEXT,\n Position TEXT,\n Country INT,\n Team INT,\n Draft_Pick_Number INT,\n Draft_Class TEXT,\n College TEXT,\n UNIQUE (Season),\n FOREIGN KEY (Team) REFERENCES team(Team_id),\n FOREIGN KEY (Country) REFERENCES country(Country_id)\n);\n\nCREATE TABLE player (\n Player_ID INT PRIMARY KEY,\n Player TEXT,\n Years_Played TEXT,\n Total_WL TEXT,\n Singles_WL TEXT,\n Doubles_WL TEXT,\n Team INT,\n UNIQUE (Player_ID),\n FOREIGN KEY (Team) REFERENCES team(Team_id)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)",
"role": "assistant"
}
] |
match_season | [
{
"content": "Translate the following question to SQL: What are the names of countries that have both players with position forward and players with position defender?\n\nSchema: CREATE TABLE country (\n Country_id INT PRIMARY KEY,\n Country_name TEXT,\n Capital TEXT,\n Official_native_language TEXT,\n UNIQUE (Country_id)\n);\n\nCREATE TABLE team (\n Team_id INT PRIMARY KEY,\n Name TEXT,\n UNIQUE (Team_id)\n);\n\nCREATE TABLE match_season (\n Season REAL PRIMARY KEY,\n Player TEXT,\n Position TEXT,\n Country INT,\n Team INT,\n Draft_Pick_Number INT,\n Draft_Class TEXT,\n College TEXT,\n UNIQUE (Season),\n FOREIGN KEY (Team) REFERENCES team(Team_id),\n FOREIGN KEY (Country) REFERENCES country(Country_id)\n);\n\nCREATE TABLE player (\n Player_ID INT PRIMARY KEY,\n Player TEXT,\n Years_Played TEXT,\n Total_WL TEXT,\n Singles_WL TEXT,\n Doubles_WL TEXT,\n Team INT,\n UNIQUE (Player_ID),\n FOREIGN KEY (Team) REFERENCES team(Team_id)\n);",
"role": "user"
},
{
"content": "SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = \"Forward\" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = \"Defender\"",
"role": "assistant"
}
] |
match_season | [
{
"content": "Translate the following question to SQL: Return the names of countries that have players that play the Forward position, as well as players who play the Defender position.\n\nSchema: CREATE TABLE country (\n Country_id INT PRIMARY KEY,\n Country_name TEXT,\n Capital TEXT,\n Official_native_language TEXT,\n UNIQUE (Country_id)\n);\n\nCREATE TABLE team (\n Team_id INT PRIMARY KEY,\n Name TEXT,\n UNIQUE (Team_id)\n);\n\nCREATE TABLE match_season (\n Season REAL PRIMARY KEY,\n Player TEXT,\n Position TEXT,\n Country INT,\n Team INT,\n Draft_Pick_Number INT,\n Draft_Class TEXT,\n College TEXT,\n UNIQUE (Season),\n FOREIGN KEY (Team) REFERENCES team(Team_id),\n FOREIGN KEY (Country) REFERENCES country(Country_id)\n);\n\nCREATE TABLE player (\n Player_ID INT PRIMARY KEY,\n Player TEXT,\n Years_Played TEXT,\n Total_WL TEXT,\n Singles_WL TEXT,\n Doubles_WL TEXT,\n Team INT,\n UNIQUE (Player_ID),\n FOREIGN KEY (Team) REFERENCES team(Team_id)\n);",
"role": "user"
},
{
"content": "SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = \"Forward\" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = \"Defender\"",
"role": "assistant"
}
] |
match_season | [
{
"content": "Translate the following question to SQL: Which college have both players with position midfielder and players with position defender?\n\nSchema: CREATE TABLE country (\n Country_id INT PRIMARY KEY,\n Country_name TEXT,\n Capital TEXT,\n Official_native_language TEXT,\n UNIQUE (Country_id)\n);\n\nCREATE TABLE team (\n Team_id INT PRIMARY KEY,\n Name TEXT,\n UNIQUE (Team_id)\n);\n\nCREATE TABLE match_season (\n Season REAL PRIMARY KEY,\n Player TEXT,\n Position TEXT,\n Country INT,\n Team INT,\n Draft_Pick_Number INT,\n Draft_Class TEXT,\n College TEXT,\n UNIQUE (Season),\n FOREIGN KEY (Team) REFERENCES team(Team_id),\n FOREIGN KEY (Country) REFERENCES country(Country_id)\n);\n\nCREATE TABLE player (\n Player_ID INT PRIMARY KEY,\n Player TEXT,\n Years_Played TEXT,\n Total_WL TEXT,\n Singles_WL TEXT,\n Doubles_WL TEXT,\n Team INT,\n UNIQUE (Player_ID),\n FOREIGN KEY (Team) REFERENCES team(Team_id)\n);",
"role": "user"
},
{
"content": "SELECT College FROM match_season WHERE POSITION = \"Midfielder\" INTERSECT SELECT College FROM match_season WHERE POSITION = \"Defender\"",
"role": "assistant"
}
] |
match_season | [
{
"content": "Translate the following question to SQL: Return the colleges that have players who play the Midfielder position, as well as players who play the Defender position.\n\nSchema: CREATE TABLE country (\n Country_id INT PRIMARY KEY,\n Country_name TEXT,\n Capital TEXT,\n Official_native_language TEXT,\n UNIQUE (Country_id)\n);\n\nCREATE TABLE team (\n Team_id INT PRIMARY KEY,\n Name TEXT,\n UNIQUE (Team_id)\n);\n\nCREATE TABLE match_season (\n Season REAL PRIMARY KEY,\n Player TEXT,\n Position TEXT,\n Country INT,\n Team INT,\n Draft_Pick_Number INT,\n Draft_Class TEXT,\n College TEXT,\n UNIQUE (Season),\n FOREIGN KEY (Team) REFERENCES team(Team_id),\n FOREIGN KEY (Country) REFERENCES country(Country_id)\n);\n\nCREATE TABLE player (\n Player_ID INT PRIMARY KEY,\n Player TEXT,\n Years_Played TEXT,\n Total_WL TEXT,\n Singles_WL TEXT,\n Doubles_WL TEXT,\n Team INT,\n UNIQUE (Player_ID),\n FOREIGN KEY (Team) REFERENCES team(Team_id)\n);",
"role": "user"
},
{
"content": "SELECT College FROM match_season WHERE POSITION = \"Midfielder\" INTERSECT SELECT College FROM match_season WHERE POSITION = \"Defender\"",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: How many climbers are there?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT count(*) FROM climber",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Count the number of climbers.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT count(*) FROM climber",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: List the names of climbers in descending order of points.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM climber ORDER BY Points DESC",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: What are the names of the climbers, ordered by points descending?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM climber ORDER BY Points DESC",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: List the names of climbers whose country is not Switzerland.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM climber WHERE Country != \"Switzerland\"",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: What are the names of climbers who are not from the country of Switzerland?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM climber WHERE Country != \"Switzerland\"",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: What is the maximum point for climbers whose country is United Kingdom?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT max(Points) FROM climber WHERE Country = \"United Kingdom\"",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Return the maximum number of points for climbers from the United Kingdom.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT max(Points) FROM climber WHERE Country = \"United Kingdom\"",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: How many distinct countries are the climbers from?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT COUNT(DISTINCT Country) FROM climber",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Count the number of different countries that climbers are from.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT COUNT(DISTINCT Country) FROM climber",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: What are the names of mountains in ascending alphabetical order?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM mountain ORDER BY Name ASC",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Give the names of mountains in alphabetical order.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM mountain ORDER BY Name ASC",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: What are the countries of mountains with height bigger than 5000?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Country FROM mountain WHERE Height > 5000",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Return the countries of the mountains that have a height larger than 5000.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Country FROM mountain WHERE Height > 5000",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: What is the name of the highest mountain?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Return the name of the mountain with the greatest height.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: List the distinct ranges of the mountains with the top 3 prominence.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: What are the different ranges of the 3 mountains with the highest prominence?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Show names of climbers and the names of mountains they climb.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: What are the names of climbers and the corresponding names of mountains that they climb?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Show the names of climbers and the heights of mountains they climb.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: What are the names of climbers and the corresponding heights of the mountains that they climb?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Show the height of the mountain climbed by the climber with the maximum points.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC LIMIT 1",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: What is the height of the mountain climbined by the climbing who had the most points?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC LIMIT 1",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Show the distinct names of mountains climbed by climbers from country \"West Germany\".\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = \"West Germany\"",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: What are the different names of mountains ascended by climbers from the country of West Germany?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = \"West Germany\"",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Show the times used by climbers to climb mountains in Country Uganda.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = \"Uganda\"",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: What are the times used by climbers who climbed mountains in the country of Uganda?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = \"Uganda\"",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Please show the countries and the number of climbers from each country.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Country , COUNT(*) FROM climber GROUP BY Country",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: How many climbers are from each country?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Country , COUNT(*) FROM climber GROUP BY Country",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: List the countries that have more than one mountain.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Which countries have more than one mountain?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: List the names of mountains that do not have any climber.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber)",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: What are the names of countains that no climber has climbed?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber)",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: What are the countries that have both mountains that are higher than 5600 and lower than 5200?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Show the range that has the most number of mountains.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Which range contains the most mountains?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: Show the names of mountains with height more than 5000 or prominence more than 1000.\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000",
"role": "assistant"
}
] |
climbing | [
{
"content": "Translate the following question to SQL: What are the names of mountains that have a height of over 5000 or a prominence of over 1000?\n\nSchema: CREATE TABLE mountain (\n Mountain_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Prominence REAL,\n Range TEXT,\n Country TEXT,\n UNIQUE (Mountain_ID)\n);\n\nCREATE TABLE climber (\n Climber_ID INT PRIMARY KEY,\n Name TEXT,\n Country TEXT,\n Time TEXT,\n Points REAL,\n Mountain_ID INT,\n UNIQUE (Climber_ID),\n FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: How many body builders are there?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT count(*) FROM body_builder",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: List the total scores of body builders in ascending order.\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT Total FROM body_builder ORDER BY Total ASC",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: List the snatch score and clean jerk score of body builders in ascending order of snatch score.\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT Snatch , Clean_Jerk FROM body_builder ORDER BY Snatch ASC",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: What is the average snatch score of body builders?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT avg(Snatch) FROM body_builder",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: What are the clean and jerk score of the body builder with the highest total score?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT Clean_Jerk FROM body_builder ORDER BY Total DESC LIMIT 1",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: What are the birthdays of people in ascending order of height?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT Birth_Date FROM People ORDER BY Height ASC",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: What are the names of body builders?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: What are the names of body builders whose total score is higher than 300?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 300",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: What is the name of the body builder with the greatest body weight?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: What are the birth date and birth place of the body builder with the highest total points?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT T2.Birth_Date , T2.Birth_Place FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC LIMIT 1",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: What are the heights of body builders with total score smaller than 315?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total < 315",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: What is the average total score of body builders with height bigger than 200?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT avg(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: What are the names of body builders in descending order of total scores?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: List each birth place along with the number of people from there.\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT Birth_Place , COUNT(*) FROM people GROUP BY Birth_Place",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: What is the most common birth place of people?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC LIMIT 1",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: What are the birth places that are shared by at least two people?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: List the height and weight of people in descending order of height.\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT Height , Weight FROM people ORDER BY Height DESC",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: Show all information about each body builder.\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT * FROM body_builder",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: List the names and origins of people who are not body builders.\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name , birth_place FROM people EXCEPT SELECT T1.Name , T1.birth_place FROM people AS T1 JOIN body_builder AS T2 ON T1.people_id = T2.people_id",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: How many distinct birth places are there?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT count(DISTINCT Birth_Place) FROM people",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: How many persons are not body builders?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT count(*) FROM people WHERE people_id NOT IN (SELECT People_ID FROM body_builder)",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200.\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT T2.weight FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.snatch > 140 OR T2.height > 200;",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: What are the total scores of the body builders whose birthday contains the string \"January\" ?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT T1.total FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T2.Birth_Date LIKE \"%January%\";",
"role": "assistant"
}
] |
body_builder | [
{
"content": "Translate the following question to SQL: What is the minimum snatch score?\n\nSchema: CREATE TABLE body_builder (\n Body_Builder_ID INT PRIMARY KEY,\n People_ID INT,\n Snatch REAL,\n Clean_Jerk REAL,\n Total REAL,\n UNIQUE (Body_Builder_ID),\n FOREIGN KEY (People_ID) REFERENCES people(People_ID)\n);\n\nCREATE TABLE people (\n People_ID INT PRIMARY KEY,\n Name TEXT,\n Height REAL,\n Weight REAL,\n Birth_Date TEXT,\n Birth_Place TEXT,\n UNIQUE (People_ID)\n);",
"role": "user"
},
{
"content": "SELECT min(snatch) FROM body_builder",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: How many elections are there?\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT count(*) FROM election",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: List the votes of elections in descending order.\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT Votes FROM election ORDER BY Votes DESC",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: List the dates and vote percents of elections.\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT Date , Vote_Percent FROM election",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: What are the minimum and maximum vote percents of elections?\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT min(Vote_Percent) , max(Vote_Percent) FROM election",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: What are the names and parties of representatives?\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name , Party FROM representative",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: What are the names of representatives whose party is not \"Republican\"?\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM Representative WHERE Party != \"Republican\"",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: What are the life spans of representatives from New York state or Indiana state?\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT Lifespan FROM representative WHERE State = \"New York\" OR State = \"Indiana\"",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: What are the names of representatives and the dates of elections they participated in.\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT T2.Name , T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: What are the names of representatives with more than 10000 votes in election?\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE Votes > 10000",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: What are the names of representatives in descending order of votes?\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: What is the party of the representative that has the smallest number of votes.\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes ASC LIMIT 1",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: What are the lifespans of representatives in descending order of vote percent?\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY Vote_Percent DESC",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: What is the average number of votes of representatives from party \"Republican\"?\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = \"Republican\"",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: What are the different parties of representative? Show the party name and the number of representatives in each party.\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT Party , COUNT(*) FROM representative GROUP BY Party",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: What is the party that has the largest number of representatives?\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT Party , COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: What parties have at least three representatives?\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: What states have at least two representatives?\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: List the names of representatives that have not participated in elections listed here.\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election)",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: Show the parties that have both representatives in New York state and representatives in Pennsylvania state.\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT Party FROM representative WHERE State = \"New York\" INTERSECT SELECT Party FROM representative WHERE State = \"Pennsylvania\"",
"role": "assistant"
}
] |
election_representative | [
{
"content": "Translate the following question to SQL: How many distinct parties are there for representatives?\n\nSchema: CREATE TABLE election (\n Election_ID INT PRIMARY KEY,\n Representative_ID INT,\n Date TEXT,\n Votes REAL,\n Vote_Percent REAL,\n Seats REAL,\n Place REAL,\n UNIQUE (Election_ID),\n FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID)\n);\n\nCREATE TABLE representative (\n Representative_ID INT PRIMARY KEY,\n Name TEXT,\n State TEXT,\n Party TEXT,\n Lifespan TEXT,\n UNIQUE (Representative_ID)\n);",
"role": "user"
},
{
"content": "SELECT count(DISTINCT Party) FROM representative",
"role": "assistant"
}
] |
apartment_rentals | [
{
"content": "Translate the following question to SQL: How many apartment bookings are there in total?\n\nSchema: CREATE TABLE Apartment_Buildings (\n building_id INTEGER NOT NULL PRIMARY KEY,\n building_short_name CHAR(15),\n building_full_name VARCHAR(80),\n building_description VARCHAR(255),\n building_address VARCHAR(255),\n building_manager VARCHAR(50),\n building_phone VARCHAR(80),\n UNIQUE (building_id)\n);\n\nCREATE TABLE Apartments (\n apt_id INTEGER NOT NULL PRIMARY KEY,\n building_id INTEGER NOT NULL,\n apt_type_code CHAR(15),\n apt_number CHAR(10),\n bathroom_count INTEGER,\n bedroom_count INTEGER,\n room_count CHAR(5),\n UNIQUE (apt_id),\n FOREIGN KEY (building_id) REFERENCES Apartment_Buildings(building_id)\n);\n\nCREATE TABLE Apartment_Facilities (\n apt_id INTEGER NOT NULL PRIMARY KEY,\n facility_code CHAR(15) NOT NULL PRIMARY KEY,\n PRIMARY KEY (apt_id, facility_code),\n UNIQUE (apt_id, facility_code),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);\n\nCREATE TABLE Guests (\n guest_id INTEGER NOT NULL PRIMARY KEY,\n gender_code CHAR(1),\n guest_first_name VARCHAR(80),\n guest_last_name VARCHAR(80),\n date_of_birth DATETIME,\n UNIQUE (guest_id)\n);\n\nCREATE TABLE Apartment_Bookings (\n apt_booking_id INTEGER NOT NULL PRIMARY KEY,\n apt_id INTEGER,\n guest_id INTEGER NOT NULL,\n booking_status_code CHAR(15) NOT NULL,\n booking_start_date DATETIME,\n booking_end_date DATETIME,\n UNIQUE (apt_booking_id),\n FOREIGN KEY (guest_id) REFERENCES Guests(guest_id),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);\n\nCREATE TABLE View_Unit_Status (\n apt_id INTEGER,\n apt_booking_id INTEGER,\n status_date DATETIME NOT NULL PRIMARY KEY,\n available_yn BIT,\n UNIQUE (status_date),\n FOREIGN KEY (apt_booking_id) REFERENCES Apartment_Bookings(apt_booking_id),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);",
"role": "user"
},
{
"content": "SELECT count(*) FROM Apartment_Bookings",
"role": "assistant"
}
] |
apartment_rentals | [
{
"content": "Translate the following question to SQL: Count the total number of apartment bookings.\n\nSchema: CREATE TABLE Apartment_Buildings (\n building_id INTEGER NOT NULL PRIMARY KEY,\n building_short_name CHAR(15),\n building_full_name VARCHAR(80),\n building_description VARCHAR(255),\n building_address VARCHAR(255),\n building_manager VARCHAR(50),\n building_phone VARCHAR(80),\n UNIQUE (building_id)\n);\n\nCREATE TABLE Apartments (\n apt_id INTEGER NOT NULL PRIMARY KEY,\n building_id INTEGER NOT NULL,\n apt_type_code CHAR(15),\n apt_number CHAR(10),\n bathroom_count INTEGER,\n bedroom_count INTEGER,\n room_count CHAR(5),\n UNIQUE (apt_id),\n FOREIGN KEY (building_id) REFERENCES Apartment_Buildings(building_id)\n);\n\nCREATE TABLE Apartment_Facilities (\n apt_id INTEGER NOT NULL PRIMARY KEY,\n facility_code CHAR(15) NOT NULL PRIMARY KEY,\n PRIMARY KEY (apt_id, facility_code),\n UNIQUE (apt_id, facility_code),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);\n\nCREATE TABLE Guests (\n guest_id INTEGER NOT NULL PRIMARY KEY,\n gender_code CHAR(1),\n guest_first_name VARCHAR(80),\n guest_last_name VARCHAR(80),\n date_of_birth DATETIME,\n UNIQUE (guest_id)\n);\n\nCREATE TABLE Apartment_Bookings (\n apt_booking_id INTEGER NOT NULL PRIMARY KEY,\n apt_id INTEGER,\n guest_id INTEGER NOT NULL,\n booking_status_code CHAR(15) NOT NULL,\n booking_start_date DATETIME,\n booking_end_date DATETIME,\n UNIQUE (apt_booking_id),\n FOREIGN KEY (guest_id) REFERENCES Guests(guest_id),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);\n\nCREATE TABLE View_Unit_Status (\n apt_id INTEGER,\n apt_booking_id INTEGER,\n status_date DATETIME NOT NULL PRIMARY KEY,\n available_yn BIT,\n UNIQUE (status_date),\n FOREIGN KEY (apt_booking_id) REFERENCES Apartment_Bookings(apt_booking_id),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);",
"role": "user"
},
{
"content": "SELECT count(*) FROM Apartment_Bookings",
"role": "assistant"
}
] |
apartment_rentals | [
{
"content": "Translate the following question to SQL: Show the start dates and end dates of all the apartment bookings.\n\nSchema: CREATE TABLE Apartment_Buildings (\n building_id INTEGER NOT NULL PRIMARY KEY,\n building_short_name CHAR(15),\n building_full_name VARCHAR(80),\n building_description VARCHAR(255),\n building_address VARCHAR(255),\n building_manager VARCHAR(50),\n building_phone VARCHAR(80),\n UNIQUE (building_id)\n);\n\nCREATE TABLE Apartments (\n apt_id INTEGER NOT NULL PRIMARY KEY,\n building_id INTEGER NOT NULL,\n apt_type_code CHAR(15),\n apt_number CHAR(10),\n bathroom_count INTEGER,\n bedroom_count INTEGER,\n room_count CHAR(5),\n UNIQUE (apt_id),\n FOREIGN KEY (building_id) REFERENCES Apartment_Buildings(building_id)\n);\n\nCREATE TABLE Apartment_Facilities (\n apt_id INTEGER NOT NULL PRIMARY KEY,\n facility_code CHAR(15) NOT NULL PRIMARY KEY,\n PRIMARY KEY (apt_id, facility_code),\n UNIQUE (apt_id, facility_code),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);\n\nCREATE TABLE Guests (\n guest_id INTEGER NOT NULL PRIMARY KEY,\n gender_code CHAR(1),\n guest_first_name VARCHAR(80),\n guest_last_name VARCHAR(80),\n date_of_birth DATETIME,\n UNIQUE (guest_id)\n);\n\nCREATE TABLE Apartment_Bookings (\n apt_booking_id INTEGER NOT NULL PRIMARY KEY,\n apt_id INTEGER,\n guest_id INTEGER NOT NULL,\n booking_status_code CHAR(15) NOT NULL,\n booking_start_date DATETIME,\n booking_end_date DATETIME,\n UNIQUE (apt_booking_id),\n FOREIGN KEY (guest_id) REFERENCES Guests(guest_id),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);\n\nCREATE TABLE View_Unit_Status (\n apt_id INTEGER,\n apt_booking_id INTEGER,\n status_date DATETIME NOT NULL PRIMARY KEY,\n available_yn BIT,\n UNIQUE (status_date),\n FOREIGN KEY (apt_booking_id) REFERENCES Apartment_Bookings(apt_booking_id),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);",
"role": "user"
},
{
"content": "SELECT booking_start_date , booking_end_date FROM Apartment_Bookings",
"role": "assistant"
}
] |
apartment_rentals | [
{
"content": "Translate the following question to SQL: What are the start date and end date of each apartment booking?\n\nSchema: CREATE TABLE Apartment_Buildings (\n building_id INTEGER NOT NULL PRIMARY KEY,\n building_short_name CHAR(15),\n building_full_name VARCHAR(80),\n building_description VARCHAR(255),\n building_address VARCHAR(255),\n building_manager VARCHAR(50),\n building_phone VARCHAR(80),\n UNIQUE (building_id)\n);\n\nCREATE TABLE Apartments (\n apt_id INTEGER NOT NULL PRIMARY KEY,\n building_id INTEGER NOT NULL,\n apt_type_code CHAR(15),\n apt_number CHAR(10),\n bathroom_count INTEGER,\n bedroom_count INTEGER,\n room_count CHAR(5),\n UNIQUE (apt_id),\n FOREIGN KEY (building_id) REFERENCES Apartment_Buildings(building_id)\n);\n\nCREATE TABLE Apartment_Facilities (\n apt_id INTEGER NOT NULL PRIMARY KEY,\n facility_code CHAR(15) NOT NULL PRIMARY KEY,\n PRIMARY KEY (apt_id, facility_code),\n UNIQUE (apt_id, facility_code),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);\n\nCREATE TABLE Guests (\n guest_id INTEGER NOT NULL PRIMARY KEY,\n gender_code CHAR(1),\n guest_first_name VARCHAR(80),\n guest_last_name VARCHAR(80),\n date_of_birth DATETIME,\n UNIQUE (guest_id)\n);\n\nCREATE TABLE Apartment_Bookings (\n apt_booking_id INTEGER NOT NULL PRIMARY KEY,\n apt_id INTEGER,\n guest_id INTEGER NOT NULL,\n booking_status_code CHAR(15) NOT NULL,\n booking_start_date DATETIME,\n booking_end_date DATETIME,\n UNIQUE (apt_booking_id),\n FOREIGN KEY (guest_id) REFERENCES Guests(guest_id),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);\n\nCREATE TABLE View_Unit_Status (\n apt_id INTEGER,\n apt_booking_id INTEGER,\n status_date DATETIME NOT NULL PRIMARY KEY,\n available_yn BIT,\n UNIQUE (status_date),\n FOREIGN KEY (apt_booking_id) REFERENCES Apartment_Bookings(apt_booking_id),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);",
"role": "user"
},
{
"content": "SELECT booking_start_date , booking_end_date FROM Apartment_Bookings",
"role": "assistant"
}
] |
apartment_rentals | [
{
"content": "Translate the following question to SQL: Show all distinct building descriptions.\n\nSchema: CREATE TABLE Apartment_Buildings (\n building_id INTEGER NOT NULL PRIMARY KEY,\n building_short_name CHAR(15),\n building_full_name VARCHAR(80),\n building_description VARCHAR(255),\n building_address VARCHAR(255),\n building_manager VARCHAR(50),\n building_phone VARCHAR(80),\n UNIQUE (building_id)\n);\n\nCREATE TABLE Apartments (\n apt_id INTEGER NOT NULL PRIMARY KEY,\n building_id INTEGER NOT NULL,\n apt_type_code CHAR(15),\n apt_number CHAR(10),\n bathroom_count INTEGER,\n bedroom_count INTEGER,\n room_count CHAR(5),\n UNIQUE (apt_id),\n FOREIGN KEY (building_id) REFERENCES Apartment_Buildings(building_id)\n);\n\nCREATE TABLE Apartment_Facilities (\n apt_id INTEGER NOT NULL PRIMARY KEY,\n facility_code CHAR(15) NOT NULL PRIMARY KEY,\n PRIMARY KEY (apt_id, facility_code),\n UNIQUE (apt_id, facility_code),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);\n\nCREATE TABLE Guests (\n guest_id INTEGER NOT NULL PRIMARY KEY,\n gender_code CHAR(1),\n guest_first_name VARCHAR(80),\n guest_last_name VARCHAR(80),\n date_of_birth DATETIME,\n UNIQUE (guest_id)\n);\n\nCREATE TABLE Apartment_Bookings (\n apt_booking_id INTEGER NOT NULL PRIMARY KEY,\n apt_id INTEGER,\n guest_id INTEGER NOT NULL,\n booking_status_code CHAR(15) NOT NULL,\n booking_start_date DATETIME,\n booking_end_date DATETIME,\n UNIQUE (apt_booking_id),\n FOREIGN KEY (guest_id) REFERENCES Guests(guest_id),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);\n\nCREATE TABLE View_Unit_Status (\n apt_id INTEGER,\n apt_booking_id INTEGER,\n status_date DATETIME NOT NULL PRIMARY KEY,\n available_yn BIT,\n UNIQUE (status_date),\n FOREIGN KEY (apt_booking_id) REFERENCES Apartment_Bookings(apt_booking_id),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);",
"role": "user"
},
{
"content": "SELECT DISTINCT building_description FROM Apartment_Buildings",
"role": "assistant"
}
] |
apartment_rentals | [
{
"content": "Translate the following question to SQL: Give me a list of all the distinct building descriptions.\n\nSchema: CREATE TABLE Apartment_Buildings (\n building_id INTEGER NOT NULL PRIMARY KEY,\n building_short_name CHAR(15),\n building_full_name VARCHAR(80),\n building_description VARCHAR(255),\n building_address VARCHAR(255),\n building_manager VARCHAR(50),\n building_phone VARCHAR(80),\n UNIQUE (building_id)\n);\n\nCREATE TABLE Apartments (\n apt_id INTEGER NOT NULL PRIMARY KEY,\n building_id INTEGER NOT NULL,\n apt_type_code CHAR(15),\n apt_number CHAR(10),\n bathroom_count INTEGER,\n bedroom_count INTEGER,\n room_count CHAR(5),\n UNIQUE (apt_id),\n FOREIGN KEY (building_id) REFERENCES Apartment_Buildings(building_id)\n);\n\nCREATE TABLE Apartment_Facilities (\n apt_id INTEGER NOT NULL PRIMARY KEY,\n facility_code CHAR(15) NOT NULL PRIMARY KEY,\n PRIMARY KEY (apt_id, facility_code),\n UNIQUE (apt_id, facility_code),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);\n\nCREATE TABLE Guests (\n guest_id INTEGER NOT NULL PRIMARY KEY,\n gender_code CHAR(1),\n guest_first_name VARCHAR(80),\n guest_last_name VARCHAR(80),\n date_of_birth DATETIME,\n UNIQUE (guest_id)\n);\n\nCREATE TABLE Apartment_Bookings (\n apt_booking_id INTEGER NOT NULL PRIMARY KEY,\n apt_id INTEGER,\n guest_id INTEGER NOT NULL,\n booking_status_code CHAR(15) NOT NULL,\n booking_start_date DATETIME,\n booking_end_date DATETIME,\n UNIQUE (apt_booking_id),\n FOREIGN KEY (guest_id) REFERENCES Guests(guest_id),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);\n\nCREATE TABLE View_Unit_Status (\n apt_id INTEGER,\n apt_booking_id INTEGER,\n status_date DATETIME NOT NULL PRIMARY KEY,\n available_yn BIT,\n UNIQUE (status_date),\n FOREIGN KEY (apt_booking_id) REFERENCES Apartment_Bookings(apt_booking_id),\n FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id)\n);",
"role": "user"
},
{
"content": "SELECT DISTINCT building_description FROM Apartment_Buildings",
"role": "assistant"
}
] |