[ { "query": "SELECT count(*) FROM head WHERE age > 56", "question": "How many heads of the departments are older than 56 ?", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT name , born_state , age FROM head ORDER BY age", "question": "List the name, born state and age of the heads of departments ordered by age.", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT creation , name , budget_in_billions FROM department", "question": "List the creation year, name and budget of each department.", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT max(budget_in_billions) , min(budget_in_billions) FROM department", "question": "What are the maximum and minimum budget of the departments?", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT avg(num_employees) FROM department WHERE ranking BETWEEN 10 AND 15", "question": "What is the average number of employees of the departments whose rank is between 10 and 15?", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT name FROM head WHERE born_state != 'California'", "question": "What are the names of the heads who are born outside the California state?", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT DISTINCT T1.creation FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T3.born_state = 'Alabama'", "question": "What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT born_state FROM head GROUP BY born_state HAVING count(*) >= 3", "question": "What are the names of the states where at least 3 heads were born?", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT creation FROM department GROUP BY creation ORDER BY count(*) DESC LIMIT 1", "question": "In which year were most departments established?", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT T1.name , T1.num_employees FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id WHERE T2.temporary_acting = 'Yes'", "question": "Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'?", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT count(DISTINCT temporary_acting) FROM management", "question": "How many acting statuses are there?", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT count(*) FROM department WHERE department_id NOT IN (SELECT department_id FROM management);", "question": "How many departments are led by heads who are not mentioned?", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT DISTINCT T1.age FROM management AS T2 JOIN head AS T1 ON T1.head_id = T2.head_id WHERE T2.temporary_acting = 'Yes'", "question": "What are the distinct ages of the heads who are acting?", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT T3.born_state FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T1.name = 'Treasury' INTERSECT SELECT T3.born_state FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T1.name = 'Homeland Security'", "question": "List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT T1.department_id , T1.name , count(*) FROM management AS T2 JOIN department AS T1 ON T1.department_id = T2.department_id GROUP BY T1.department_id HAVING count(*) > 1", "question": "Which department has more than 1 head at a time? List the id, name and the number of heads.", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT head_id , name FROM head WHERE name LIKE '%Ha%'", "question": "Which head's name has the substring 'Ha'? List the id and name.", "schema": "department: Department_ID (INT), Name (TEXT), Creation (TEXT), Ranking (INT), Budget_in_Billions (REAL), Num_Employees (REAL)\nhead: head_ID (INT), name (TEXT), born_state (TEXT), age (REAL)\nmanagement: department_ID (INT), head_ID (INT), temporary_acting (TEXT)" }, { "query": "SELECT count(*) FROM farm", "question": "How many farms are there?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT count(*) FROM farm", "question": "Count the number of farms.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Total_Horses FROM farm ORDER BY Total_Horses ASC", "question": "List the total number of horses on farms in ascending order.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Total_Horses FROM farm ORDER BY Total_Horses ASC", "question": "What is the total horses record for each farm, sorted ascending?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Hosts FROM farm_competition WHERE Theme != 'Aliens'", "question": "What are the hosts of competitions whose theme is not \"Aliens\"?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Hosts FROM farm_competition WHERE Theme != 'Aliens'", "question": "Return the hosts of competitions for which the theme is not Aliens?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Theme FROM farm_competition ORDER BY YEAR ASC", "question": "What are the themes of farm competitions sorted by year in ascending order?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Theme FROM farm_competition ORDER BY YEAR ASC", "question": "Return the themes of farm competitions, sorted by year ascending.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT avg(Working_Horses) FROM farm WHERE Total_Horses > 5000", "question": "What is the average number of working horses of farms with more than 5000 total number of horses?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT avg(Working_Horses) FROM farm WHERE Total_Horses > 5000", "question": "Give the average number of working horses on farms with more than 5000 total horses.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT max(Cows) , min(Cows) FROM farm", "question": "What are the maximum and minimum number of cows across all farms.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT max(Cows) , min(Cows) FROM farm", "question": "Return the maximum and minimum number of cows across all farms.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT count(DISTINCT Status) FROM city", "question": "How many different statuses do cities have?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT count(DISTINCT Status) FROM city", "question": "Count the number of different statuses.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Official_Name FROM city ORDER BY Population DESC", "question": "List official names of cities in descending order of population.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Official_Name FROM city ORDER BY Population DESC", "question": "What are the official names of cities, ordered descending by population?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Official_Name , Status FROM city ORDER BY Population DESC LIMIT 1", "question": "List the official name and status of the city with the largest population.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Official_Name , Status FROM city ORDER BY Population DESC LIMIT 1", "question": "What is the official name and status of the city with the most residents?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT T2.Year , T1.Official_Name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID", "question": "Show the years and the official names of the host cities of competitions.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT T2.Year , T1.Official_Name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID", "question": "Give the years and official names of the cities of each competition.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT T1.Official_Name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID HAVING COUNT(*) > 1", "question": "Show the official names of the cities that have hosted more than one competition.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT T1.Official_Name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID HAVING COUNT(*) > 1", "question": "What are the official names of cities that have hosted more than one competition?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT T1.Status FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the status of the city that has hosted the greatest number of competitions.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT T1.Status FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the status of the city that has hosted the most competitions?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT T2.Theme FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID WHERE T1.Population > 1000", "question": "Please show the themes of competitions with host cities having populations larger than 1000.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT T2.Theme FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID WHERE T1.Population > 1000", "question": "What are the themes of competitions that have corresponding host cities with more than 1000 residents?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Status , avg(Population) FROM city GROUP BY Status", "question": "Please show the different statuses of cities and the average population of cities with each status.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Status , avg(Population) FROM city GROUP BY Status", "question": "What are the statuses and average populations of each city?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) ASC", "question": "Please show the different statuses, ordered by the number of cities that have each.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) ASC", "question": "Return the different statuses of cities, ascending by frequency.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1", "question": "List the most common type of Status across cities.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the most common status across all cities?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Official_Name FROM city WHERE City_ID NOT IN (SELECT Host_city_ID FROM farm_competition)", "question": "List the official names of cities that have not held any competition.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Official_Name FROM city WHERE City_ID NOT IN (SELECT Host_city_ID FROM farm_competition)", "question": "What are the official names of cities that have not hosted a farm competition?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Status FROM city WHERE Population > 1500 INTERSECT SELECT Status FROM city WHERE Population < 500", "question": "Show the status shared by cities with population bigger than 1500 and smaller than 500.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Status FROM city WHERE Population > 1500 INTERSECT SELECT Status FROM city WHERE Population < 500", "question": "Which statuses correspond to both cities that have a population over 1500 and cities that have a population lower than 500?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Official_Name FROM city WHERE Population > 1500 OR Population < 500", "question": "Find the official names of cities with population bigger than 1500 or smaller than 500.", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Official_Name FROM city WHERE Population > 1500 OR Population < 500", "question": "What are the official names of cities that have population over 1500 or less than 500?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Census_Ranking FROM city WHERE Status != \"Village\"", "question": "Show the census ranking of cities whose status are not \"Village\".", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT Census_Ranking FROM city WHERE Status != \"Village\"", "question": "What are the census rankings of cities that do not have the status \"Village\"?", "schema": "city: City_ID (INT), Official_Name (TEXT), Status (TEXT), Area_km_2 (REAL), Population (REAL), Census_Ranking (TEXT)\nfarm: Farm_ID (INT), Year (INT), Total_Horses (REAL), Working_Horses (REAL), Total_Cattle (REAL), Oxen (REAL), Bulls (REAL), Cows (REAL), Pigs (REAL), Sheep_and_Goats (REAL)\nfarm_competition: Competition_ID (INT), Year (INT), Theme (TEXT), Host_city_ID (INT), Hosts (TEXT)\ncompetition_record: Competition_ID (INT), Farm_ID (INT), Rank (INT)" }, { "query": "SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id ORDER BY count(*) DESC LIMIT 1", "question": "which course has most number of registered students?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of the course with the most registered students?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY count(*) LIMIT 1", "question": "what is id of students who registered some courses but the least number of courses in these students?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY count(*) LIMIT 1", "question": "What are the ids of the students who registered for some courses but had the least number of courses for all students?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T2.first_name , T2.last_name FROM candidates AS T1 JOIN people AS T2 ON T1.candidate_id = T2.person_id", "question": "what are the first name and last name of all candidates?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T2.first_name , T2.last_name FROM candidates AS T1 JOIN people AS T2 ON T1.candidate_id = T2.person_id", "question": "What are the first and last names of all the candidates?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT student_id FROM students WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)", "question": "List the id of students who never attends courses?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT student_id FROM students WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)", "question": "What are the ids of every student who has never attended a course?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT student_id FROM student_course_attendance", "question": "List the id of students who attended some courses?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT student_id FROM student_course_attendance", "question": "What are the ids of all students who have attended at least one course?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T1.student_id , T2.course_name FROM student_course_registrations AS T1 JOIN courses AS T2 ON T1.course_id = T2.course_id", "question": "What are the ids of all students for courses and what are the names of those courses?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1", "question": "What is detail of the student who most recently registered course?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1", "question": "What details do we have on the students who registered for courses most recently?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = \"English\"", "question": "How many students attend course English?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = \"English\"", "question": "How many students are attending English courses?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171", "question": "How many courses do the student whose id is 171 attend?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171", "question": "How many courses does the student with id 171 actually attend?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = \"stanley.monahan@example.org\"", "question": "Find id of the candidate whose email is stanley.monahan@example.org?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = \"stanley.monahan@example.org\"", "question": "What is the id of the candidate whose email is stanley.monahan@example.org?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1", "question": "Find id of the candidate who most recently accessed the course?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1", "question": "What is the id of the candidate who most recently accessed the course?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1", "question": "What is detail of the student who registered the most number of courses?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1", "question": "What are the details of the student who registered for the most number of courses?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T1.student_id , count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id", "question": "List the id of students who registered some courses and the number of their registered courses?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T1.student_id , count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id", "question": "For every student who is registered for some course, how many courses are they registered for?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T3.course_name , count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id", "question": "How many registed students do each course have? List course name and the number of their registered students?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T3.course_name , count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id", "question": "For each course id, how many students are registered and what are the course names?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = \"Pass\"", "question": "Find id of candidates whose assessment code is \"Pass\"?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = \"Pass\"", "question": "What are the ids of the candidates that have an outcome code of Pass?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = \"Fail\"", "question": "Find the cell mobile number of the candidates whose assessment code is \"Fail\"?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = \"Fail\"", "question": "What are the cell phone numbers of the candidates that received an assessment code of \"Fail\"?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT student_id FROM student_course_attendance WHERE course_id = 301", "question": "What are the id of students who registered course 301?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT student_id FROM student_course_attendance WHERE course_id = 301", "question": "What are the ids of the students who registered for course 301?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1", "question": "What is the id of the student who most recently registered course 301?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1", "question": "What are the ids of the students who registered for course 301 most recently?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id", "question": "Find distinct cities of addresses of people?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id", "question": "What are the different cities where people live?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.person_id = T3.student_id", "question": "Find distinct cities of address of students?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.person_id = T3.student_id", "question": "What are the different cities where students live?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT course_name FROM courses ORDER BY course_name", "question": "List the names of courses in alphabetical order?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT course_name FROM courses ORDER BY course_name", "question": "What are the names of the courses in alphabetical order?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT first_name FROM people ORDER BY first_name", "question": "List the first names of people in alphabetical order?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT first_name FROM people ORDER BY first_name", "question": "What are the first names of the people in alphabetical order?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance", "question": "What are the id of students who registered courses or attended courses?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance", "question": "What are the ids of the students who either registered or attended a course?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121", "question": "Find the id of courses which are registered or attended by student whose id is 121?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121", "question": "What are the ids of the courses that are registered or attended by the student whose id is 121?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)", "question": "What are all info of students who registered courses but not attended courses?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)", "question": "What are all details of the students who registered but did not attend any course?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = \"statistics\" ORDER BY T2.registration_date", "question": "List the id of students who registered course statistics in the order of registration date.", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = \"statistics\" ORDER BY T2.registration_date", "question": "What are the ids of the students who registered course statistics by order of registration date?", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = \"statistics\" ORDER BY T2.date_of_attendance", "question": "List the id of students who attended statistics courses in the order of attendance date.", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = \"statistics\" ORDER BY T2.date_of_attendance", "question": "What are the ids of the students who attended courses in the statistics department in order of attendance date.", "schema": "Addresses: address_id (INTEGER), line_1 (VARCHAR(80)), line_2 (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (CHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nPeople: person_id (INTEGER), first_name (VARCHAR(255)), middle_name (VARCHAR(255)), last_name (VARCHAR(255)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), login_name (VARCHAR(40)), password (VARCHAR(40))\nStudents: student_id (INTEGER), student_details (VARCHAR(255))\nCourses: course_id (VARCHAR(100)), course_name (VARCHAR(120)), course_description (VARCHAR(255)), other_details (VARCHAR(255))\nPeople_Addresses: person_address_id (INTEGER), person_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nStudent_Course_Registrations: student_id (INTEGER), course_id (INTEGER), registration_date (DATETIME)\nStudent_Course_Attendance: student_id (INTEGER), course_id (INTEGER), date_of_attendance (DATETIME)\nCandidates: candidate_id (INTEGER), candidate_details (VARCHAR(255))\nCandidate_Assessments: candidate_id (INTEGER), qualification (CHAR(15)), assessment_date (DATETIME), asessment_outcome_code (CHAR(15))" }, { "query": "SELECT date FROM weather WHERE max_temperature_f > 85", "question": "Give me the dates when the max temperature was higher than 85.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT date FROM weather WHERE max_temperature_f > 85", "question": "What are the dates with a maximum temperature higher than 85?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT name FROM station WHERE lat < 37.5", "question": "What are the names of stations that have latitude lower than 37.5?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT name FROM station WHERE lat < 37.5", "question": "What are the names of all stations with a latitude smaller than 37.5?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT city , max(lat) FROM station GROUP BY city", "question": "For each city, return the highest latitude among its stations.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT city , max(lat) FROM station GROUP BY city", "question": "For each city, what is the highest latitude for its stations?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT start_station_name , end_station_name FROM trip ORDER BY id LIMIT 3", "question": "Give me the start station and end station for the trips with the three oldest id.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT start_station_name , end_station_name FROM trip ORDER BY id LIMIT 3", "question": "What is the station station and end station for the trips with the three smallest ids?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT avg(lat) , avg(long) FROM station WHERE city = \"San Jose\"", "question": "What is the average latitude and longitude of stations located in San Jose city?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT avg(lat) , avg(long) FROM station WHERE city = \"San Jose\"", "question": "What is the average latitude and longitude in San Jose?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT id FROM trip ORDER BY duration LIMIT 1", "question": "What is the id of the trip that has the shortest duration?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT id FROM trip ORDER BY duration LIMIT 1", "question": "What is the id of the shortest trip?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT sum(duration) , max(duration) FROM trip WHERE bike_id = 636", "question": "What is the total and maximum duration of trips with bike id 636?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT sum(duration) , max(duration) FROM trip WHERE bike_id = 636", "question": "What is the total and maximum duration for all trips with the bike id 636?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT zip_code , avg(mean_temperature_f) FROM weather WHERE date LIKE \"8/%\" GROUP BY zip_code", "question": "For each zip code, return the average mean temperature of August there.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT zip_code , avg(mean_temperature_f) FROM weather WHERE date LIKE \"8/%\" GROUP BY zip_code", "question": "For each zip code, what is the average mean temperature for all dates that start with '8'?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT count(DISTINCT bike_id) FROM trip", "question": "From the trip record, find the number of unique bikes.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT count(DISTINCT bike_id) FROM trip", "question": "How many different bike ids are there?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT count(DISTINCT city) FROM station", "question": "What is the number of distinct cities the stations are located at?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT count(DISTINCT city) FROM station", "question": "How many different cities have these stations?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT COUNT(*) FROM station WHERE city = \"Mountain View\"", "question": "How many stations does Mountain View city has?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT COUNT(*) FROM station WHERE city = \"Mountain View\"", "question": "How many stations are in Mountain View?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available = 7", "question": "Return the unique name for stations that have ever had 7 bikes available.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available = 7", "question": "What are the different names for each station that has ever had 7 bikes available?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT start_station_name , start_station_id FROM trip WHERE start_date LIKE \"8/%\" GROUP BY start_station_name ORDER BY COUNT(*) DESC LIMIT 1", "question": "Which start station had the most trips starting from August? Give me the name and id of the station.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT start_station_name , start_station_id FROM trip WHERE start_date LIKE \"8/%\" GROUP BY start_station_name ORDER BY COUNT(*) DESC LIMIT 1", "question": "What are the start station's name and id for the one that had the most start trips in August?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT bike_id FROM trip WHERE zip_code = 94002 GROUP BY bike_id ORDER BY COUNT(*) DESC LIMIT 1", "question": "Which bike traveled the most often in zip code 94002?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT bike_id FROM trip WHERE zip_code = 94002 GROUP BY bike_id ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the id of the bike that traveled the most in 94002?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT COUNT(*) FROM weather WHERE mean_humidity > 50 AND mean_visibility_miles > 8", "question": "How many days had both mean humidity above 50 and mean visibility above 8?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT COUNT(*) FROM weather WHERE mean_humidity > 50 AND mean_visibility_miles > 8", "question": "What is the number of days that had an average humity above 50 and an average visibility above 8?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.lat , T1.long , T1.city FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id ORDER BY T2.duration LIMIT 1", "question": "What is the latitude, longitude, city of the station from which the shortest trip started?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.lat , T1.long , T1.city FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id ORDER BY T2.duration LIMIT 1", "question": "What is the latitude, longitude, and city of the station from which the trip with smallest duration started?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT id FROM station WHERE city = \"San Francisco\" INTERSECT SELECT station_id FROM status GROUP BY station_id HAVING avg(bikes_available) > 10", "question": "What are the ids of stations that are located in San Francisco and have average bike availability above 10.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT id FROM station WHERE city = \"San Francisco\" INTERSECT SELECT station_id FROM status GROUP BY station_id HAVING avg(bikes_available) > 10", "question": "What are the ids of the stations in San Francisco that normally have more than 10 bikes available?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.name , T1.id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING avg(T2.bikes_available) > 14 UNION SELECT name , id FROM station WHERE installation_date LIKE \"12/%\"", "question": "What are the names and ids of stations that had more than 14 bikes available on average or were installed in December?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.name , T1.id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING avg(T2.bikes_available) > 14 UNION SELECT name , id FROM station WHERE installation_date LIKE \"12/%\"", "question": "What are the names and ids of all stations that have more than 14 bikes available on average or had bikes installed in December?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT cloud_cover FROM weather WHERE zip_code = 94107 GROUP BY cloud_cover ORDER BY COUNT (*) DESC LIMIT 3", "question": "What is the 3 most common cloud cover rates in the region of zip code 94107?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT cloud_cover FROM weather WHERE zip_code = 94107 GROUP BY cloud_cover ORDER BY COUNT (*) DESC LIMIT 3", "question": "What are the 3 most common cloud covers in the zip code of 94107?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT zip_code FROM weather GROUP BY zip_code ORDER BY avg(mean_sea_level_pressure_inches) LIMIT 1", "question": "What is the zip code in which the average mean sea level pressure is the lowest?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT zip_code FROM weather GROUP BY zip_code ORDER BY avg(mean_sea_level_pressure_inches) LIMIT 1", "question": "What is the zip code that has the lowest average mean sea level pressure?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT avg(bikes_available) FROM status WHERE station_id NOT IN (SELECT id FROM station WHERE city = \"Palo Alto\")", "question": "What is the average bike availability in stations that are not located in Palo Alto?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT avg(bikes_available) FROM status WHERE station_id NOT IN (SELECT id FROM station WHERE city = \"Palo Alto\")", "question": "What is the average bike availablility for stations not in Palo Alto?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT avg(long) FROM station WHERE id NOT IN (SELECT station_id FROM status GROUP BY station_id HAVING max(bikes_available) > 10)", "question": "What is the average longitude of stations that never had bike availability more than 10?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT avg(long) FROM station WHERE id NOT IN (SELECT station_id FROM status GROUP BY station_id HAVING max(bikes_available) > 10)", "question": "What is the mean longitude for all stations that have never had more than 10 bikes available?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT date , zip_code FROM weather WHERE max_temperature_f >= 80", "question": "When and in what zip code did max temperature reach 80?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT date , zip_code FROM weather WHERE max_temperature_f >= 80", "question": "What zip codes have a station with a max temperature greater than or equal to 80 and when did it reach that temperature?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.id FROM trip AS T1 JOIN weather AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.zip_code HAVING avg(T2.mean_temperature_f) > 60", "question": "Give me ids for all the trip that took place in a zip code area with average mean temperature above 60.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.id FROM trip AS T1 JOIN weather AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.zip_code HAVING avg(T2.mean_temperature_f) > 60", "question": "For each zip code, find the ids of all trips that have a higher average mean temperature above 60?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT zip_code , count(*) FROM weather WHERE max_wind_Speed_mph >= 25 GROUP BY zip_code", "question": "For each zip code, return how many times max wind speed reached 25?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT zip_code , count(*) FROM weather WHERE max_wind_Speed_mph >= 25 GROUP BY zip_code", "question": "For each zip code, how many times has the maximum wind speed reached 25 mph?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT date , zip_code FROM weather WHERE min_dew_point_f < (SELECT min(min_dew_point_f) FROM weather WHERE zip_code = 94107)", "question": "On which day and in which zip code was the min dew point lower than any day in zip code 94107?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT date , zip_code FROM weather WHERE min_dew_point_f < (SELECT min(min_dew_point_f) FROM weather WHERE zip_code = 94107)", "question": "Which days had a minimum dew point smaller than any day in zip code 94107, and in which zip codes were those measurements taken?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.id , T2.installation_date FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id", "question": "For each trip, return its ending station's installation date.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.id , T2.installation_date FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id", "question": "What is the installation date for each ending station on all the trips?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.id FROM trip AS T1 JOIN station AS T2 ON T1.start_station_id = T2.id ORDER BY T2.dock_count DESC LIMIT 1", "question": "Which trip started from the station with the largest dock count? Give me the trip id.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.id FROM trip AS T1 JOIN station AS T2 ON T1.start_station_id = T2.id ORDER BY T2.dock_count DESC LIMIT 1", "question": "What is the id of the trip that started from the station with the highest dock count?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT count(*) FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id WHERE T2.city != \"San Francisco\"", "question": "Count the number of trips that did not end in San Francisco city.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT count(*) FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id WHERE T2.city != \"San Francisco\"", "question": "How many trips did not end in San Francisco?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT date FROM weather WHERE zip_code = 94107 AND EVENTS != \"Fog\" AND EVENTS != \"Rain\"", "question": "In zip code 94107, on which day neither Fog nor Rain was not observed?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT date FROM weather WHERE zip_code = 94107 AND EVENTS != \"Fog\" AND EVENTS != \"Rain\"", "question": "On which day has it neither been foggy nor rained in the zip code of 94107?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT id FROM station WHERE lat > 37.4 EXCEPT SELECT station_id FROM status GROUP BY station_id HAVING min(bikes_available) < 7", "question": "What are the ids of stations that have latitude above 37.4 and never had bike availability below 7?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT id FROM station WHERE lat > 37.4 EXCEPT SELECT station_id FROM status GROUP BY station_id HAVING min(bikes_available) < 7", "question": "What are the ids of all stations that have a latitude above 37.4 and have never had less than 7 bikes available?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING avg(bikes_available) > 10 EXCEPT SELECT name FROM station WHERE city = \"San Jose\"", "question": "What are names of stations that have average bike availability above 10 and are not located in San Jose city?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING avg(bikes_available) > 10 EXCEPT SELECT name FROM station WHERE city = \"San Jose\"", "question": "What are the names of all stations that have more than 10 bikes available and are not located in San Jose?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT name , lat , city FROM station ORDER BY lat LIMIT 1", "question": "What are the name, latitude, and city of the station with the lowest latitude?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT name , lat , city FROM station ORDER BY lat LIMIT 1", "question": "What is the name, latitude, and city of the station that is located the furthest South?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT date , mean_temperature_f , mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3", "question": "What are the date, mean temperature and mean humidity for the top 3 days with the largest max gust speeds?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT date , mean_temperature_f , mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3", "question": "What is the date, average temperature and mean humidity for the days with the 3 largest maximum gust speeds?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT city , COUNT(*) FROM station GROUP BY city HAVING COUNT(*) >= 15", "question": "List the name and the number of stations for all the cities that have at least 15 stations.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT city , COUNT(*) FROM station GROUP BY city HAVING COUNT(*) >= 15", "question": "What is the name of every city that has at least 15 stations and how many stations does it have?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT start_station_id , start_station_name FROM trip GROUP BY start_station_name HAVING COUNT(*) >= 200", "question": "Find the ids and names of stations from which at least 200 trips started.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT start_station_id , start_station_name FROM trip GROUP BY start_station_name HAVING COUNT(*) >= 200", "question": "What are the ids and names of all start stations that were the beginning of at least 200 trips?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT zip_code FROM weather GROUP BY zip_code HAVING avg(mean_visibility_miles) < 10", "question": "Find the zip code in which the average mean visibility is lower than 10.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT zip_code FROM weather GROUP BY zip_code HAVING avg(mean_visibility_miles) < 10", "question": "For each zip code, select all those that have an average mean visiblity below 10.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT city FROM station GROUP BY city ORDER BY max(lat) DESC", "question": "List all the cities in a decreasing order of each city's stations' highest latitude.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT city FROM station GROUP BY city ORDER BY max(lat) DESC", "question": "For each city, list their names in decreasing order by their highest station latitude.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT date , cloud_cover FROM weather ORDER BY cloud_cover DESC LIMIT 5", "question": "What are the dates that had the top 5 cloud cover rates? Also tell me the cloud cover rate.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT date , cloud_cover FROM weather ORDER BY cloud_cover DESC LIMIT 5", "question": "What are the dates that have the 5 highest cloud cover rates and what are the rates?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT id , duration FROM trip ORDER BY duration DESC LIMIT 3", "question": "What are the ids and durations of the trips with the top 3 durations?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT id , duration FROM trip ORDER BY duration DESC LIMIT 3", "question": "What are the ids of the trips that lasted the longest and how long did they last?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.name , T1.long , avg(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id GROUP BY T2.start_station_id", "question": "For each station, return its longitude and the average duration of trips that started from the station.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.name , T1.long , avg(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id GROUP BY T2.start_station_id", "question": "For each start station id, what is its name, longitude and average duration of trips started there?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.name , T1.lat , min(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.end_station_id GROUP BY T2.end_station_id", "question": "For each station, find its latitude and the minimum duration of trips that ended at the station.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT T1.name , T1.lat , min(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.end_station_id GROUP BY T2.end_station_id", "question": "For each end station id, what is its name, latitude, and minimum duration for trips ended there?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT DISTINCT start_station_name FROM trip WHERE duration < 100", "question": "List all the distinct stations from which a trip of duration below 100 started.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT DISTINCT start_station_name FROM trip WHERE duration < 100", "question": "What are all the different start station names for a trip that lasted less than 100?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT DISTINCT zip_code FROM weather EXCEPT SELECT DISTINCT zip_code FROM weather WHERE max_dew_point_f >= 70", "question": "Find all the zip codes in which the max dew point have never reached 70.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT DISTINCT zip_code FROM weather EXCEPT SELECT DISTINCT zip_code FROM weather WHERE max_dew_point_f >= 70", "question": "What are all the different zip codes that have a maximum dew point that was always below 70?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT id FROM trip WHERE duration >= (SELECT avg(duration) FROM trip WHERE zip_code = 94103)", "question": "Find the id for the trips that lasted at least as long as the average duration of trips in zip code 94103.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT id FROM trip WHERE duration >= (SELECT avg(duration) FROM trip WHERE zip_code = 94103)", "question": "What are the ids of all trips that had a duration as long as the average trip duration in the zip code 94103?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT date FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31", "question": "What are the dates in which the mean sea level pressure was between 30.3 and 31?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT date FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31", "question": "What are the dates that have an average sea level pressure between 30.3 and 31?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT date , max_temperature_f - min_temperature_f FROM weather ORDER BY max_temperature_f - min_temperature_f LIMIT 1", "question": "Find the day in which the difference between the max temperature and min temperature was the smallest. Also report the difference.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT date , max_temperature_f - min_temperature_f FROM weather ORDER BY max_temperature_f - min_temperature_f LIMIT 1", "question": "What are the days that had the smallest temperature range, and what was that range?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT DISTINCT T1.id , T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12", "question": "What are the id and name of the stations that have ever had more than 12 bikes available?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT DISTINCT T1.id , T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12", "question": "What are the different ids and names of the stations that have had more than 12 bikes available?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT zip_code FROM weather GROUP BY zip_code HAVING avg(mean_humidity) < 70 INTERSECT SELECT zip_code FROM trip GROUP BY zip_code HAVING count(*) >= 100", "question": "Give me the zip code where the average mean humidity is below 70 and at least 100 trips took place.", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT zip_code FROM weather GROUP BY zip_code HAVING avg(mean_humidity) < 70 INTERSECT SELECT zip_code FROM trip GROUP BY zip_code HAVING count(*) >= 100", "question": "What are the zip codes that have an average mean humidity below 70 and had at least 100 trips come through there?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT name FROM station WHERE city = \"Palo Alto\" EXCEPT SELECT end_station_name FROM trip GROUP BY end_station_name HAVING count(*) > 100", "question": "What are the names of stations that are located in Palo Alto city but have never been the ending point of trips more than 100 times?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT name FROM station WHERE city = \"Palo Alto\" EXCEPT SELECT end_station_name FROM trip GROUP BY end_station_name HAVING count(*) > 100", "question": "What are the names of the stations that are located in Palo Alto but have never been the ending point of the trips", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT count(*) FROM station AS T1 JOIN trip AS T2 JOIN station AS T3 JOIN trip AS T4 ON T1.id = T2.start_station_id AND T2.id = T4.id AND T3.id = T4.end_station_id WHERE T1.city = \"Mountain View\" AND T3.city = \"Palo Alto\"", "question": "How many trips started from Mountain View city and ended at Palo Alto city?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT count(*) FROM station AS T1 JOIN trip AS T2 JOIN station AS T3 JOIN trip AS T4 ON T1.id = T2.start_station_id AND T2.id = T4.id AND T3.id = T4.end_station_id WHERE T1.city = \"Mountain View\" AND T3.city = \"Palo Alto\"", "question": "How many trips stated from a station in Mountain View and ended at one in Palo Alto?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT avg(T1.lat) , avg(T1.long) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id", "question": "What is the average latitude and longitude of the starting points of all trips?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT avg(T1.lat) , avg(T1.long) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id", "question": "What is the average latitude and longitude of all starting stations for the trips?", "schema": "station: id (INTEGER), name (TEXT), lat (NUMERIC), long (NUMERIC), dock_count (INTEGER), city (TEXT), installation_date (TEXT)\nstatus: station_id (INTEGER), bikes_available (INTEGER), docks_available (INTEGER), time (TEXT)\ntrip: id (INTEGER), duration (INTEGER), start_date (TEXT), start_station_id (INTEGER), end_date (TEXT), end_station_id (INTEGER), bike_id (INTEGER), subscription_type (TEXT), zip_code (INTEGER)\nweather: date (TEXT), max_temperature_f (INTEGER), mean_temperature_f (INTEGER), min_temperature_f (INTEGER), max_dew_point_f (INTEGER), mean_dew_point_f (INTEGER), min_dew_point_f (INTEGER), max_humidity (INTEGER), mean_humidity (INTEGER), min_humidity (INTEGER), max_sea_level_pressure_inches (NUMERIC), mean_sea_level_pressure_inches (NUMERIC), min_sea_level_pressure_inches (NUMERIC), max_visibility_miles (INTEGER), mean_visibility_miles (INTEGER), min_visibility_miles (INTEGER), max_wind_Speed_mph (INTEGER), mean_wind_speed_mph (INTEGER), max_gust_speed_mph (INTEGER), precipitation_inches (INTEGER), cloud_cover (INTEGER), events (TEXT), wind_dir_degrees (INTEGER), zip_code (INTEGER)" }, { "query": "SELECT count(*) FROM book", "question": "How many books are there?", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT Writer FROM book ORDER BY Writer ASC", "question": "List the writers of the books in ascending alphabetical order.", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT Title FROM book ORDER BY Issues ASC", "question": "List the titles of the books in ascending order of issues.", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT Title FROM book WHERE Writer != \"Elaine Lee\"", "question": "What are the titles of the books whose writer is not \"Elaine Lee\"?", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT Title , Issues FROM book", "question": "What are the title and issues of the books?", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT Publication_Date FROM publication ORDER BY Price DESC", "question": "What are the dates of publications in descending order of price?", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT DISTINCT Publisher FROM publication WHERE Price > 5000000", "question": "What are the distinct publishers of publications with price higher than 5000000?", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT Publisher FROM publication ORDER BY Price DESC LIMIT 1", "question": "List the publisher of the publication with the highest price.", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT Publication_Date FROM publication ORDER BY Price ASC LIMIT 3", "question": "List the publication dates of publications with 3 lowest prices.", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT T1.Title , T2.Publication_Date FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID", "question": "Show the title and publication dates of books.", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT T1.Writer FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID WHERE T2.Price > 4000000", "question": "Show writers who have published a book with price more than 4000000.", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT T1.Title FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID ORDER BY T2.Price DESC", "question": "Show the titles of books in descending order of publication price.", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT Publisher FROM publication GROUP BY Publisher HAVING COUNT(*) > 1", "question": "Show publishers that have more than one publication.", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT Publisher , COUNT(*) FROM publication GROUP BY Publisher", "question": "Show different publishers together with the number of publications they have.", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT Publication_Date FROM publication GROUP BY Publication_Date ORDER BY COUNT(*) DESC LIMIT 1", "question": "Please show the most common publication date.", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT Writer FROM book GROUP BY Writer HAVING COUNT(*) > 1", "question": "List the writers who have written more than one book.", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT Title FROM book WHERE Book_ID NOT IN (SELECT Book_ID FROM publication)", "question": "List the titles of books that are not published.", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT Publisher FROM publication WHERE Price > 10000000 INTERSECT SELECT Publisher FROM publication WHERE Price < 5000000", "question": "Show the publishers that have publications with price higher than 10000000 and publications with price lower than 5000000.", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT COUNT (DISTINCT Publication_Date) FROM publication", "question": "What is the number of distinct publication dates?", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT COUNT (DISTINCT Publication_Date) FROM publication", "question": "How many distinct publication dates are there in our record?", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT Price FROM publication WHERE Publisher = \"Person\" OR Publisher = \"Wiley\"", "question": "Show the prices of publications whose publisher is either \"Person\" or \"Wiley\"", "schema": "publication: Publication_ID (INT), Book_ID (INT), Publisher (TEXT), Publication_Date (TEXT), Price (REAL)\nbook: Book_ID (INT), Title (TEXT), Issues (REAL), Writer (TEXT)" }, { "query": "SELECT count(*) FROM actor", "question": "How many actors are there?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT count(*) FROM actor", "question": "Count the number of actors.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Name FROM actor ORDER BY Name ASC", "question": "List the name of actors in ascending alphabetical order.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Name FROM actor ORDER BY Name ASC", "question": "What are the names of actors, ordered alphabetically?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Character , Duration FROM actor", "question": "What are the characters and duration of actors?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Character , Duration FROM actor", "question": "Return the characters and durations for each actor.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Name FROM actor WHERE Age != 20", "question": "List the name of actors whose age is not 20.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Name FROM actor WHERE Age != 20", "question": "What are the names of actors who are not 20 years old?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Character FROM actor ORDER BY age DESC", "question": "What are the characters of actors in descending order of age?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Character FROM actor ORDER BY age DESC", "question": "Return the characters for actors, ordered by age descending.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1", "question": "What is the duration of the oldest actor?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1", "question": "Return the duration of the actor with the greatest age.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Name FROM musical WHERE Nominee = \"Bob Fosse\"", "question": "What are the names of musicals with nominee \"Bob Fosse\"?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Name FROM musical WHERE Nominee = \"Bob Fosse\"", "question": "Return the names of musicals who have the nominee Bob Fosse.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT DISTINCT Nominee FROM musical WHERE Award != \"Tony Award\"", "question": "What are the distinct nominees of the musicals with the award that is not \"Tony Award\"?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT DISTINCT Nominee FROM musical WHERE Award != \"Tony Award\"", "question": "Return the different nominees of musicals that have an award that is not the Tony Award.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT T1.Name , T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID", "question": "Show names of actors and names of musicals they are in.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT T1.Name , T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID", "question": "What are the names of actors and the musicals that they are in?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID WHERE T2.Name = \"The Phantom of the Opera\"", "question": "Show names of actors that have appeared in musical with name \"The Phantom of the Opera\".", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID WHERE T2.Name = \"The Phantom of the Opera\"", "question": "What are the names of actors who have been in the musical titled The Phantom of the Opera?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID ORDER BY T2.Year DESC", "question": "Show names of actors in descending order of the year their musical is awarded.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID ORDER BY T2.Year DESC", "question": "What are the names of actors ordered descending by the year in which their musical was awarded?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT T2.Name , COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID", "question": "Show names of musicals and the number of actors who have appeared in the musicals.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT T2.Name , COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID", "question": "How many actors have appeared in each musical?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*) >= 3", "question": "Show names of musicals which have at least three actors.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*) >= 3", "question": "What are the names of musicals who have at 3 or more actors?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Nominee , COUNT(*) FROM musical GROUP BY Nominee", "question": "Show different nominees and the number of musicals they have been nominated.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Nominee , COUNT(*) FROM musical GROUP BY Nominee", "question": "How many musicals has each nominee been nominated for?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Nominee FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC LIMIT 1", "question": "Please show the nominee who has been nominated the greatest number of times.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Nominee FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC LIMIT 1", "question": "Who is the nominee who has been nominated for the most musicals?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT RESULT FROM musical GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1", "question": "List the most common result of the musicals.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT RESULT FROM musical GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1", "question": "Return the most frequent result across all musicals.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*) > 2", "question": "List the nominees that have been nominated more than two musicals.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*) > 2", "question": "Who are the nominees who have been nominated more than two times?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Name FROM musical WHERE Musical_ID NOT IN (SELECT Musical_ID FROM actor)", "question": "List the name of musicals that do not have actors.", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Name FROM musical WHERE Musical_ID NOT IN (SELECT Musical_ID FROM actor)", "question": "What are the names of musicals who have no actors?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Nominee FROM musical WHERE Award = \"Tony Award\" INTERSECT SELECT Nominee FROM musical WHERE Award = \"Drama Desk Award\"", "question": "Show the nominees that have nominated musicals for both \"Tony Award\" and \"Drama Desk Award\".", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Nominee FROM musical WHERE Award = \"Tony Award\" INTERSECT SELECT Nominee FROM musical WHERE Award = \"Drama Desk Award\"", "question": "Who are the nominees who have been nominated for both a Tony Award and a Drama Desk Award?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Nominee FROM musical WHERE Award = \"Tony Award\" OR Award = \"Cleavant Derricks\"", "question": "Show the musical nominee with award \"Bob Fosse\" or \"Cleavant Derricks\".", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT Nominee FROM musical WHERE Award = \"Tony Award\" OR Award = \"Cleavant Derricks\"", "question": "Who are the nominees who were nominated for either of the Bob Fosse or Cleavant Derricks awards?", "schema": "musical: Musical_ID (INT), Name (TEXT), Year (INT), Award (TEXT), Category (TEXT), Nominee (TEXT), Result (TEXT)\nactor: Actor_ID (INT), Name (TEXT), Musical_ID (INT), Character (TEXT), Duration (TEXT), age (INT)" }, { "query": "SELECT distinct(catalog_entry_name) FROM catalog_contents", "question": "Find the names of all the catalog entries.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT distinct(catalog_entry_name) FROM catalog_contents", "question": "What are all the catalog entry names?", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*) > 3", "question": "Find the list of attribute data types possessed by more than 3 attribute definitions.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*) > 3", "question": "What are the attribute data types with more than 3 attribute definitions?", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name = \"Green\"", "question": "What is the attribute data type of the attribute with name \"Green\"?", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name = \"Green\"", "question": "Find the attribute data type for the attribute named \"Green\".", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_level_name , catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10", "question": "Find the name and level of catalog structure with level between 5 and 10.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_level_name , catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10", "question": "What are the name and level of catalog structure with level number between 5 and 10", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE \"%Murray%\"", "question": "Find all the catalog publishers whose name contains \"Murray\"", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE \"%Murray%\"", "question": "Which catalog publishers have substring \"Murray\" in their names?", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 1", "question": "Which catalog publisher has published the most catalogs?", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 1", "question": "Find the catalog publisher that has the most catalogs.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT t1.catalog_name , t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id = t2.catalog_id WHERE catalog_level_number > 5", "question": "Find the names and publication dates of all catalogs that have catalog level number greater than 5.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT t1.catalog_name , t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id = t2.catalog_id WHERE catalog_level_number > 5", "question": "What are the name and publication date of the catalogs with catalog level number above 5?", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_value = (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 1)", "question": "What are the entry names of catalog with the attribute possessed by most entries.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_value = (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 1)", "question": "Find the entry names of the catalog with the attribute that have the most entries.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1", "question": "What is the entry name of the most expensive catalog (in USD)?", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1", "question": "Find the entry name of the catalog with the highest price (in USD).", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number = t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 1", "question": "What is the level name of the cheapest catalog (in USD)?", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number = t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 1", "question": "Find the level name of the catalog with the lowest price (in USD).", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT avg(price_in_euros) , min(price_in_euros) FROM catalog_contents", "question": "What are the average and minimum price (in Euro) of all products?", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT avg(price_in_euros) , min(price_in_euros) FROM catalog_contents", "question": "Give me the average and minimum price (in Euro) of the products.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1", "question": "What is the product with the highest height? Give me the catalog entry name.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1", "question": "Which catalog content has the highest height? Give me the catalog entry name.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 1", "question": "Find the name of the product that has the smallest capacity.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 1", "question": "Which catalog content has the smallest capacity? Return the catalog entry name.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE \"2%\"", "question": "Find the names of all the products whose stock number starts with \"2\".", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE \"2%\"", "question": "Which catalog contents have a product stock number that starts from \"2\"? Show the catalog entry names.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = \"8\"", "question": "Find the names of catalog entries with level number 8.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = \"8\"", "question": "What are the names of catalog entries with level number 8?", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5", "question": "Find the names of the products with length smaller than 3 or height greater than 5.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5", "question": "Which catalog contents have length below 3 or above 5? Find the catalog entry names.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT t1.attribute_name , t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0", "question": "Find the name and attribute ID of the attribute definitions with attribute value 0.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT t1.attribute_name , t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0", "question": "Which attribute definitions have attribute value 0? Give me the attribute name and attribute ID.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_entry_name , capacity FROM Catalog_Contents WHERE price_in_dollars > 700", "question": "Find the name and capacity of products with price greater than 700 (in USD).", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_entry_name , capacity FROM Catalog_Contents WHERE price_in_dollars > 700", "question": "Which catalog contents has price above 700 dollars? Show their catalog entry names and capacities.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING count(*) > 1", "question": "Find the dates on which more than one revisions were made.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING count(*) > 1", "question": "On which days more than one revisions were made on catalogs.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT count(*) FROM catalog_contents", "question": "How many products are there in the records?", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT count(*) FROM catalog_contents", "question": "Find the total number of catalog contents.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id > 8", "question": "Name all the products with next entry ID greater than 8.", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id > 8", "question": "What are the catalog entry names of the products with next entry ID above 8?", "schema": "Attribute_Definitions: attribute_id (INTEGER), attribute_name (VARCHAR(30)), attribute_data_type (VARCHAR(10))\nCatalogs: catalog_id (INTEGER), catalog_name (VARCHAR(50)), catalog_publisher (VARCHAR(80)), date_of_publication (DATETIME), date_of_latest_revision (DATETIME)\nCatalog_Structure: catalog_level_number (INTEGER), catalog_id (INTEGER), catalog_level_name (VARCHAR(50))\nCatalog_Contents: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), parent_entry_id (INTEGER), previous_entry_id (INTEGER), next_entry_id (INTEGER), catalog_entry_name (VARCHAR(80)), product_stock_number (VARCHAR(50)), price_in_dollars (DOUBLE), price_in_euros (DOUBLE), price_in_pounds (DOUBLE), capacity (VARCHAR(20)), length (VARCHAR(20)), height (VARCHAR(20)), width (VARCHAR(20))\nCatalog_Contents_Additional_Attributes: catalog_entry_id (INTEGER), catalog_level_number (INTEGER), attribute_id (INTEGER), attribute_value (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Aircraft", "question": "How many aircrafts do we have?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT count(*) FROM Aircraft", "question": "How many aircrafts exist in the database?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name , distance FROM Aircraft", "question": "Show name and distance for all aircrafts.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name , distance FROM Aircraft", "question": "What are the names and distances for all airplanes?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT aid FROM Aircraft WHERE distance > 1000", "question": "Show ids for all aircrafts with more than 1000 distance.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT aid FROM Aircraft WHERE distance > 1000", "question": "What are the ids of all aircrafts that can cover a distance of more than 1000?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT count(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000", "question": "How many aircrafts have distance between 1000 and 5000?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT count(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000", "question": "What is the count of aircrafts that have a distance between 1000 and 5000?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name , distance FROM Aircraft WHERE aid = 12", "question": "What is the name and distance for aircraft with id 12?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name , distance FROM Aircraft WHERE aid = 12", "question": "What is the name and distance for the aircraft that has an id of 12?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT min(distance) , avg(distance) , max(distance) FROM Aircraft", "question": "What is the minimum, average, and maximum distance of all aircrafts.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT min(distance) , avg(distance) , max(distance) FROM Aircraft", "question": "Return the minimum, average and maximum distances traveled across all aircrafts.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT aid , name FROM Aircraft ORDER BY distance DESC LIMIT 1", "question": "Show the id and name of the aircraft with the maximum distance.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT aid , name FROM Aircraft ORDER BY distance DESC LIMIT 1", "question": "What is the id and name of the aircraft that can cover the maximum distance?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name FROM Aircraft ORDER BY distance LIMIT 3", "question": "Show the name of aircrafts with top three lowest distances.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name FROM Aircraft ORDER BY distance LIMIT 3", "question": "What are the aircrafts with top 3 shortest lengthes? List their names.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name FROM Aircraft WHERE distance > (SELECT avg(distance) FROM Aircraft)", "question": "Show names for all aircrafts with distances more than the average.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name FROM Aircraft WHERE distance > (SELECT avg(distance) FROM Aircraft)", "question": "What are the names of all aircrafts that can cover more distances than average?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT count(*) FROM Employee", "question": "How many employees do we have?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT count(*) FROM Employee", "question": "What is the number of employees?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name , salary FROM Employee ORDER BY salary", "question": "Show name and salary for all employees sorted by salary.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name , salary FROM Employee ORDER BY salary", "question": "What is the name and salary of all employees in order of salary?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT eid FROM Employee WHERE salary > 100000", "question": "Show ids for all employees with at least 100000 salary.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT eid FROM Employee WHERE salary > 100000", "question": "What is the id of every employee who has at least a salary of 100000?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT count(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000", "question": "How many employees have salary between 100000 and 200000?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT count(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000", "question": "What is the number of employees that have a salary between 100000 and 200000?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name , salary FROM Employee WHERE eid = 242518965", "question": "What is the name and salary for employee with id 242518965?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name , salary FROM Employee WHERE eid = 242518965", "question": "What is the name and salary of the employee with the id 242518965?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT avg(salary) , max(salary) FROM Employee", "question": "What is average and maximum salary of all employees.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT avg(salary) , max(salary) FROM Employee", "question": "What is the average and largest salary of all employees?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT eid , name FROM Employee ORDER BY salary DESC LIMIT 1", "question": "Show the id and name of the employee with maximum salary.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT eid , name FROM Employee ORDER BY salary DESC LIMIT 1", "question": "What is the id and name of the employee with the highest salary?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name FROM Employee ORDER BY salary ASC LIMIT 3", "question": "Show the name of employees with three lowest salaries.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name FROM Employee ORDER BY salary ASC LIMIT 3", "question": "What is the name of the 3 employees who get paid the least?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name FROM Employee WHERE salary > (SELECT avg(salary) FROM Employee)", "question": "Show names for all employees with salary more than the average.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name FROM Employee WHERE salary > (SELECT avg(salary) FROM Employee)", "question": "What are the names of all employees who have a salary higher than average?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT eid , salary FROM Employee WHERE name = 'Mark Young'", "question": "Show the id and salary of Mark Young.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT eid , salary FROM Employee WHERE name = 'Mark Young'", "question": "What is the id and salary of the employee named Mark Young?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT count(*) FROM Flight", "question": "How many flights do we have?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT count(*) FROM Flight", "question": "What is the number of flights?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT flno , origin , destination FROM Flight ORDER BY origin", "question": "Show flight number, origin, destination of all flights in the alphabetical order of the departure cities.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT flno , origin , destination FROM Flight ORDER BY origin", "question": "What is the flight number, origin, and destination for all flights in alphabetical order by departure cities?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT flno FROM Flight WHERE origin = \"Los Angeles\"", "question": "Show all flight number from Los Angeles.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT flno FROM Flight WHERE origin = \"Los Angeles\"", "question": "What are the numbers of all flights coming from Los Angeles?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT origin FROM Flight WHERE destination = \"Honolulu\"", "question": "Show origins of all flights with destination Honolulu.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT origin FROM Flight WHERE destination = \"Honolulu\"", "question": "What are the origins of all flights that are headed to Honolulu?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT departure_date , arrival_date FROM Flight WHERE origin = \"Los Angeles\" AND destination = \"Honolulu\"", "question": "Show me the departure date and arrival date for all flights from Los Angeles to Honolulu.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT departure_date , arrival_date FROM Flight WHERE origin = \"Los Angeles\" AND destination = \"Honolulu\"", "question": "What are the departure and arrival dates of all flights from LA to Honolulu?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT flno FROM Flight WHERE distance > 2000", "question": "Show flight number for all flights with more than 2000 distance.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT flno FROM Flight WHERE distance > 2000", "question": "What are the numbers of all flights that can cover a distance of more than 2000?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT avg(price) FROM Flight WHERE origin = \"Los Angeles\" AND destination = \"Honolulu\"", "question": "What is the average price for flights from Los Angeles to Honolulu.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT avg(price) FROM Flight WHERE origin = \"Los Angeles\" AND destination = \"Honolulu\"", "question": "What is the average price for flights from LA to Honolulu?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT origin , destination FROM Flight WHERE price > 300", "question": "Show origin and destination for flights with price higher than 300.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT origin , destination FROM Flight WHERE price > 300", "question": "What is the origin and destination for all flights whose price is higher than 300?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT flno , distance FROM Flight ORDER BY price DESC LIMIT 1", "question": "Show the flight number and distance of the flight with maximum price.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT flno , distance FROM Flight ORDER BY price DESC LIMIT 1", "question": "What is the flight number and its distance for the one with the maximum price?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3", "question": "Show the flight number of flights with three lowest distances.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3", "question": "What are the numbers of the shortest flights?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT avg(distance) , avg(price) FROM Flight WHERE origin = \"Los Angeles\"", "question": "What is the average distance and average price for flights from Los Angeles.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT avg(distance) , avg(price) FROM Flight WHERE origin = \"Los Angeles\"", "question": "What is the average distance and price for all flights from LA?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT origin , count(*) FROM Flight GROUP BY origin", "question": "Show all origins and the number of flights from each origin.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT origin , count(*) FROM Flight GROUP BY origin", "question": "For each origin, how many flights came from there?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT destination , count(*) FROM Flight GROUP BY destination", "question": "Show all destinations and the number of flights to each destination.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT destination , count(*) FROM Flight GROUP BY destination", "question": "What are the destinations and number of flights to each one?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1", "question": "Which origin has most number of flights?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1", "question": "What place has the most flights coming from there?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1", "question": "Which destination has least number of flights?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1", "question": "What destination has the fewest number of flights?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99", "question": "What is the aircraft name for the flight with number 99", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99", "question": "What is the name of the aircraft that was on flight number 99?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = \"Airbus A340-300\"", "question": "Show all flight numbers with aircraft Airbus A340-300.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = \"Airbus A340-300\"", "question": "What are the flight numbers for the aircraft Airbus A340-300?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T2.name , count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid", "question": "Show aircraft names and number of flights for each aircraft.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T2.name , count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid", "question": "What is the name of each aircraft and how many flights does each one complete?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2", "question": "Show names for all aircraft with at least two flights.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2", "question": "What are the names for all aircrafts with at least 2 flights?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT count(DISTINCT eid) FROM Certificate", "question": "How many employees have certificate.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT count(DISTINCT eid) FROM Certificate", "question": "What is the count of distinct employees with certificates?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate", "question": "Show ids for all employees who don't have a certificate.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate", "question": "What are the ids of all employees that don't have certificates?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = \"John Williams\"", "question": "Show names for all aircrafts of which John Williams has certificates.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = \"John Williams\"", "question": "What are the names of all aircrafts that John Williams have certificates to be able to fly?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = \"Boeing 737-800\"", "question": "Show names for all employees who have certificate of Boeing 737-800.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = \"Boeing 737-800\"", "question": "What are the names of all employees who have a certificate to fly Boeing 737-800?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = \"Boeing 737-800\" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = \"Airbus A340-300\"", "question": "Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = \"Boeing 737-800\" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = \"Airbus A340-300\"", "question": "What are the names of all employees who can fly both the Boeing 737-800 and the Airbus A340-300?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = \"Boeing 737-800\"", "question": "Show names for all employees who do not have certificate of Boeing 737-800.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = \"Boeing 737-800\"", "question": "What are the names of all employees who are not certified to fly Boeing 737-800s?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count(*) DESC LIMIT 1", "question": "Show the name of aircraft which fewest people have its certificate.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count(*) DESC LIMIT 1", "question": "What are the names of the aircraft that the least people are certified to fly?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY count(*) >= 5", "question": "Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate.", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY count(*) >= 5", "question": "What is the name and distance of every aircraft that can cover a distance of more than 5000 and which at least 5 people can fly?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T1.name , T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1", "question": "what is the salary and name of the employee who has the most number of aircraft certificates?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T1.name , T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1", "question": "What is the salaray and name of the employee that is certified to fly the most planes?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.distance > 5000 GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1", "question": "What is the salary and name of the employee who has the most number of certificates on aircrafts with distance more than 5000?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.distance > 5000 GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1", "question": "What is the salaray and name of the employee with the most certificates to fly planes more than 5000?", "schema": "flight(: flno (NUMBER(40)), origin (VARCHAR2(20)), destination (VARCHAR2(20)), distance (NUMBER(60)), departure_date (DATE), arrival_date (DATE), price (NUMBER(72)), aid (NUMBER(90))\naircraft(: aid (NUMBER(90)), name (VARCHAR2(30)), distance (NUMBER(60))\nemployee(: eid (NUMBER(90)), name (VARCHAR2(30)), salary (NUMBER(102))\ncertificate(: eid (NUMBER(90)), aid (NUMBER(90))" }, { "query": "SELECT count(DISTINCT allergy) FROM Allergy_type", "question": "How many allergies are there?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(DISTINCT allergy) FROM Allergy_type", "question": "How many allergy entries are there?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(DISTINCT allergytype) FROM Allergy_type", "question": "How many different allergy types exist?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(DISTINCT allergytype) FROM Allergy_type", "question": "How many distinct allergies are there?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT DISTINCT allergytype FROM Allergy_type", "question": "Show all allergy types.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT DISTINCT allergytype FROM Allergy_type", "question": "What are the different allergy types?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT allergy , allergytype FROM Allergy_type", "question": "Show all allergies and their types.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT allergy , allergytype FROM Allergy_type", "question": "What are the allergies and their types?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = \"food\"", "question": "Show all allergies with type food.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = \"food\"", "question": "What are all the different food allergies?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT allergytype FROM Allergy_type WHERE allergy = \"Cat\"", "question": "What is the type of allergy Cat?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT allergytype FROM Allergy_type WHERE allergy = \"Cat\"", "question": "What is allergy type of a cat allergy?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Allergy_type WHERE allergytype = \"animal\"", "question": "How many allergies have type animal?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Allergy_type WHERE allergytype = \"animal\"", "question": "How many animal type allergies exist?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT allergytype , count(*) FROM Allergy_type GROUP BY allergytype", "question": "Show all allergy types and the number of allergies in each type.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT allergytype , count(*) FROM Allergy_type GROUP BY allergytype", "question": "What are the allergy types and how many allergies correspond to each one?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1", "question": "Which allergy type has most number of allergies?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1", "question": "Which allergy type is most common?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1", "question": "Which allergy type has least number of allergies?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1", "question": "Which allergy type is the least common?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Student", "question": "How many students are there?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Student", "question": "What is the total number of students?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT Fname , Lname FROM Student", "question": "Show first name and last name for all students.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT Fname , Lname FROM Student", "question": "What are the full names of all students", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(DISTINCT advisor) FROM Student", "question": "How many different advisors are listed?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(DISTINCT advisor) FROM Student", "question": "How many advisors are there?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT DISTINCT Major FROM Student", "question": "Show all majors.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT DISTINCT Major FROM Student", "question": "What are the different majors?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT DISTINCT city_code FROM Student", "question": "Show all cities where students live.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT DISTINCT city_code FROM Student", "question": "What cities do students live in?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT Fname , Lname , Age FROM Student WHERE Sex = 'F'", "question": "Show first name, last name, age for all female students. Their sex is F.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT Fname , Lname , Age FROM Student WHERE Sex = 'F'", "question": "What are the full names and ages for all female students whose sex is F?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT StuID FROM Student WHERE Sex = 'M'", "question": "Show student ids for all male students.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT StuID FROM Student WHERE Sex = 'M'", "question": "What are the student ids for all male students?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Student WHERE age = 18", "question": "How many students are age 18?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Student WHERE age = 18", "question": "How many students are 18 years old?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT StuID FROM Student WHERE age > 20", "question": "Show all student ids who are older than 20.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT StuID FROM Student WHERE age > 20", "question": "What are the student ids for students over 20 years old?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT city_code FROM Student WHERE LName = \"Kim\"", "question": "Which city does the student whose last name is \"Kim\" live in?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT city_code FROM Student WHERE LName = \"Kim\"", "question": "Give the city that the student whose family name is Kim lives in.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT Advisor FROM Student WHERE StuID = 1004", "question": "Who is the advisor of student with ID 1004?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT Advisor FROM Student WHERE StuID = 1004", "question": "Who advises student 1004?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Student WHERE city_code = \"HKG\" OR city_code = \"CHI\"", "question": "How many students live in HKG or CHI?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Student WHERE city_code = \"HKG\" OR city_code = \"CHI\"", "question": "Give the number of students living in either HKG or CHI.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT min(age) , avg(age) , max(age) FROM Student", "question": "Show the minimum, average, and maximum age of all students.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT min(age) , avg(age) , max(age) FROM Student", "question": "What is the minimum, mean, and maximum age across all students?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT LName FROM Student WHERE age = (SELECT min(age) FROM Student)", "question": "What is the last name of the youngest student?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT LName FROM Student WHERE age = (SELECT min(age) FROM Student)", "question": "Provide the last name of the youngest student.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT StuID FROM Student WHERE age = (SELECT max(age) FROM Student)", "question": "Show the student id of the oldest student.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT StuID FROM Student WHERE age = (SELECT max(age) FROM Student)", "question": "What student id corresponds to the oldest student?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT major , count(*) FROM Student GROUP BY major", "question": "Show all majors and corresponding number of students.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT major , count(*) FROM Student GROUP BY major", "question": "How many students are there for each major?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1", "question": "Which major has most number of students?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1", "question": "What is the largest major?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT age , count(*) FROM Student GROUP BY age", "question": "Show all ages and corresponding number of students.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT age , count(*) FROM Student GROUP BY age", "question": "How old is each student and how many students are each age?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT avg(age) , sex FROM Student GROUP BY sex", "question": "Show the average age for male and female students.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT avg(age) , sex FROM Student GROUP BY sex", "question": "What are the average ages for male and female students?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT city_code , count(*) FROM Student GROUP BY city_code", "question": "Show all cities and corresponding number of students.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT city_code , count(*) FROM Student GROUP BY city_code", "question": "How many students live in each city?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT advisor , count(*) FROM Student GROUP BY advisor", "question": "Show all advisors and corresponding number of students.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT advisor , count(*) FROM Student GROUP BY advisor", "question": "How many students does each advisor have?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1", "question": "Which advisor has most number of students?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1", "question": "Give the advisor with the most students.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Has_allergy WHERE Allergy = \"Cat\"", "question": "How many students have cat allergies?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Has_allergy WHERE Allergy = \"Cat\"", "question": "How many students are affected by cat allergies?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2", "question": "Show all student IDs who have at least two allergies.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2", "question": "What are the students ids of students who have more than one allergy?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy", "question": "What are the student ids of students who don't have any allergies?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy", "question": "Which students are unaffected by allergies?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = \"F\" AND T1.allergy = \"Milk\" OR T1.allergy = \"Eggs\"", "question": "How many female students have milk or egg allergies?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = \"F\" AND T1.allergy = \"Milk\" OR T1.allergy = \"Eggs\"", "question": "How many students who are female are allergic to milk or eggs?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = \"food\"", "question": "How many students have a food allergy?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = \"food\"", "question": "How many students are affected by food related allergies?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1", "question": "Which allergy has most number of students affected?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1", "question": "Which allergy is the most common?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT Allergy , count(*) FROM Has_allergy GROUP BY Allergy", "question": "Show all allergies with number of students affected.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT Allergy , count(*) FROM Has_allergy GROUP BY Allergy", "question": "How many students have each different allergy?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT T2.allergytype , count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype", "question": "Show all allergy type with number of students affected.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT T2.allergytype , count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype", "question": "How many students are affected by each allergy type?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT lname , age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = \"Milk\" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = \"Cat\")", "question": "Find the last name and age of the student who has allergy to both milk and cat.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT lname , age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = \"Milk\" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = \"Cat\")", "question": "What are the last names and ages of the students who are allergic to milk and cat?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT T1.Allergy , T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = \"Lisa\" ORDER BY T1.Allergy", "question": "What are the allergies and their types that the student with first name Lisa has? And order the result by name of allergies.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT T1.Allergy , T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = \"Lisa\" ORDER BY T1.Allergy", "question": "What are the allergies the girl named Lisa has? And what are the types of them? Order the result by allergy names.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT fname , sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = \"Milk\" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = \"Cat\")", "question": "Find the first name and gender of the student who has allergy to milk but not cat.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT fname , sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = \"Milk\" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = \"Cat\")", "question": "What are the first name and gender of the students who have allergy to milk but can put up with cats?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"animal\")", "question": "Find the average age of the students who have allergies with food and animal types.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"animal\")", "question": "How old are the students with allergies to food and animal types on average?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\")", "question": "List the first and last name of the students who do not have any food type allergy.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\")", "question": "What is the full name of each student who is not allergic to any type of food.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Student WHERE sex = \"M\" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\")", "question": "Find the number of male (sex is 'M') students who have some food type allery.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Student WHERE sex = \"M\" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\")", "question": "How many male students (sex is 'M') are allergic to any type of food?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT DISTINCT T1.fname , T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = \"Milk\" OR T2.Allergy = \"Cat\"", "question": "Find the different first names and cities of the students who have allergy to milk or cat.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT DISTINCT T1.fname , T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = \"Milk\" OR T2.Allergy = \"Cat\"", "question": "What are the distinct first names and cities of the students who have allergy either to milk or to cat?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\" OR T2.allergytype = \"animal\")", "question": "Find the number of students who are older than 18 and do not have allergy to either food or animal.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\" OR T2.allergytype = \"animal\")", "question": "How many students are over 18 and do not have allergy to food type or animal type?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = \"Soy\")", "question": "Find the first name and major of the students who are not allegry to soy.", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = \"Soy\")", "question": "What are the first name and major of the students who are able to consume soy?", "schema": "Allergy_Type: Allergy (VARCHAR(20)), AllergyType (VARCHAR(20))\nHas_Allergy: StuID (INTEGER), Allergy (VARCHAR(20))\nStudent: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))" }, { "query": "SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 5;", "question": "A list of the top 5 countries by number of invoices. List country name and number of invoices.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 5;", "question": "What are the top 5 countries by number of invoices and how many do they have?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8;", "question": "A list of the top 8 countries by gross/total invoice size. List country name and gross invoice size.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8;", "question": "What are the names of the top 8 countries by total invoice size and what are those sizes?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10;", "question": "A list of the top 10 countries by average invoice size. List country name and average invoice size.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10;", "question": "What are the names of the countries and average invoice size of the top countries by size?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5;", "question": "Find out 5 customers who most recently purchased something. List customers' first and last name.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5;", "question": "What are the first and last names of the 5 customers who purchased something most recently?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.first_name , T1.last_name , COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10;", "question": "Find out the top 10 customers by total number of orders. List customers' first and last name and the number of total orders.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.first_name , T1.last_name , COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10;", "question": "What are the top 10 customers' first and last names by total number of orders and how many orders did they make?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.first_name , T1.last_name , SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10;", "question": "List the top 10 customers by total gross sales. List customers' first and last name and total gross sales.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.first_name , T1.last_name , SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10;", "question": "What are the top 10 customers' first and last names with the highest gross sales, and also what are the sales?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.name , COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 5;", "question": "List the top 5 genres by number of tracks. List genres name and total tracks.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.name , COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 5;", "question": "How many tracks does each genre have and what are the names of the top 5?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT title FROM albums;", "question": "List every album's title.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT title FROM albums;", "question": "What are the titles of all the albums?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT title FROM albums ORDER BY title;", "question": "List every album ordered by album title in ascending order.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT title FROM albums ORDER BY title;", "question": "What are the titles of all the albums alphabetically ascending?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title;", "question": "List every album whose title starts with A in alphabetical order.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title;", "question": "What are the titles of all albums that start with A in alphabetical order?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10;", "question": "List the customers first and last name of 10 least expensive invoices.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10;", "question": "What are the first and last names of the customers with the 10 cheapest invoices?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT sum(total) FROM invoices WHERE billing_city = \"Chicago\" AND billing_state = \"IL\";", "question": "List total amount of invoice from Chicago, IL.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT sum(total) FROM invoices WHERE billing_city = \"Chicago\" AND billing_state = \"IL\";", "question": "What are the total amount of money in the invoices billed from Chicago, Illinois?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT COUNT(*) FROM invoices WHERE billing_city = \"Chicago\" AND billing_state = \"IL\";", "question": "List the number of invoices from Chicago, IL.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT COUNT(*) FROM invoices WHERE billing_city = \"Chicago\" AND billing_state = \"IL\";", "question": "How many invoices were billed from Chicago, IL?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = \"USA\" GROUP BY billing_state;", "question": "List the number of invoices from the US, grouped by state.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = \"USA\" GROUP BY billing_state;", "question": "How many invoices were billed from each state?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = \"USA\" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1;", "question": "List the state in the US with the most invoices.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = \"USA\" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1;", "question": "What are the states with the most invoices?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT billing_state , COUNT(*) , SUM(total) FROM invoices WHERE billing_state = \"CA\";", "question": "List the number of invoices and the invoice total from California.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT billing_state , COUNT(*) , SUM(total) FROM invoices WHERE billing_state = \"CA\";", "question": "What is the number of invoices and total money billed in them from CA?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = \"Aerosmith\";", "question": "List Aerosmith's albums.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = \"Aerosmith\";", "question": "What are the titles of all the Aerosmith albums?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = \"Billy Cobham\";", "question": "How many albums does Billy Cobham has?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = \"Billy Cobham\";", "question": "How many albums has Billy Cobam released?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT company FROM customers WHERE first_name = \"Eduardo\" AND last_name = \"Martins\";", "question": "Eduardo Martins is a customer at which company?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT company FROM customers WHERE first_name = \"Eduardo\" AND last_name = \"Martins\";", "question": "What is the company where Eduardo Martins is a customer?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT email , phone FROM customers WHERE first_name = \"Astrid\" AND last_name = \"Gruber\";", "question": "What is Astrid Gruber's email and phone number?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT email , phone FROM customers WHERE first_name = \"Astrid\" AND last_name = \"Gruber\";", "question": "What is the email and phone number of Astrid Gruber the customer?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) FROM customers WHERE city = \"Prague\";", "question": "How many customers live in Prague city?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) FROM customers WHERE city = \"Prague\";", "question": "How many customers live in the city of Prague?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) FROM customers WHERE state = \"CA\";", "question": "How many customers in state of CA?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) FROM customers WHERE state = \"CA\";", "question": "How many customers are from California?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT country FROM customers WHERE first_name = \"Roberto\" AND last_name = \"Almeida\";", "question": "What country does Roberto Almeida live?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT country FROM customers WHERE first_name = \"Roberto\" AND last_name = \"Almeida\";", "question": "In which country does Roberto Almeida?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%'", "question": "List the name of albums that are released by aritist whose name has 'Led'", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%'", "question": "What is the title of the album that was released by the artist whose name has the phrase 'Led'?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = \"Steve\" AND T1.last_name = \"Johnson\";", "question": "How many customers does Steve Johnson support?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = \"Steve\" AND T1.last_name = \"Johnson\";", "question": "What is the count of customers that Steve Johnson supports?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT title , phone , hire_date FROM employees WHERE first_name = \"Nancy\" AND last_name = \"Edwards\";", "question": "What is the title, phone and hire date of Nancy Edwards?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT title , phone , hire_date FROM employees WHERE first_name = \"Nancy\" AND last_name = \"Edwards\";", "question": "What is the title, phone number and hire date for the employee named Nancy Edwards?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = \"Nancy\" AND T1.last_name = \"Edwards\";", "question": "find the full name of employees who report to Nancy Edwards?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = \"Nancy\" AND T1.last_name = \"Edwards\";", "question": "What is the first and last name of the employee who reports to Nancy Edwards?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT address FROM employees WHERE first_name = \"Nancy\" AND last_name = \"Edwards\";", "question": "What is the address of employee Nancy Edwards?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT address FROM employees WHERE first_name = \"Nancy\" AND last_name = \"Edwards\";", "question": "What is Nancy Edwards's address?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1", "question": "Find the full name of employee who supported the most number of customers.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1", "question": "What is the full name of the employee who has the most customers?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) FROM employees WHERE country = \"Canada\";", "question": "How many employees are living in Canada?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) FROM employees WHERE country = \"Canada\";", "question": "How many employees live in Canada?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT phone FROM employees WHERE first_name = \"Nancy\" AND last_name = \"Edwards\";", "question": "What is employee Nancy Edwards's phone number?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT phone FROM employees WHERE first_name = \"Nancy\" AND last_name = \"Edwards\";", "question": "What is the the phone number of Nancy Edwards?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT first_name , last_name FROM employees ORDER BY birth_date DESC LIMIT 1;", "question": "Who is the youngest employee in the company? List employee's first and last name.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT first_name , last_name FROM employees ORDER BY birth_date DESC LIMIT 1;", "question": "What si the youngest employee's first and last name?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT first_name , last_name FROM employees ORDER BY hire_date ASC LIMIT 10;", "question": "List top 10 employee work longest in the company. List employee's first and last name.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT first_name , last_name FROM employees ORDER BY hire_date ASC LIMIT 10;", "question": "What are the first and last names of the top 10 longest-serving employees?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) , city FROM employees WHERE title = 'IT Staff' GROUP BY city", "question": "Find the number of employees whose title is IT Staff from each city?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) , city FROM employees WHERE title = 'IT Staff' GROUP BY city", "question": "How many employees who are IT staff are from each city?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.first_name , T2.last_name , count(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY count(T1.reports_to) DESC LIMIT 1;", "question": "Which employee manage most number of peoples? List employee's first and last name, and number of people report to that employee.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.first_name , T2.last_name , count(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY count(T1.reports_to) DESC LIMIT 1;", "question": "What are the first and last names of all the employees and how many people report to them?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = \"Lucas\" AND T1.last_name = \"Mancini\";", "question": "How many orders does Lucas Mancini has?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = \"Lucas\" AND T1.last_name = \"Mancini\";", "question": "How many orders does Luca Mancini have in his invoices?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT sum(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = \"Lucas\" AND T1.last_name = \"Mancini\";", "question": "What is the total amount of money spent by Lucas Mancini?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT sum(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = \"Lucas\" AND T1.last_name = \"Mancini\";", "question": "How much money did Lucas Mancini spend?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT name FROM media_types;", "question": "List all media types.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT name FROM media_types;", "question": "What are the names of all the media types?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT DISTINCT name FROM genres;", "question": "List all different genre types.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT DISTINCT name FROM genres;", "question": "What are the different names of the genres?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT name FROM playlists;", "question": "List the name of all playlist.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT name FROM playlists;", "question": "What are the names of all the playlists?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT composer FROM tracks WHERE name = \"Fast As a Shark\";", "question": "Who is the composer of track Fast As a Shark?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT composer FROM tracks WHERE name = \"Fast As a Shark\";", "question": "What is the composer who created the track \"Fast As a Shark\"?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT milliseconds FROM tracks WHERE name = \"Fast As a Shark\";", "question": "How long does track Fast As a Shark has?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT milliseconds FROM tracks WHERE name = \"Fast As a Shark\";", "question": "How many milliseconds long is Fast As a Shark?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = \"Rock\";", "question": "What is the name of tracks whose genre is Rock?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = \"Rock\";", "question": "What is the name of all tracks in the Rock genre?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = \"Balls to the Wall\";", "question": "What is title of album which track Balls to the Wall belongs to?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = \"Balls to the Wall\";", "question": "What is the name of the album that has the track Ball to the Wall?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = \"Balls to the Wall\";", "question": "List name of all tracks in Balls to the Wall.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = \"Balls to the Wall\";", "question": "What is the name of all tracks in the album named Balls to the Wall?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING count(T1.id) > 10;", "question": "List title of albums have the number of tracks greater than 10.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING count(T1.id) > 10;", "question": "What are the names of the albums that have more than 10 tracks?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = \"Rock\" AND T3.name = \"MPEG audio file\";", "question": "List the name of tracks belongs to genre Rock and whose media type is MPEG audio file.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = \"Rock\" AND T3.name = \"MPEG audio file\";", "question": "What are the names of all Rock tracks that are stored on MPEG audio files?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = \"Rock\" OR T3.name = \"MPEG audio file\";", "question": "List the name of tracks belongs to genre Rock or media type is MPEG audio file.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = \"Rock\" OR T3.name = \"MPEG audio file\";", "question": "What are the names of all tracks that belong to the Rock genre and whose media type is MPEG?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = \"Rock\" OR T1.name = \"Jazz\"", "question": "List the name of tracks belongs to genre Rock or genre Jazz.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = \"Rock\" OR T1.name = \"Jazz\"", "question": "What are the names of the tracks that are Rock or Jazz songs?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = \"Movies\";", "question": "List the name of all tracks in the playlists of Movies.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = \"Movies\";", "question": "What are the names of all tracks that are on playlists titled Movies?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING count(T1.track_id) > 100;", "question": "List the name of playlist which has number of tracks greater than 100.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING count(T1.track_id) > 100;", "question": "What are the names of all playlists that have more than 100 tracks?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = \"Daan\" AND T4.last_name = \"Peeters\";", "question": "List all tracks bought by customer Daan Peeters.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = \"Daan\" AND T4.last_name = \"Peeters\";", "question": "What are the tracks that Dean Peeters bought?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT unit_price FROM tracks WHERE name = \"Fast As a Shark\";", "question": "How much is the track Fast As a Shark?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT unit_price FROM tracks WHERE name = \"Fast As a Shark\";", "question": "What is the unit price of the tune \"Fast As a Shark\"?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'", "question": "Find the name of tracks which are in Movies playlist but not in music playlist.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'", "question": "What are the names of all tracks that are on the Movies playlist but not in the music playlist?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'", "question": "Find the name of tracks which are in both Movies and music playlists.", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'", "question": "What are the names of all the tracks that are in both the Movies and music playlists?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) , T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name;", "question": "Find number of tracks in each genre?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) , T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name;", "question": "How many tracks are in each genre?", "schema": "artists: id (INTEGER), name (VARCHAR(120))\nalbums: id (INTEGER), title (VARCHAR(160)), artist_id (INTEGER)\nemployees: id (INTEGER), last_name (VARCHAR(20)), first_name (VARCHAR(20)), title (VARCHAR(30)), reports_to (INTEGER), birth_date (TIMESTAMP), hire_date (TIMESTAMP), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60))\ncustomers: id (INTEGER), first_name (VARCHAR(40)), last_name (VARCHAR(20)), company (VARCHAR(80)), address (VARCHAR(70)), city (VARCHAR(40)), state (VARCHAR(40)), country (VARCHAR(40)), postal_code (VARCHAR(10)), phone (VARCHAR(24)), fax (VARCHAR(24)), email (VARCHAR(60)), support_rep_id (INTEGER)\ngenres: id (INTEGER), name (VARCHAR(120))\ninvoices: id (INTEGER), customer_id (INTEGER), invoice_date (TIMESTAMP), billing_address (VARCHAR(70)), billing_city (VARCHAR(40)), billing_state (VARCHAR(40)), billing_country (VARCHAR(40)), billing_postal_code (VARCHAR(10)), total (NUMERIC(102))\nmedia_types: id (INTEGER), name (VARCHAR(120))\ntracks: id (INTEGER), name (VARCHAR(200)), album_id (INTEGER), media_type_id (INTEGER), genre_id (INTEGER), composer (VARCHAR(220)), milliseconds (INTEGER), bytes (INTEGER), unit_price (NUMERIC(102))\ninvoice_lines: id (INTEGER), invoice_id (INTEGER), track_id (INTEGER), unit_price (NUMERIC(102)), quantity (INTEGER)\nplaylists: id (INTEGER), name (VARCHAR(120))\nplaylist_tracks: playlist_id (INTEGER), track_id (INTEGER)" }, { "query": "SELECT count(*) FROM editor", "question": "How many editors are there?", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Name FROM editor ORDER BY Age ASC", "question": "List the names of editors in ascending order of age.", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Name , Age FROM editor", "question": "What are the names and ages of editors?", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Name FROM editor WHERE Age > 25", "question": "List the names of editors who are older than 25.", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Name FROM editor WHERE Age = 24 OR Age = 25", "question": "Show the names of editors of age either 24 or 25.", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Name FROM editor ORDER BY Age ASC LIMIT 1", "question": "What is the name of the youngest editor?", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Age , COUNT(*) FROM editor GROUP BY Age", "question": "What are the different ages of editors? Show each age along with the number of editors of that age.", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Age FROM editor GROUP BY Age ORDER BY COUNT(*) DESC LIMIT 1", "question": "Please show the most common age of editors.", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT DISTINCT Theme FROM journal", "question": "Show the distinct themes of journals.", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT T2.Name , T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID", "question": "Show the names of editors and the theme of journals for which they serve on committees.", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT T2.Name , T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID", "question": "For each journal_committee, find the editor name and the journal theme.", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT T2.Name , T2.age , T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID ORDER BY T3.Theme ASC", "question": "Show the names and ages of editors and the theme of journals for which they serve on committees, in ascending alphabetical order of theme.", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT T2.Name FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000", "question": "Show the names of editors that are on the committee of journals with sales bigger than 3000.", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT T1.editor_id , T1.Name , COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.editor_id", "question": "Show the id, name of each editor and the number of journal committees they are on.", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT T1.Name FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Name HAVING COUNT(*) >= 2", "question": "Show the names of editors that are on at least two journal committees.", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Name FROM editor WHERE editor_id NOT IN (SELECT editor_id FROM journal_committee)", "question": "List the names of editors that are not on any journal committee.", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT date , theme , sales FROM journal EXCEPT SELECT T1.date , T1.theme , T1.sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID", "question": "List the date, theme and sales of the journal which did not have any of the listed editors serving on committee.", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT avg(T1.sales) FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID WHERE T2.work_type = 'Photo'", "question": "What is the average sales of the journals that have an editor whose work type is 'Photo'?", "schema": "journal: Journal_ID (INT), Date (TEXT), Theme (TEXT), Sales (INT)\neditor: Editor_ID (INT), Name (TEXT), Age (REAL)\njournal_committee: Editor_ID (INT), Journal_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT count(*) FROM Accounts", "question": "How many accounts do we have?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Accounts", "question": "Count the number of accounts.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT account_id , customer_id , account_name FROM Accounts", "question": "Show ids, customer ids, names for all accounts.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT account_id , customer_id , account_name FROM Accounts", "question": "What are the account ids, customer ids, and account names for all the accounts?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT other_account_details FROM Accounts WHERE account_name = \"338\"", "question": "Show other account details for account with name 338.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT other_account_details FROM Accounts WHERE account_name = \"338\"", "question": "What are the other account details for the account with the name 338?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT T2.customer_first_name , T2.customer_last_name , T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = \"162\"", "question": "What is the first name, last name, and phone of the customer with account name 162?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT T2.customer_first_name , T2.customer_last_name , T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = \"162\"", "question": "Give the full name and phone of the customer who has the account name 162.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = \"Art\" AND T2.customer_last_name = \"Turcotte\"", "question": "How many accounts does the customer with first name Art and last name Turcotte have?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = \"Art\" AND T2.customer_last_name = \"Turcotte\"", "question": "Return the number of accounts that the customer with the first name Art and last name Turcotte has.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_id , count(*) FROM Accounts GROUP BY customer_id", "question": "Show all customer ids and the number of accounts for each customer.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_id , count(*) FROM Accounts GROUP BY customer_id", "question": "How many accounts are there for each customer id?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_id , count(*) FROM Accounts GROUP BY customer_id ORDER BY count(*) DESC LIMIT 1", "question": "Show the customer id and number of accounts with most accounts.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_id , count(*) FROM Accounts GROUP BY customer_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the customer id of the customer with the most accounts, and how many accounts does this person have?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT T2.customer_first_name , T2.customer_last_name , T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1", "question": "What is the customer first, last name and id with least number of accounts.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT T2.customer_first_name , T2.customer_last_name , T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1", "question": "Give the full name and customer id of the customer with the fewest accounts.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts)", "question": "Show the number of all customers without an account.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts)", "question": "How many customers do not have an account?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_first_name , customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name , T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id", "question": "Show the first names and last names of customers without any account.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_first_name , customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name , T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id", "question": "What are the full names of customers who do not have any accounts?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT DISTINCT T1.customer_first_name , T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id", "question": "Show distinct first and last names for all customers with an account.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT DISTINCT T1.customer_first_name , T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id", "question": "What are the full names of customers who have accounts?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(DISTINCT customer_id) FROM Accounts", "question": "How many customers have an account?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(DISTINCT customer_id) FROM Accounts", "question": "Count the number of customers who hold an account.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Customers", "question": "How many customers do we have?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Customers", "question": "Count the number of customers.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_id , customer_first_name , customer_last_name , customer_phone FROM Customers", "question": "Show ids, first names, last names, and phones for all customers.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_id , customer_first_name , customer_last_name , customer_phone FROM Customers", "question": "What are the ids, full names, and phones of each customer?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_phone , customer_email FROM Customers WHERE customer_first_name = \"Aniyah\" AND customer_last_name = \"Feest\"", "question": "What is the phone and email for customer with first name Aniyah and last name Feest?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_phone , customer_email FROM Customers WHERE customer_first_name = \"Aniyah\" AND customer_last_name = \"Feest\"", "question": "Return the phone and email of the customer with the first name Aniyah and last name Feest.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Customers_cards", "question": "Show the number of customer cards.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Customers_cards", "question": "How many customer cards are there?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT card_id , customer_id , card_type_code , card_number FROM Customers_cards", "question": "Show ids, customer ids, card type codes, card numbers for all cards.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT card_id , customer_id , card_type_code , card_number FROM Customers_cards", "question": "What are card ids, customer ids, card types, and card numbers for each customer card?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT date_valid_from , date_valid_to FROM Customers_cards WHERE card_number = \"4560596484842\"", "question": "Show the date valid from and the date valid to for the card with card number '4560596484842'.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT date_valid_from , date_valid_to FROM Customers_cards WHERE card_number = \"4560596484842\"", "question": "What are the valid from and valid to dates for the card with the number 4560596484842?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT T2.customer_first_name , T2.customer_last_name , T2.customer_phone FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.card_number = \"4560596484842\"", "question": "What is the first name, last name, and phone of the customer with card 4560596484842.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT T2.customer_first_name , T2.customer_last_name , T2.customer_phone FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.card_number = \"4560596484842\"", "question": "Return the full name and phone of the customer who has card number 4560596484842.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = \"Art\" AND T2.customer_last_name = \"Turcotte\"", "question": "How many cards does customer Art Turcotte have?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = \"Art\" AND T2.customer_last_name = \"Turcotte\"", "question": "Count the number of cards the customer with the first name Art and last name Turcotte has.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Customers_cards WHERE card_type_code = \"Debit\"", "question": "How many debit cards do we have?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Customers_cards WHERE card_type_code = \"Debit\"", "question": "Count the number of customer cards of the type Debit.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = \"Blanche\" AND T2.customer_last_name = \"Huels\" AND T1.card_type_code = \"Credit\"", "question": "How many credit cards does customer Blanche Huels have?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = \"Blanche\" AND T2.customer_last_name = \"Huels\" AND T1.card_type_code = \"Credit\"", "question": "Count the number of credit cards that the customer with first name Blanche and last name Huels has.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_id , count(*) FROM Customers_cards GROUP BY customer_id", "question": "Show all customer ids and the number of cards owned by each customer.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_id , count(*) FROM Customers_cards GROUP BY customer_id", "question": "What are the different customer ids, and how many cards does each one hold?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_id , count(*) FROM Customers_cards GROUP BY customer_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the customer id with most number of cards, and how many does he have?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_id , count(*) FROM Customers_cards GROUP BY customer_id ORDER BY count(*) DESC LIMIT 1", "question": "Return the id of the customer who has the most cards, as well as the number of cards.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 2", "question": "Show id, first and last names for all customers with at least two cards.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 2", "question": "What are the ids and full names of customers who hold two or more cards?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1", "question": "What is the customer id, first and last name with least number of accounts.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1", "question": "Return the id and full name of the customer who has the fewest accounts.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT card_type_code , count(*) FROM Customers_cards GROUP BY card_type_code", "question": "Show all card type codes and the number of cards in each type.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT card_type_code , count(*) FROM Customers_cards GROUP BY card_type_code", "question": "What are the different card types, and how many cards are there of each?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT card_type_code FROM Customers_cards GROUP BY card_type_code ORDER BY count(*) DESC LIMIT 1", "question": "What is the card type code with most number of cards?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT card_type_code FROM Customers_cards GROUP BY card_type_code ORDER BY count(*) DESC LIMIT 1", "question": "Return the code of the card type that is most common.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT card_type_code FROM Customers_cards GROUP BY card_type_code HAVING count(*) >= 5", "question": "Show card type codes with at least 5 cards.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT card_type_code FROM Customers_cards GROUP BY card_type_code HAVING count(*) >= 5", "question": "What are the codes of card types that have 5 or more cards?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT card_type_code , count(DISTINCT customer_id) FROM Customers_cards GROUP BY card_type_code", "question": "Show all card type codes and the number of customers holding cards in each type.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT card_type_code , count(DISTINCT customer_id) FROM Customers_cards GROUP BY card_type_code", "question": "What are the different card type codes, and how many different customers hold each type?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_id , customer_first_name FROM Customers EXCEPT SELECT T1.customer_id , T2.customer_first_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE card_type_code = \"Credit\"", "question": "Show the customer ids and firstname without a credit card.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT customer_id , customer_first_name FROM Customers EXCEPT SELECT T1.customer_id , T2.customer_first_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE card_type_code = \"Credit\"", "question": "What are the ids and first names of customers who do not hold a credit card?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT DISTINCT card_type_code FROM Customers_Cards", "question": "Show all card type codes.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT DISTINCT card_type_code FROM Customers_Cards", "question": "What are the different card type codes?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(DISTINCT card_type_code) FROM Customers_Cards", "question": "Show the number of card types.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(DISTINCT card_type_code) FROM Customers_Cards", "question": "How many different card types are there?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT DISTINCT transaction_type FROM Financial_Transactions", "question": "Show all transaction types.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT DISTINCT transaction_type FROM Financial_Transactions", "question": "What are the different types of transactions?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(DISTINCT transaction_type) FROM Financial_Transactions", "question": "Show the number of transaction types.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(DISTINCT transaction_type) FROM Financial_Transactions", "question": "How many different types of transactions are there?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT avg(transaction_amount) , sum(transaction_amount) FROM Financial_transactions", "question": "What is the average and total transaction amount?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT avg(transaction_amount) , sum(transaction_amount) FROM Financial_transactions", "question": "Return the average transaction amount, as well as the total amount of all transactions.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT T2.card_type_code , count(*) FROM Financial_transactions AS T1 JOIN Customers_cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code", "question": "Show the card type codes and the number of transactions.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT T2.card_type_code , count(*) FROM Financial_transactions AS T1 JOIN Customers_cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code", "question": "What are the different card types, and how many transactions have been made with each?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT transaction_type , count(*) FROM Financial_transactions GROUP BY transaction_type", "question": "Show the transaction type and the number of transactions.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT transaction_type , count(*) FROM Financial_transactions GROUP BY transaction_type", "question": "What are the different transaction types, and how many transactions of each have taken place?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT transaction_type FROM Financial_transactions GROUP BY transaction_type ORDER BY sum(transaction_amount) DESC LIMIT 1", "question": "What is the transaction type that has processed the greatest total amount in transactions?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT transaction_type FROM Financial_transactions GROUP BY transaction_type ORDER BY sum(transaction_amount) DESC LIMIT 1", "question": "Return the type of transaction with the highest total amount.", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT account_id , count(*) FROM Financial_transactions GROUP BY account_id", "question": "Show the account id and the number of transactions for each account", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT account_id , count(*) FROM Financial_transactions GROUP BY account_id", "question": "What are the different account ids that have made financial transactions, as well as how many transactions correspond to each?", "schema": "Accounts: account_id (INTEGER), customer_id (INTEGER), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), customer_first_name (VARCHAR(20)), customer_last_name (VARCHAR(20)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(255)), customer_email (VARCHAR(255)), other_customer_details (VARCHAR(255))\nCustomers_Cards: card_id (INTEGER), customer_id (INTEGER), card_type_code (VARCHAR(15)), card_number (VARCHAR(80)), date_valid_from (DATETIME), date_valid_to (DATETIME), other_card_details (VARCHAR(255))\nFinancial_Transactions: transaction_id (INTEGER), previous_transaction_id (INTEGER), account_id (INTEGER), card_id (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DOUBLE), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM track", "question": "How many tracks do we have?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT count(*) FROM track", "question": "Count the number of tracks.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT name , LOCATION FROM track", "question": "Show the name and location for all tracks.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT name , LOCATION FROM track", "question": "What are the names and locations of all tracks?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT name , seating FROM track WHERE year_opened > 2000 ORDER BY seating", "question": "Show names and seatings, ordered by seating for all tracks opened after 2000.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT name , seating FROM track WHERE year_opened > 2000 ORDER BY seating", "question": "What are the names and seatings for all tracks opened after 2000, ordered by seating?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT name , LOCATION , seating FROM track ORDER BY year_opened DESC LIMIT 1", "question": "What is the name, location and seating for the most recently opened track?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT name , LOCATION , seating FROM track ORDER BY year_opened DESC LIMIT 1", "question": "Return the name, location, and seating of the track that was opened in the most recent year.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT min(seating) , max(seating) , avg(seating) FROM track", "question": "What is the minimum, maximum, and average seating for all tracks.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT min(seating) , max(seating) , avg(seating) FROM track", "question": "Return the minimum, maximum, and average seating across all tracks.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT name , LOCATION , year_opened FROM track WHERE seating > (SELECT avg(seating) FROM track)", "question": "Show the name, location, open year for all tracks with a seating higher than the average.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT name , LOCATION , year_opened FROM track WHERE seating > (SELECT avg(seating) FROM track)", "question": "What are the names, locations, and years of opening for tracks with seating higher than average?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT DISTINCT LOCATION FROM track", "question": "What are distinct locations where tracks are located?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT DISTINCT LOCATION FROM track", "question": "Give the different locations of tracks.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT count(*) FROM race", "question": "How many races are there?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT count(*) FROM race", "question": "Count the number of races.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT DISTINCT CLASS FROM race", "question": "What are the distinct classes that races can have?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT DISTINCT CLASS FROM race", "question": "Return the different classes of races.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT name , CLASS , date FROM race", "question": "Show name, class, and date for all races.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT name , CLASS , date FROM race", "question": "What are the names, classes, and dates for all races?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT CLASS , count(*) FROM race GROUP BY CLASS", "question": "Show the race class and number of races in each class.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT CLASS , count(*) FROM race GROUP BY CLASS", "question": "What are the different classes of races, and how many races correspond to each?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT CLASS FROM race GROUP BY CLASS ORDER BY count(*) DESC LIMIT 1", "question": "What is the race class with most number of races.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT CLASS FROM race GROUP BY CLASS ORDER BY count(*) DESC LIMIT 1", "question": "Give the class of races that is most common.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT CLASS FROM race GROUP BY CLASS HAVING count(*) >= 2", "question": "List the race class with at least two races.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT CLASS FROM race GROUP BY CLASS HAVING count(*) >= 2", "question": "What are the classes of races that have two or more corresponding races?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id WHERE T1.class = 'GT'", "question": "What are the names for tracks without a race in class 'GT'.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id WHERE T1.class = 'GT'", "question": "Give the names of tracks that do not have a race in the class 'GT'.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT name FROM track WHERE track_id NOT IN (SELECT track_id FROM race)", "question": "Show all track names that have had no races.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT name FROM track WHERE track_id NOT IN (SELECT track_id FROM race)", "question": "Return the names of tracks that have no had any races.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT year_opened FROM track WHERE seating BETWEEN 4000 AND 5000", "question": "Show year where a track with a seating at least 5000 opened and a track with seating no more than 4000 opened.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT year_opened FROM track WHERE seating BETWEEN 4000 AND 5000", "question": "What are the years of opening for tracks with seating between 4000 and 5000?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT T2.name , count(*) FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id", "question": "Show the name of track and the number of races in each track.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT T2.name , count(*) FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id", "question": "What are the names of different tracks, and how many races has each had?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id ORDER BY count(*) DESC LIMIT 1", "question": "Show the name of track with most number of races.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of the track that has had the greatest number of races?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT T1.name , T1.date , T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id", "question": "Show the name and date for each race and its track name.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT T1.name , T1.date , T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id", "question": "What are the names and dates of races, and the names of the tracks where they are held?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT T2.name , T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id HAVING count(*) = 1", "question": "Show the name and location of track with 1 race.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT T2.name , T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id HAVING count(*) = 1", "question": "What are the names and locations of tracks that have had exactly 1 race?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT LOCATION FROM track WHERE seating > 90000 INTERSECT SELECT LOCATION FROM track WHERE seating < 70000", "question": "Find the locations where have both tracks with more than 90000 seats and tracks with less than 70000 seats.", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT LOCATION FROM track WHERE seating > 90000 INTERSECT SELECT LOCATION FROM track WHERE seating < 70000", "question": "What are the locations that have both tracks with more than 90000 seats, and tracks with fewer than 70000 seats?", "schema": "race: Race_ID (INT), Name (TEXT), Class (TEXT), Date (TEXT), Track_ID (TEXT)\ntrack: Track_ID (INT), Name (TEXT), Location (TEXT), Seating (REAL), Year_Opened (REAL)" }, { "query": "SELECT count(*) FROM member WHERE Membership_card = 'Black'", "question": "How many members have the black membership card?", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT count(*) , address FROM member GROUP BY address", "question": "Find the number of members living in each address.", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT name FROM member WHERE address = 'Harford' OR address = 'Waterbury'", "question": "Give me the names of members whose address is in Harford or Waterbury.", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT name , member_id FROM member WHERE Membership_card = 'Black' OR age < 30", "question": "Find the ids and names of members who are under age 30 or with black membership card.", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT Time_of_purchase , age , address FROM member ORDER BY Time_of_purchase", "question": "Find the purchase time, age and address of each member, and show the results in the order of purchase time.", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT Membership_card FROM member GROUP BY Membership_card HAVING count(*) > 5", "question": "Which membership card has more than 5 members?", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT address FROM member WHERE age < 30 INTERSECT SELECT address FROM member WHERE age > 40", "question": "Which address has both members younger than 30 and members older than 40?", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT membership_card FROM member WHERE address = 'Hartford' INTERSECT SELECT membership_card FROM member WHERE address = 'Waterbury'", "question": "What is the membership card held by both members living in Hartford and ones living in Waterbury address?", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT count(*) FROM member WHERE address != 'Hartford'", "question": "How many members are not living in Hartford?", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT address FROM member EXCEPT SELECT address FROM member WHERE Membership_card = 'Black'", "question": "Which address do not have any member with the black membership card?", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT address FROM shop ORDER BY open_year", "question": "Show the shop addresses ordered by their opening year.", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT avg(num_of_staff) , avg(score) FROM shop", "question": "What are the average score and average staff number of all shops?", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT shop_id , address FROM shop WHERE score < (SELECT avg(score) FROM shop)", "question": "Find the id and address of the shops whose score is below the average score.", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT address , num_of_staff FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM happy_hour)", "question": "Find the address and staff number of the shops that do not have any happy hour.", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT t1.address , t1.shop_id FROM shop AS t1 JOIN happy_hour AS t2 ON t1.shop_id = t2.shop_id WHERE MONTH = 'May'", "question": "What are the id and address of the shops which have a happy hour in May?", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT shop_id , count(*) FROM happy_hour GROUP BY shop_id ORDER BY count(*) DESC LIMIT 1", "question": "which shop has happy hour most frequently? List its id and number of happy hours.", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT MONTH FROM happy_hour GROUP BY MONTH ORDER BY count(*) DESC LIMIT 1", "question": "Which month has the most happy hours?", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT MONTH FROM happy_hour GROUP BY MONTH HAVING count(*) > 2", "question": "Which months have more than 2 happy hours?", "schema": "shop: Shop_ID (INT), Address (TEXT), Num_of_staff (TEXT), Score (REAL), Open_Year (TEXT)\nmember: Member_ID (INT), Name (TEXT), Membership_card (TEXT), Age (INT), Time_of_purchase (INT), Level_of_membership (INT), Address (TEXT)\nhappy_hour: HH_ID (INT), Shop_ID (INT), Month (TEXT), Num_of_shaff_in_charge (INT)\nhappy_hour_member: HH_ID (INT), Member_ID (INT), Total_amount (REAL)" }, { "query": "SELECT customer_phone FROM available_policies", "question": "Find all the phone numbers.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT customer_phone FROM available_policies", "question": "What are all the phone numbers?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT customer_phone FROM available_policies WHERE policy_type_code = \"Life Insurance\"", "question": "What are the customer phone numbers under the policy \"Life Insurance\"?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT customer_phone FROM available_policies WHERE policy_type_code = \"Life Insurance\"", "question": "What are the phone numbers of customers using the policy with the code \"Life Insurance\"?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1", "question": "Which policy type has the most records in the database?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1", "question": "Which policy type appears most frequently in the available policies?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT customer_phone FROM available_policies WHERE policy_type_code = (SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1)", "question": "What are all the customer phone numbers under the most popular policy type?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT customer_phone FROM available_policies WHERE policy_type_code = (SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1)", "question": "Find the phone numbers of customers using the most common policy type among the available policies.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING count(*) > 4", "question": "Find the policy type used by more than 4 customers.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING count(*) > 4", "question": "Find the policy types more than 4 customers use. Show their type code.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT sum(settlement_amount) , avg(settlement_amount) FROM settlements", "question": "Find the total and average amount of settlements.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT sum(settlement_amount) , avg(settlement_amount) FROM settlements", "question": "Return the sum and average of all settlement amounts.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING count(*) > 2", "question": "Find the name of services that have been used for more than 2 times in first notification of loss.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING count(*) > 2", "question": "Which services have been used more than twice in first notification of loss? Return the service name.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY sum(t2.settlement_amount) DESC LIMIT 1", "question": "What is the effective date of the claim that has the largest amount of total settlement?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY sum(t2.settlement_amount) DESC LIMIT 1", "question": "Find the claim that has the largest total settlement amount. Return the effective date of the claim.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT count(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = \"Dayana Robel\"", "question": "How many policies are listed for the customer named \"Dayana Robel\"?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT count(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = \"Dayana Robel\"", "question": "Count the total number of policies used by the customer named \"Dayana Robel\".", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of the customer who has the most policies listed?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1", "question": "Which customer uses the most policies? Give me the customer name.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = \"Dayana Robel\"", "question": "What are all the policy types of the customer named \"Dayana Robel\"?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = \"Dayana Robel\"", "question": "Tell me the types of the policy used by the customer named \"Dayana Robel\".", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = (SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1)", "question": "What are all the policy types of the customer that has the most policies listed?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = (SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1)", "question": "List all the policy types used by the customer enrolled in the most policies.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT service_name FROM services ORDER BY service_name", "question": "List all the services in the alphabetical order.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT service_name FROM services ORDER BY service_name", "question": "Give me a list of all the service names sorted alphabetically.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT count(*) FROM services", "question": "How many services are there?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT count(*) FROM services", "question": "Count the total number of available services.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id", "question": "Find the names of users who do not have a first notification of loss record.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id", "question": "Which customers do not have a first notification of loss record? Give me the customer names.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = \"Close a policy\" OR t3.service_name = \"Upgrade a policy\"", "question": "Find the names of customers who have used either the service \"Close a policy\" or the service \"Upgrade a policy\".", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = \"Close a policy\" OR t3.service_name = \"Upgrade a policy\"", "question": "Which customers have used the service named \"Close a policy\" or \"Upgrade a policy\"? Give me the customer names.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = \"Close a policy\" INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = \"New policy application\"", "question": "Find the names of customers who have used both the service \"Close a policy\" and the service \"New policy application\".", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = \"Close a policy\" INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = \"New policy application\"", "question": "Which customers have used both the service named \"Close a policy\" and the service named \"Upgrade a policy\"? Give me the customer names.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT customer_id FROM customers WHERE customer_name LIKE \"%Diana%\"", "question": "Find the IDs of customers whose name contains \"Diana\".", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT customer_id FROM customers WHERE customer_name LIKE \"%Diana%\"", "question": "What are the IDs of customers who have \"Diana\" in part of their names?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT max(settlement_amount) , min(settlement_amount) FROM settlements", "question": "What are the maximum and minimum settlement amount on record?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT max(settlement_amount) , min(settlement_amount) FROM settlements", "question": "Find the maximum and minimum settlement amount.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT customer_id , customer_name FROM customers ORDER BY customer_id ASC", "question": "List all the customers in increasing order of IDs.", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT customer_id , customer_name FROM customers ORDER BY customer_id ASC", "question": "What is the ordered list of customer ids?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT t2.date_opened , t2.date_closed FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name LIKE \"%Diana%\"", "question": "Retrieve the open and close dates of all the policies associated with the customer whose name contains \"Diana\"", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT t2.date_opened , t2.date_closed FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name LIKE \"%Diana%\"", "question": "What are the open and close dates of all the policies used by the customer who have \"Diana\" in part of their names?", "schema": "Customers: Customer_ID (INTEGER), Customer_name (VARCHAR(40))\nServices: Service_ID (INTEGER), Service_name (VARCHAR(40))\nAvailable_Policies: Policy_ID (INTEGER), policy_type_code (CHAR(15)), Customer_Phone (VARCHAR(255))\nCustomers_Policies: Customer_ID (INTEGER), Policy_ID (INTEGER), Date_Opened (DATE), Date_Closed (DATE)\nFirst_Notification_of_Loss: FNOL_ID (INTEGER), Customer_ID (INTEGER), Policy_ID (INTEGER), Service_ID (INTEGER)\nClaims: Claim_ID (INTEGER), FNOL_ID (INTEGER), Effective_Date (DATE)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Effective_Date (DATE), Settlement_Amount (REAL)" }, { "query": "SELECT count(*) FROM enzyme", "question": "How many kinds of enzymes are there?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT count(*) FROM enzyme", "question": "What is the total count of enzymes?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT name FROM enzyme ORDER BY name DESC", "question": "List the name of enzymes in descending lexicographical order.", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT name FROM enzyme ORDER BY name DESC", "question": "What are the names of enzymes in descending order?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT name , LOCATION FROM enzyme", "question": "List the names and the locations that the enzymes can make an effect.", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT name , LOCATION FROM enzyme", "question": "What are the names and locations of all enzymes listed?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT max(OMIM) FROM enzyme", "question": "What is the maximum Online Mendelian Inheritance in Man (OMIM) value of the enzymes?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT max(OMIM) FROM enzyme", "question": "What is the maximum OMIM value in the database?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT product , chromosome , porphyria FROM enzyme WHERE LOCATION = 'Cytosol'", "question": "What is the product, chromosome and porphyria related to the enzymes which take effect at the location 'Cytosol'?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT product , chromosome , porphyria FROM enzyme WHERE LOCATION = 'Cytosol'", "question": "What is the product, chromosome, and porphyria of the enzymes located at 'Cytosol'?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT name FROM enzyme WHERE product != 'Heme'", "question": "What are the names of enzymes who does not produce 'Heme'?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT name FROM enzyme WHERE product != 'Heme'", "question": "What are the names of enzymes whose product is not 'Heme'?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT name , trade_name FROM medicine WHERE FDA_approved = 'Yes'", "question": "What are the names and trade names of the medicines which has 'Yes' value in the FDA record?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT name , trade_name FROM medicine WHERE FDA_approved = 'Yes'", "question": "What are the names and trade names of the medcines that are FDA approved?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id = T3.id WHERE T3.name = 'Amisulpride' AND T2.interaction_type = 'inhibitor'", "question": "What are the names of enzymes in the medicine named 'Amisulpride' that can serve as an 'inhibitor'?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id = T3.id WHERE T3.name = 'Amisulpride' AND T2.interaction_type = 'inhibitor'", "question": "What are the names of the enzymes used in the medicine Amisulpride that acts as inhibitors?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT T1.id , T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING count(*) >= 2", "question": "What are the ids and names of the medicine that can interact with two or more enzymes?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT T1.id , T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING count(*) >= 2", "question": "For every medicine id, what are the names of the medicines that can interact with more than one enzyme?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT T1.id , T1.Name , T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC", "question": "What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with.", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT T1.id , T1.Name , T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC", "question": "What are the ids, names, and FDA approval status for medicines ordered by descending number of possible enzyme interactions?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT T1.id , T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T2.interaction_type = 'activitor' GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1", "question": "What is the id and name of the enzyme with most number of medicines that can interact as 'activator'?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT T1.id , T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T2.interaction_type = 'activitor' GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1", "question": "What is the id and name of the enzyme that can interact with the most medicines as an activator?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id = T2.id JOIN enzyme AS T3 ON T1.enzyme_id = T3.id WHERE T3.name = 'ALA synthase' AND T2.name = 'Aripiprazole'", "question": "What is the interaction type of the enzyme named 'ALA synthase' and the medicine named 'Aripiprazole'?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id = T2.id JOIN enzyme AS T3 ON T1.enzyme_id = T3.id WHERE T3.name = 'ALA synthase' AND T2.name = 'Aripiprazole'", "question": "What is the type of interaction for the enzyme named 'ALA synthase' and the medicine named 'Aripiprazole'?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT interaction_type , count(*) FROM medicine_enzyme_interaction GROUP BY interaction_type ORDER BY count(*) DESC LIMIT 1", "question": "What is the most common interaction type between enzymes and medicine? And how many are there?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT interaction_type , count(*) FROM medicine_enzyme_interaction GROUP BY interaction_type ORDER BY count(*) DESC LIMIT 1", "question": "What are the most common types of interactions between enzymes and medicine, and how many types are there?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT count(*) FROM medicine WHERE FDA_approved = 'No'", "question": "How many medicines have the FDA approval status 'No' ?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT count(*) FROM medicine WHERE FDA_approved = 'No'", "question": "How many medicines were not approved by the FDA?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT count(*) FROM enzyme WHERE id NOT IN ( SELECT enzyme_id FROM medicine_enzyme_interaction );", "question": "How many enzymes do not have any interactions?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT count(*) FROM enzyme WHERE id NOT IN ( SELECT enzyme_id FROM medicine_enzyme_interaction );", "question": "What is the count of enzymes without any interactions?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT T1.id , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 3", "question": "What is the id and trade name of the medicines can interact with at least 3 enzymes?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT T1.id , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 3", "question": "What are the ids and trade names of the medicine that can interact with at least 3 enzymes?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT DISTINCT T1.name , T1.location , T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor'", "question": "What are the distinct name, location and products of the enzymes which has any 'inhibitor' interaction?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT DISTINCT T1.name , T1.location , T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor'", "question": "What are the different names, locations, and products of the enzymes that are capable inhibitor interactions?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'inhibitor' INTERSECT SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'activitor'", "question": "List the medicine name and trade name which can both interact as 'inhibitor' and 'activitor' with enzymes.", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'inhibitor' INTERSECT SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'activitor'", "question": "What are the medicine and trade names that can interact as an inhibitor and activitor with enzymes?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT name , trade_name FROM medicine EXCEPT SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX'", "question": "Show the medicine names and trade names that cannot interact with the enzyme with product 'Heme'.", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT name , trade_name FROM medicine EXCEPT SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX'", "question": "What are the medicine and trade names that cannot interact with the enzyme with the product 'Heme'?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT count(DISTINCT FDA_approved) FROM medicine", "question": "How many distinct FDA approval statuses are there for the medicines?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT count(DISTINCT FDA_approved) FROM medicine", "question": "How many different FDA approval statuses exist for medicines?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT name FROM enzyme WHERE name LIKE \"%ALA%\"", "question": "Which enzyme names have the substring \"ALA\"?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT name FROM enzyme WHERE name LIKE \"%ALA%\"", "question": "What are the names of enzymes that include the string 'ALA'?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT trade_name , count(*) FROM medicine GROUP BY trade_name", "question": "find the number of medicines offered by each trade.", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT trade_name , count(*) FROM medicine GROUP BY trade_name", "question": "How many medicines are offered by each trade name?", "schema": "medicine: id (INT), name (TEXT), Trade_Name (TEXT), FDA_approved (TEXT)\nenzyme: id (INT), name (TEXT), Location (TEXT), Product (TEXT), Chromosome (TEXT), OMIM (INT), Porphyria (TEXT)\nmedicine_enzyme_interaction: enzyme_id (INT), medicine_id (INT), interaction_type (TEXT)" }, { "query": "SELECT school , nickname FROM university ORDER BY founded", "question": "List all schools and their nicknames in the order of founded year.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT school , nickname FROM university ORDER BY founded", "question": "What are the different schools and their nicknames, ordered by their founding years?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT school , LOCATION FROM university WHERE affiliation = 'Public'", "question": "List all public schools and their locations.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT school , LOCATION FROM university WHERE affiliation = 'Public'", "question": "What are the public schools and what are their locations?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT founded FROM university ORDER BY enrollment DESC LIMIT 1", "question": "When was the school with the largest enrollment founded?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT founded FROM university ORDER BY enrollment DESC LIMIT 1", "question": "Return the founded year for the school with the largest enrollment.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT founded FROM university WHERE affiliation != 'Public' ORDER BY founded DESC LIMIT 1", "question": "Find the founded year of the newest non public school.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT founded FROM university WHERE affiliation != 'Public' ORDER BY founded DESC LIMIT 1", "question": "What is the founded year of the non public school that was founded most recently?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT count(DISTINCT school_id) FROM basketball_match", "question": "How many schools are in the basketball match?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT count(DISTINCT school_id) FROM basketball_match", "question": "Count the number of schools that have had basketball matches.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1", "question": "What is the highest acc percent score in the competition?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1", "question": "Return the highest acc percent across all basketball matches.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent LIMIT 1", "question": "What is the primary conference of the school that has the lowest acc percent score in the competition?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent LIMIT 1", "question": "Return the primary conference of the school with the lowest acc percentage score.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT t2.team_name , t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t1.founded LIMIT 1", "question": "What is the team name and acc regular season score of the school that was founded for the longest time?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT t2.team_name , t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t1.founded LIMIT 1", "question": "Return the name of the team and the acc during the regular season for the school that was founded the earliest.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT t2.All_Games , t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE team_name = 'Clemson'", "question": "Find the location and all games score of the school that has Clemson as its team name.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT t2.All_Games , t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE team_name = 'Clemson'", "question": "What are the all games score and location of the school called Clemson?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT avg(enrollment) FROM university WHERE founded < 1850", "question": "What are the average enrollment size of the universities that are founded before 1850?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT avg(enrollment) FROM university WHERE founded < 1850", "question": "Return the average enrollment of universities founded before 1850.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT enrollment , primary_conference FROM university ORDER BY founded LIMIT 1", "question": "Show the enrollment and primary_conference of the oldest college.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT enrollment , primary_conference FROM university ORDER BY founded LIMIT 1", "question": "What are the enrollment and primary conference for the university which was founded the earliest?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT sum(enrollment) , min(enrollment) FROM university", "question": "What is the total and minimum enrollment of all schools?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT sum(enrollment) , min(enrollment) FROM university", "question": "Return the total and minimum enrollments across all schools.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT sum(enrollment) , affiliation FROM university GROUP BY affiliation", "question": "Find the total student enrollment for different affiliation type schools.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT sum(enrollment) , affiliation FROM university GROUP BY affiliation", "question": "What are the total enrollments of universities of each affiliation type?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT count(*) FROM university WHERE school_id NOT IN (SELECT school_id FROM basketball_match)", "question": "How many schools do not participate in the basketball match?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT count(*) FROM university WHERE school_id NOT IN (SELECT school_id FROM basketball_match)", "question": "Count the number of universities that do not participate in the baketball match.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public'", "question": "Find the schools that were either founded after 1850 or public.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public'", "question": "What are the schools that were either founded before 1850 or are public?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT count(DISTINCT affiliation) FROM university", "question": "Find how many different affiliation types there are.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT count(DISTINCT affiliation) FROM university", "question": "Count the number of different affiliation types.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT count(*) FROM university WHERE LOCATION LIKE \"%NY%\"", "question": "Find how many school locations have the word 'NY'.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT count(*) FROM university WHERE LOCATION LIKE \"%NY%\"", "question": "How many universities have a location that contains NY?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE enrollment < (SELECT avg(enrollment) FROM university)", "question": "Find the team names of the universities whose enrollments are smaller than the average enrollment size.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE enrollment < (SELECT avg(enrollment) FROM university)", "question": "What are the names of teams from universities that have a below average enrollment?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT count(*) , affiliation FROM university WHERE enrollment > 20000 GROUP BY affiliation", "question": "Find the number of universities that have over a 20000 enrollment size for each affiliation type.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT count(*) , affiliation FROM university WHERE enrollment > 20000 GROUP BY affiliation", "question": "What are the different affiliations, and how many schools with each have an enrollment size of above 20000?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT sum(Enrollment) , affiliation FROM university WHERE founded > 1850 GROUP BY affiliation", "question": "Find the total number of students enrolled in the colleges that were founded after the year of 1850 for each affiliation type.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT sum(Enrollment) , affiliation FROM university WHERE founded > 1850 GROUP BY affiliation", "question": "What are the different affiliations, and what is the total enrollment of schools founded after 1850 for each enrollment type?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT max(Enrollment) FROM university", "question": "What is the maximum enrollment across all schools?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT max(Enrollment) FROM university", "question": "Return the maximum enrollment across all schools.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT * FROM basketball_match", "question": "List all information regarding the basketball match.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT * FROM basketball_match", "question": "What is all the information about the basketball match?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT team_name FROM basketball_match ORDER BY All_Home DESC", "question": "List names of all teams in the basketball competition, ordered by all home scores in descending order.", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT team_name FROM basketball_match ORDER BY All_Home DESC", "question": "What are the names of all the teams in the basketball competition, sorted by all home scores in descending order?", "schema": "basketball_match: Team_ID (INT), School_ID (INT), Team_Name (TEXT), ACC_Regular_Season (TEXT), ACC_Percent (TEXT), ACC_Home (TEXT), ACC_Road (TEXT), All_Games (TEXT), All_Games_Percent (INT), All_Home (TEXT), All_Road (TEXT), All_Neutral (TEXT)\nuniversity: School_ID (INT), School (TEXT), Location (TEXT), Founded (REAL), Affiliation (TEXT), Enrollment (REAL), Nickname (TEXT), Primary_conference (TEXT)" }, { "query": "SELECT Model_name FROM chip_model WHERE Launch_year BETWEEN 2002 AND 2004;", "question": "the names of models that launched between 2002 and 2004.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT Model_name , RAM_MiB FROM chip_model ORDER BY RAM_MiB ASC LIMIT 1;", "question": "Which model has the least amount of RAM? List the model name and the amount of RAM.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT chip_model , screen_mode FROM phone WHERE Hardware_Model_name = \"LG-P760\";", "question": "What are the chip model and screen mode of the phone with hardware model name \"LG-P760\"?", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT count(*) FROM phone WHERE Company_name = \"Nokia Corporation\";", "question": "How many phone hardware models are produced by the company named \"Nokia Corporation\"?", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT max(T1.RAM_MiB) , min(T1.RAM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = \"Nokia Corporation\";", "question": "What is maximum and minimum RAM size of phone produced by company named \"Nokia Corporation\"?", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT avg(T1.ROM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = \"Nokia Corporation\";", "question": "What is the average ROM size of phones produced by the company named \"Nokia Corporation\"?", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT T2.Hardware_Model_name , T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 OR T1.RAM_MiB > 32;", "question": "List the hardware model name and company name for all the phones that were launched in year 2002 or have RAM size greater than 32.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT Hardware_Model_name , Company_name FROM phone WHERE Accreditation_type LIKE 'Full';", "question": "Find all phones that have word 'Full' in their accreditation types. List the Hardware Model name and Company name.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT T1.Char_cells , T1.Pixels , T1.Hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Hardware_Model_name = \"LG-P760\";", "question": "Find the Char cells, Pixels and Hardware colours for the screen of the phone whose hardware model name is \"LG-P760\".", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = \"Graphics\";", "question": "List the hardware model name and company name for the phone whose screen mode type is \"Graphics.\"", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT Company_name , count(*) FROM phone GROUP BY Company_name ORDER BY count(*) ASC LIMIT 1;", "question": "Find the name of the company that has the least number of phone models. List the company name and the number of phone model produced by that company.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT Company_name FROM phone GROUP BY Company_name HAVING count(*) > 1;", "question": "List the name of the company that produced more than one phone model.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT max(used_kb) , min(used_kb) , avg(used_kb) FROM screen_mode;", "question": "List the maximum, minimum and average number of used kb in screen mode.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 ORDER BY T1.RAM_MiB DESC LIMIT 1;", "question": "List the name of the phone model launched in year 2002 and with the highest RAM size.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT T1.WiFi , T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = \"LG-P760\";", "question": "What are the wifi and screen mode type of the hardware model named \"LG-P760\"?", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T3.Type = \"Text\" OR T1.RAM_MiB > 32;", "question": "List the hardware model name for the phones that have screen mode type \"Text\" or RAM size greater than 32.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = \"Graphics\" OR t2.Company_name = \"Nokia Corporation\"", "question": "List the hardware model name for the phones that were produced by \"Nokia Corporation\" or whose screen mode type is \"Graphics.\"", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name = \"Nokia Corporation\" AND T1.Type != \"Text\";", "question": "List the hardware model name for the phons that were produced by \"Nokia Corporation\" but whose screen mode type is not Text.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT DISTINCT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb BETWEEN 10 AND 15;", "question": "List the phone hardware model and company name for the phones whose screen usage in kb is between 10 and 15.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT Accreditation_type , count(*) FROM phone GROUP BY Accreditation_type", "question": "Find the number of phones for each accreditation type.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT Accreditation_type , count(*) FROM phone GROUP BY Accreditation_type", "question": "How many phones belongs to each accreditation type?", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT Accreditation_level FROM phone GROUP BY Accreditation_level HAVING count(*) > 3", "question": "Find the accreditation level that more than 3 phones use.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT * FROM chip_model", "question": "Find the details for all chip models.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT count(*) FROM chip_model WHERE wifi = 'No'", "question": "How many models do not have the wifi function?", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT count(*) FROM chip_model WHERE wifi = 'No'", "question": "Count the number of chip model that do not have wifi.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT model_name FROM chip_model ORDER BY launch_year", "question": "List all the model names sorted by their launch year.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT avg(RAM_MiB) FROM chip_model WHERE model_name NOT IN (SELECT chip_model FROM phone)", "question": "Find the average ram mib size of the chip models that are never used by any phone.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT model_name FROM chip_model EXCEPT SELECT chip_model FROM phone WHERE Accreditation_type = 'Full'", "question": "Find the names of the chip models that are not used by any phone with full accreditation type.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Provisional' INTERSECT SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode = t2.screen_mode WHERE t2.Accreditation_type = 'Full'", "question": "Find the pixels of the screen modes that are used by both phones with full accreditation types and phones with Provisional accreditation types.", "schema": "chip_model: Model_name (TEXT), Launch_year (REAL), RAM_MiB (REAL), ROM_MiB (REAL), Slots (TEXT), WiFi (TEXT), Bluetooth (TEXT)\nscreen_mode: Graphics_mode (REAL), Char_cells (TEXT), Pixels (TEXT), Hardware_colours (REAL), used_kb (REAL), map (TEXT), Type (TEXT)\nphone: Company_name (TEXT), Hardware_Model_name (TEXT), Accreditation_type (TEXT), Accreditation_level (TEXT), Date (TEXT), chip_model (TEXT), screen_mode (TEXT)" }, { "query": "SELECT count(*) FROM country", "question": "How many countries are there in total?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT count(*) FROM country", "question": "Count the number of countries.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Country_name , Capital FROM country", "question": "Show the country name and capital of all countries.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Country_name , Capital FROM country", "question": "What are the names and capitals of each country?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Official_native_language FROM country WHERE Official_native_language LIKE \"%English%\"", "question": "Show all official native languages that contain the word \"English\".", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Official_native_language FROM country WHERE Official_native_language LIKE \"%English%\"", "question": "What are the official native languages that contain the string \"English\".", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT DISTINCT POSITION FROM match_season", "question": "Show all distinct positions of matches.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT DISTINCT POSITION FROM match_season", "question": "What are the different positions for match season?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Player FROM match_season WHERE College = \"UCLA\"", "question": "Show the players from college UCLA.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Player FROM match_season WHERE College = \"UCLA\"", "question": "Who are the players from UCLA?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT DISTINCT POSITION FROM match_season WHERE College = \"UCLA\" OR College = \"Duke\"", "question": "Show the distinct position of players from college UCLA or Duke.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT DISTINCT POSITION FROM match_season WHERE College = \"UCLA\" OR College = \"Duke\"", "question": "What are the different positions of players from UCLA or Duke colleges?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Draft_Pick_Number , Draft_Class FROM match_season WHERE POSITION = \"Defender\"", "question": "Show the draft pick numbers and draft classes of players whose positions are defenders.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Draft_Pick_Number , Draft_Class FROM match_season WHERE POSITION = \"Defender\"", "question": "What are the draft pick numbers and draft classes for players who play the Defender position?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT count(DISTINCT Team) FROM match_season", "question": "How many distinct teams are involved in match seasons?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT count(DISTINCT Team) FROM match_season", "question": "Count the number of different teams involved in match season.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Player , Years_Played FROM player", "question": "Show the players and the years played.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Player , Years_Played FROM player", "question": "Who are the different players and how many years has each played?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Name FROM Team", "question": "Show all team names.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Name FROM Team", "question": "What are the names of all teams?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT T2.Season , T2.Player , T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country", "question": "Show the season, the player, and the name of the country that player belongs to.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT T2.Season , T2.Player , T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country", "question": "For each player, what are their name, season, and country that they belong to?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Country_name = \"Indonesia\"", "question": "Which players are from Indonesia?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Country_name = \"Indonesia\"", "question": "Who are the players from Indonesia?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT DISTINCT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Capital = \"Dublin\"", "question": "What are the distinct positions of the players from a country whose capital is Dublin?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT DISTINCT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Capital = \"Dublin\"", "question": "Give the different positions of players who play for the country with the capital Dublin.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.College = \"Maryland\" OR T2.College = \"Duke\"", "question": "What are the official languages of the countries of players from Maryland or Duke college?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.College = \"Maryland\" OR T2.College = \"Duke\"", "question": "Return the official native languages of countries who have players from Maryland or Duke colleges.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT count(DISTINCT T1.Official_native_language) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = \"Defender\"", "question": "How many distinct official languages are there among countries of players whose positions are defenders.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT count(DISTINCT T1.Official_native_language) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = \"Defender\"", "question": "Count the number of different official languages corresponding to countries that players who play Defender are from.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT T1.Season , T1.Player , T2.Name FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id", "question": "Show the season, the player, and the name of the team that players belong to.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT T1.Season , T1.Player , T2.Name FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id", "question": "Who are the different players, what season do they play in, and what is the name of the team they are on?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = \"Ryley Goldner\"", "question": "Show the positions of the players from the team with name \"Ryley Goldner\".", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = \"Ryley Goldner\"", "question": "Return the positions of players on the team Ryley Goldner.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT count(DISTINCT T1.College) FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = \"Columbus Crew\"", "question": "How many distinct colleges are associated with players from the team with name \"Columbus Crew\".", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT count(DISTINCT T1.College) FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = \"Columbus Crew\"", "question": "Count the number of different colleges that players who play for Columbus Crew are from.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT T1.Player , T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = \"Columbus Crew\"", "question": "Show the players and years played for players from team \"Columbus Crew\".", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT T1.Player , T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = \"Columbus Crew\"", "question": "What are the players who played for Columbus Crew, and how many years did each play for?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT POSITION , COUNT(*) FROM match_season GROUP BY POSITION", "question": "Show the position of players and the corresponding number of players.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT POSITION , COUNT(*) FROM match_season GROUP BY POSITION", "question": "How many players played each position?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Country_name , COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name", "question": "Show the country names and the corresponding number of players.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Country_name , COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name", "question": "How many players are from each country?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT player FROM match_season ORDER BY College ASC", "question": "Return all players sorted by college in ascending alphabetical order.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT player FROM match_season ORDER BY College ASC", "question": "What are all the players who played in match season, sorted by college in ascending alphabetical order?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT POSITION FROM match_season GROUP BY POSITION ORDER BY count(*) DESC LIMIT 1", "question": "Show the most common position of players in match seasons.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT POSITION FROM match_season GROUP BY POSITION ORDER BY count(*) DESC LIMIT 1", "question": "What is the position that is most common among players in match seasons?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT College FROM match_season GROUP BY College ORDER BY count(*) DESC LIMIT 3", "question": "Show the top 3 most common colleges of players in match seasons.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT College FROM match_season GROUP BY College ORDER BY count(*) DESC LIMIT 3", "question": "What are the three colleges from which the most players are from?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2", "question": "Show the name of colleges that have at least two players.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2", "question": "What are the names of all colleges that have two or more players?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC", "question": "Show the name of colleges that have at least two players in descending alphabetical order.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC", "question": "What are the names of colleges that have two or more players, listed in descending alphabetical order?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)", "question": "What are the names of teams that do no have match season record?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)", "question": "Return the names of teams that have no match season record.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "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\"", "question": "What are the names of countries that have both players with position forward and players with position defender?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "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\"", "question": "Return the names of countries that have players that play the Forward position, as well as players who play the Defender position.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT College FROM match_season WHERE POSITION = \"Midfielder\" INTERSECT SELECT College FROM match_season WHERE POSITION = \"Defender\"", "question": "Which college have both players with position midfielder and players with position defender?", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT College FROM match_season WHERE POSITION = \"Midfielder\" INTERSECT SELECT College FROM match_season WHERE POSITION = \"Defender\"", "question": "Return the colleges that have players who play the Midfielder position, as well as players who play the Defender position.", "schema": "country: Country_id (INT), Country_name (TEXT), Capital (TEXT), Official_native_language (TEXT)\nteam: Team_id (INT), Name (TEXT)\nmatch_season: Season (REAL), Player (TEXT), Position (TEXT), Country (INT), Team (INT), Draft_Pick_Number (INT), Draft_Class (TEXT), College (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Years_Played (TEXT), Total_WL (TEXT), Singles_WL (TEXT), Doubles_WL (TEXT), Team (INT)" }, { "query": "SELECT count(*) FROM climber", "question": "How many climbers are there?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT count(*) FROM climber", "question": "Count the number of climbers.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Name FROM climber ORDER BY Points DESC", "question": "List the names of climbers in descending order of points.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Name FROM climber ORDER BY Points DESC", "question": "What are the names of the climbers, ordered by points descending?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Name FROM climber WHERE Country != \"Switzerland\"", "question": "List the names of climbers whose country is not Switzerland.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Name FROM climber WHERE Country != \"Switzerland\"", "question": "What are the names of climbers who are not from the country of Switzerland?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT max(Points) FROM climber WHERE Country = \"United Kingdom\"", "question": "What is the maximum point for climbers whose country is United Kingdom?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT max(Points) FROM climber WHERE Country = \"United Kingdom\"", "question": "Return the maximum number of points for climbers from the United Kingdom.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT COUNT(DISTINCT Country) FROM climber", "question": "How many distinct countries are the climbers from?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT COUNT(DISTINCT Country) FROM climber", "question": "Count the number of different countries that climbers are from.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Name FROM mountain ORDER BY Name ASC", "question": "What are the names of mountains in ascending alphabetical order?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Name FROM mountain ORDER BY Name ASC", "question": "Give the names of mountains in alphabetical order.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Country FROM mountain WHERE Height > 5000", "question": "What are the countries of mountains with height bigger than 5000?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Country FROM mountain WHERE Height > 5000", "question": "Return the countries of the mountains that have a height larger than 5000.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1", "question": "What is the name of the highest mountain?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1", "question": "Return the name of the mountain with the greatest height.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3", "question": "List the distinct ranges of the mountains with the top 3 prominence.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3", "question": "What are the different ranges of the 3 mountains with the highest prominence?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID", "question": "Show names of climbers and the names of mountains they climb.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID", "question": "What are the names of climbers and the corresponding names of mountains that they climb?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID", "question": "Show the names of climbers and the heights of mountains they climb.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID", "question": "What are the names of climbers and the corresponding heights of the mountains that they climb?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "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", "question": "Show the height of the mountain climbed by the climber with the maximum points.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "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", "question": "What is the height of the mountain climbined by the climbing who had the most points?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = \"West Germany\"", "question": "Show the distinct names of mountains climbed by climbers from country \"West Germany\".", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = \"West Germany\"", "question": "What are the different names of mountains ascended by climbers from the country of West Germany?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = \"Uganda\"", "question": "Show the times used by climbers to climb mountains in Country Uganda.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = \"Uganda\"", "question": "What are the times used by climbers who climbed mountains in the country of Uganda?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Country , COUNT(*) FROM climber GROUP BY Country", "question": "Please show the countries and the number of climbers from each country.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Country , COUNT(*) FROM climber GROUP BY Country", "question": "How many climbers are from each country?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1", "question": "List the countries that have more than one mountain.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1", "question": "Which countries have more than one mountain?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber)", "question": "List the names of mountains that do not have any climber.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber)", "question": "What are the names of countains that no climber has climbed?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200", "question": "Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200", "question": "What are the countries that have both mountains that are higher than 5600 and lower than 5200?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the range that has the most number of mountains.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1", "question": "Which range contains the most mountains?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000", "question": "Show the names of mountains with height more than 5000 or prominence more than 1000.", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000", "question": "What are the names of mountains that have a height of over 5000 or a prominence of over 1000?", "schema": "mountain: Mountain_ID (INT), Name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\nclimber: Climber_ID (INT), Name (TEXT), Country (TEXT), Time (TEXT), Points (REAL), Mountain_ID (INT)" }, { "query": "SELECT count(*) FROM body_builder", "question": "How many body builders are there?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT Total FROM body_builder ORDER BY Total ASC", "question": "List the total scores of body builders in ascending order.", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT Snatch , Clean_Jerk FROM body_builder ORDER BY Snatch ASC", "question": "List the snatch score and clean jerk score of body builders in ascending order of snatch score.", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT avg(Snatch) FROM body_builder", "question": "What is the average snatch score of body builders?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT Clean_Jerk FROM body_builder ORDER BY Total DESC LIMIT 1", "question": "What are the clean and jerk score of the body builder with the highest total score?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT Birth_Date FROM People ORDER BY Height ASC", "question": "What are the birthdays of people in ascending order of height?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID", "question": "What are the names of body builders?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 300", "question": "What are the names of body builders whose total score is higher than 300?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "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", "question": "What is the name of the body builder with the greatest body weight?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "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", "question": "What are the birth date and birth place of the body builder with the highest total points?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total < 315", "question": "What are the heights of body builders with total score smaller than 315?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT avg(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200", "question": "What is the average total score of body builders with height bigger than 200?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC", "question": "What are the names of body builders in descending order of total scores?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT Birth_Place , COUNT(*) FROM people GROUP BY Birth_Place", "question": "List each birth place along with the number of people from there.", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the most common birth place of people?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2", "question": "What are the birth places that are shared by at least two people?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT Height , Weight FROM people ORDER BY Height DESC", "question": "List the height and weight of people in descending order of height.", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT * FROM body_builder", "question": "Show all information about each body builder.", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "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", "question": "List the names and origins of people who are not body builders.", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT count(DISTINCT Birth_Place) FROM people", "question": "How many distinct birth places are there?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT count(*) FROM people WHERE people_id NOT IN (SELECT People_ID FROM body_builder)", "question": "How many persons are not body builders?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "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;", "question": "List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200.", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "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%\";", "question": "What are the total scores of the body builders whose birthday contains the string \"January\" ?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT min(snatch) FROM body_builder", "question": "What is the minimum snatch score?", "schema": "body_builder: Body_Builder_ID (INT), People_ID (INT), Snatch (REAL), Clean_Jerk (REAL), Total (REAL)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Birth_Date (TEXT), Birth_Place (TEXT)" }, { "query": "SELECT count(*) FROM election", "question": "How many elections are there?", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT Votes FROM election ORDER BY Votes DESC", "question": "List the votes of elections in descending order.", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT Date , Vote_Percent FROM election", "question": "List the dates and vote percents of elections.", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT min(Vote_Percent) , max(Vote_Percent) FROM election", "question": "What are the minimum and maximum vote percents of elections?", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT Name , Party FROM representative", "question": "What are the names and parties of representatives?", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT Name FROM Representative WHERE Party != \"Republican\"", "question": "What are the names of representatives whose party is not \"Republican\"?", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT Lifespan FROM representative WHERE State = \"New York\" OR State = \"Indiana\"", "question": "What are the life spans of representatives from New York state or Indiana state?", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT T2.Name , T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID", "question": "What are the names of representatives and the dates of elections they participated in.", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE Votes > 10000", "question": "What are the names of representatives with more than 10000 votes in election?", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC", "question": "What are the names of representatives in descending order of votes?", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes ASC LIMIT 1", "question": "What is the party of the representative that has the smallest number of votes.", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY Vote_Percent DESC", "question": "What are the lifespans of representatives in descending order of vote percent?", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = \"Republican\"", "question": "What is the average number of votes of representatives from party \"Republican\"?", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT Party , COUNT(*) FROM representative GROUP BY Party", "question": "What are the different parties of representative? Show the party name and the number of representatives in each party.", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT Party , COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the party that has the largest number of representatives?", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3", "question": "What parties have at least three representatives?", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2", "question": "What states have at least two representatives?", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election)", "question": "List the names of representatives that have not participated in elections listed here.", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT Party FROM representative WHERE State = \"New York\" INTERSECT SELECT Party FROM representative WHERE State = \"Pennsylvania\"", "question": "Show the parties that have both representatives in New York state and representatives in Pennsylvania state.", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT count(DISTINCT Party) FROM representative", "question": "How many distinct parties are there for representatives?", "schema": "election: Election_ID (INT), Representative_ID (INT), Date (TEXT), Votes (REAL), Vote_Percent (REAL), Seats (REAL), Place (REAL)\nrepresentative: Representative_ID (INT), Name (TEXT), State (TEXT), Party (TEXT), Lifespan (TEXT)" }, { "query": "SELECT count(*) FROM Apartment_Bookings", "question": "How many apartment bookings are there in total?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT count(*) FROM Apartment_Bookings", "question": "Count the total number of apartment bookings.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT booking_start_date , booking_end_date FROM Apartment_Bookings", "question": "Show the start dates and end dates of all the apartment bookings.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT booking_start_date , booking_end_date FROM Apartment_Bookings", "question": "What are the start date and end date of each apartment booking?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT DISTINCT building_description FROM Apartment_Buildings", "question": "Show all distinct building descriptions.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT DISTINCT building_description FROM Apartment_Buildings", "question": "Give me a list of all the distinct building descriptions.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT building_short_name FROM Apartment_Buildings WHERE building_manager\t = \"Emma\"", "question": "Show the short names of the buildings managed by \"Emma\".", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT building_short_name FROM Apartment_Buildings WHERE building_manager\t = \"Emma\"", "question": "Which buildings does \"Emma\" manage? Give me the short names of the buildings.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT building_address , building_phone FROM Apartment_Buildings WHERE building_manager\t = \"Brenden\"", "question": "Show the addresses and phones of all the buildings managed by \"Brenden\".", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT building_address , building_phone FROM Apartment_Buildings WHERE building_manager\t = \"Brenden\"", "question": "What are the address and phone number of the buildings managed by \"Brenden\"?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE \"%court%\"", "question": "What are the building full names that contain the word \"court\"?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE \"%court%\"", "question": "Find all the building full names containing the word \"court\".", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT min(bathroom_count) , max(bathroom_count) FROM Apartments", "question": "What is the minimum and maximum number of bathrooms of all the apartments?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT min(bathroom_count) , max(bathroom_count) FROM Apartments", "question": "Give me the minimum and maximum bathroom count among all the apartments.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT avg(bedroom_count) FROM Apartments", "question": "What is the average number of bedrooms of all apartments?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT avg(bedroom_count) FROM Apartments", "question": "Find the average number of bedrooms of all the apartments.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_number , room_count FROM Apartments", "question": "Return the apartment number and the number of rooms for each apartment.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_number , room_count FROM Apartments", "question": "What are the apartment number and the room count of each apartment?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT avg(room_count) FROM Apartments WHERE apt_type_code = \"Studio\"", "question": "What is the average number of rooms of apartments with type code \"Studio\"?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT avg(room_count) FROM Apartments WHERE apt_type_code = \"Studio\"", "question": "Find the average room count of the apartments that have the \"Studio\" type code.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_number FROM Apartments WHERE apt_type_code = \"Flat\"", "question": "Return the apartment numbers of the apartments with type code \"Flat\".", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_number FROM Apartments WHERE apt_type_code = \"Flat\"", "question": "Which apartments have type code \"Flat\"? Give me their apartment numbers.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT guest_first_name , guest_last_name FROM Guests", "question": "Return the first names and last names of all guests", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT guest_first_name , guest_last_name FROM Guests", "question": "What are the first names and last names of all the guests?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT date_of_birth FROM Guests WHERE gender_code = \"Male\"", "question": "Return the date of birth for all the guests with gender code \"Male\".", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT date_of_birth FROM Guests WHERE gender_code = \"Male\"", "question": "What are dates of birth of all the guests whose gender is \"Male\"?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T2.apt_number , T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id", "question": "Show the apartment numbers, start dates, and end dates of all the apartment bookings.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T2.apt_number , T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id", "question": "What are the apartment number, start date, and end date of each apartment booking?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = \"Duplex\"", "question": "What are the booking start and end dates of the apartments with type code \"Duplex\"?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = \"Duplex\"", "question": "Return the booking start date and end date for the apartments that have type code \"Duplex\".", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2", "question": "What are the booking start and end dates of the apartments with more than 2 bedrooms?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2", "question": "Find the booking start date and end date for the apartments that have more than two bedrooms.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T1.booking_status_code FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_number = \"Suite 634\"", "question": "What is the booking status code of the apartment with apartment number \"Suite 634\"?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T1.booking_status_code FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_number = \"Suite 634\"", "question": "Tell me the booking status code for the apartment with number \"Suite 634\".", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT DISTINCT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = \"Confirmed\"", "question": "Show the distinct apartment numbers of the apartments that have bookings with status code \"Confirmed\".", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT DISTINCT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = \"Confirmed\"", "question": "Which apartments have bookings with status code \"Confirmed\"? Return their apartment numbers.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT avg(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = \"Provisional\"", "question": "Show the average room count of the apartments that have booking status code \"Provisional\".", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT avg(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = \"Provisional\"", "question": "What is the average room count of the apartments whose booking status code is \"Provisional\"?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T2.guest_first_name , T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id", "question": "Show the guest first names, start dates, and end dates of all the apartment bookings.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T2.guest_first_name , T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id", "question": "What are the guest first name, start date, and end date of each apartment booking?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = \"Female\"", "question": "Show the start dates and end dates of all the apartment bookings made by guests with gender code \"Female\".", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = \"Female\"", "question": "What are the start date and end date of the apartment bookings made by female guests (gender code \"Female\")?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T2.guest_first_name , T2.guest_last_name FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = \"Confirmed\"", "question": "Show the first names and last names of all the guests that have apartment bookings with status code \"Confirmed\".", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T2.guest_first_name , T2.guest_last_name FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = \"Confirmed\"", "question": "Which guests have apartment bookings with status code \"Confirmed\"? Return their first names and last names.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4", "question": "Show the facility codes of apartments with more than 4 bedrooms.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4", "question": "What are the facility codes of the apartments with more than four bedrooms?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT sum(T2.room_count) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = \"Gym\"", "question": "Show the total number of rooms of all apartments with facility code \"Gym\".", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT sum(T2.room_count) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = \"Gym\"", "question": "Find the total number of rooms in the apartments that have facility code \"Gym\".", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT sum(T2.room_count) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = \"Columbus Square\"", "question": "Show the total number of rooms of the apartments in the building with short name \"Columbus Square\".", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT sum(T2.room_count) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = \"Columbus Square\"", "question": "How many rooms in total are there in the apartments in the building with short name \"Columbus Square\"?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.bathroom_count > 2", "question": "Show the addresses of the buildings that have apartments with more than 2 bathrooms.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.bathroom_count > 2", "question": "Which buildings have apartments that have more than two bathrooms? Give me the addresses of the buildings.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T2.apt_type_code , T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = \"Kyle\"", "question": "Show the apartment type codes and apartment numbers in the buildings managed by \"Kyle\".", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T2.apt_type_code , T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = \"Kyle\"", "question": "What apartment type codes and apartment numbers do the buildings managed by \"Kyle\" have?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT \tbooking_status_code , COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code", "question": "Show the booking status code and the corresponding number of bookings.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT \tbooking_status_code , COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code", "question": "How many bookings does each booking status have? List the booking status code and the number of corresponding bookings.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_number FROM Apartments ORDER BY room_count ASC", "question": "Return all the apartment numbers sorted by the room count in ascending order.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_number FROM Apartments ORDER BY room_count ASC", "question": "Sort the apartment numbers in ascending order of room count.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1", "question": "Return the apartment number with the largest number of bedrooms.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1", "question": "What is the apartment number of the apartment with the most beds?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_type_code , COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC", "question": "Show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending order.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_type_code , COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC", "question": "Return each apartment type code with the number of apartments having that apartment type, in ascending order of the number of apartments.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 3", "question": "Show the top 3 apartment type codes sorted by the average number of rooms in descending order.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 3", "question": "What are the top three apartment types in terms of the average room count? Give me the", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_type_code , bathroom_count , bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY sum(room_count) DESC LIMIT 1", "question": "Show the apartment type code that has the largest number of total rooms, together with the number of bathrooms and number of bedrooms.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_type_code , bathroom_count , bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY sum(room_count) DESC LIMIT 1", "question": "Which apartment type has the largest number of total rooms? Return the apartment type code, its number of bathrooms and number of bedrooms.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1", "question": "Show the most common apartment type code.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1", "question": "Which apartment type code appears the most often?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1", "question": "Show the most common apartment type code among apartments with more than 1 bathroom.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1", "question": "Which apartment type code is the most common among apartments with more than one bathroom?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_type_code , max(room_count) , min(room_count) FROM Apartments GROUP BY apt_type_code", "question": "Show each apartment type code, and the maximum and minimum number of rooms for each type.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT apt_type_code , max(room_count) , min(room_count) FROM Apartments GROUP BY apt_type_code", "question": "Return each apartment type code along with the maximum and minimum number of rooms among each type.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT gender_code , COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC", "question": "Show each gender code and the corresponding count of guests sorted by the count in descending order.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT gender_code , COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC", "question": "Sort the gender codes in descending order of their corresponding number of guests. Return both the gender codes and counts.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT count(*) FROM Apartments WHERE apt_id NOT IN (SELECT apt_id FROM Apartment_Facilities)", "question": "How many apartments do not have any facility?", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT count(*) FROM Apartments WHERE apt_id NOT IN (SELECT apt_id FROM Apartment_Facilities)", "question": "Find the number of apartments that have no facility.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = \"Confirmed\" INTERSECT SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = \"Provisional\"", "question": "Show the apartment numbers of apartments with bookings that have status code both \"Provisional\" and \"Confirmed\"", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = \"Confirmed\" INTERSECT SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = \"Provisional\"", "question": "Which apartments have bookings with both status codes \"Provisional\" and \"Confirmed\"? Give me the apartment numbers.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 0 INTERSECT SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 1", "question": "Show the apartment numbers of apartments with unit status availability of both 0 and 1.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 0 INTERSECT SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 1", "question": "Which apartments have unit status availability of both 0 and 1? Return their apartment numbers.", "schema": "Apartment_Buildings: building_id (INTEGER), building_short_name (CHAR(15)), building_full_name (VARCHAR(80)), building_description (VARCHAR(255)), building_address (VARCHAR(255)), building_manager (VARCHAR(50)), building_phone (VARCHAR(80))\nApartments: apt_id (INTEGER), building_id (INTEGER), apt_type_code (CHAR(15)), apt_number (CHAR(10)), bathroom_count (INTEGER), bedroom_count (INTEGER), room_count (CHAR(5))\nApartment_Facilities: apt_id (INTEGER), facility_code (CHAR(15))\nGuests: guest_id (INTEGER), gender_code (CHAR(1)), guest_first_name (VARCHAR(80)), guest_last_name (VARCHAR(80)), date_of_birth (DATETIME)\nApartment_Bookings: apt_booking_id (INTEGER), apt_id (INTEGER), guest_id (INTEGER), booking_status_code (CHAR(15)), booking_start_date (DATETIME), booking_end_date (DATETIME)\nView_Unit_Status: apt_id (INTEGER), apt_booking_id (INTEGER), status_date (DATETIME), available_yn (BIT)" }, { "query": "SELECT count(*) FROM game WHERE season > 2007", "question": "How many games are held after season 2007?", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT Date FROM game ORDER BY home_team DESC", "question": "List the dates of games by the home team name in descending order.", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT season , home_team , away_team FROM game", "question": "List the season, home team, away team of all the games.", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT max(home_games) , min(home_games) , avg(home_games) FROM stadium", "question": "What are the maximum, minimum and average home games each stadium held?", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT average_attendance FROM stadium WHERE capacity_percentage > 100", "question": "What is the average attendance of stadiums with capacity percentage higher than 100%?", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT player , number_of_matches , SOURCE FROM injury_accident WHERE injury != 'Knee problem'", "question": "What are the player name, number of matches, and information source for players who do not suffer from injury of 'Knee problem'?", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT T1.season FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id WHERE T2.player = 'Walter Samuel'", "question": "What is the season of the game which causes the player 'Walter Samuel' to get injured?", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT T1.id , T1.score , T1.date FROM game AS T1 JOIN injury_accident AS T2 ON T2.game_id = T1.id GROUP BY T1.id HAVING count(*) >= 2", "question": "What are the ids, scores, and dates of the games which caused at least two injury accidents?", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT T1.id , T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1", "question": "What are the id and name of the stadium where the most injury accidents happened?", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT T1.id , T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1", "question": "Find the id and name of the stadium where the largest number of injury accidents occurred.", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT T1.season , T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.injury = 'Foot injury' OR T3.injury = 'Knee problem'", "question": "In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'?", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT count(DISTINCT SOURCE) FROM injury_accident", "question": "How many different kinds of information sources are there for injury accidents?", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT count(*) FROM game WHERE id NOT IN ( SELECT game_id FROM injury_accident )", "question": "How many games are free of injury accidents?", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT count(DISTINCT T1.injury) FROM injury_accident AS T1 JOIN game AS T2 ON T1.game_id = T2.id WHERE T2.season > 2010", "question": "How many distinct kinds of injuries happened after season 2010?", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Walter Samuel' INTERSECT SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Thiago Motta'", "question": "List the name of the stadium where both the player 'Walter Samuel' and the player 'Thiago Motta' got injured.", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT name , average_attendance , total_attendance FROM stadium EXCEPT SELECT T2.name , T2.average_attendance , T2.total_attendance FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id", "question": "Show the name, average attendance, total attendance for stadiums where no accidents happened.", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT name FROM stadium WHERE name LIKE \"%Bank%\"", "question": "Which stadium name contains the substring \"Bank\"?", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT T1.id , count(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id", "question": "How many games has each stadium held?", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT T1.date , T2.player FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id ORDER BY T1.season DESC", "question": "For each injury accident, find the date of the game and the name of the injured player in the game, and sort the results in descending order of game season.", "schema": "stadium: id (INT), name (TEXT), Home_Games (INT), Average_Attendance (REAL), Total_Attendance (REAL), Capacity_Percentage (REAL)\ngame: stadium_id (INT), id (INT), Season (INT), Date (TEXT), Home_team (TEXT), Away_team (TEXT), Score (TEXT), Competition (TEXT)\ninjury_accident: game_id (INT), id (INT), Player (TEXT), Injury (TEXT), Number_of_matches (TEXT), Source (TEXT)" }, { "query": "SELECT T1.name , T2.name FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id", "question": "List all country and league names.", "schema": "Player_Attributes: id (INTEGER), player_fifa_api_id (INTEGER), player_api_id (INTEGER), date (TEXT), overall_rating (INTEGER), potential (INTEGER), preferred_foot (TEXT), attacking_work_rate (TEXT), defensive_work_rate (TEXT), crossing (INTEGER), finishing (INTEGER), heading_accuracy (INTEGER), short_passing (INTEGER), volleys (INTEGER), dribbling (INTEGER), curve (INTEGER), free_kick_accuracy (INTEGER), long_passing (INTEGER), ball_control (INTEGER), acceleration (INTEGER), sprint_speed (INTEGER), agility (INTEGER), reactions (INTEGER), balance (INTEGER), shot_power (INTEGER), jumping (INTEGER), stamina (INTEGER), strength (INTEGER), long_shots (INTEGER), aggression (INTEGER), interceptions (INTEGER), positioning (INTEGER), vision (INTEGER), penalties (INTEGER), marking (INTEGER), standing_tackle (INTEGER), sliding_tackle (INTEGER), gk_diving (INTEGER), gk_handling (INTEGER), gk_kicking (INTEGER), gk_positioning (INTEGER), gk_reflexes (INTEGER)\nPlayer: id (INTEGER), player_api_id (INTEGER), player_name (TEXT), player_fifa_api_id (INTEGER), birthday (TEXT), height (INTEGER), weight (INTEGER)\nMatch: id (INTEGER), country_id (INTEGER), league_id (INTEGER), season (TEXT), stage (INTEGER), date (TEXT), match_api_id (INTEGER), home_team_api_id (INTEGER), away_team_api_id (INTEGER), home_team_goal (INTEGER), away_team_goal (INTEGER), home_player_X1 (INTEGER), home_player_X2 (INTEGER), home_player_X3 (INTEGER), home_player_X4 (INTEGER), home_player_X5 (INTEGER), home_player_X6 (INTEGER), home_player_X7 (INTEGER), home_player_X8 (INTEGER), home_player_X9 (INTEGER), home_player_X10 (INTEGER), home_player_X11 (INTEGER), away_player_X1 (INTEGER), away_player_X2 (INTEGER), away_player_X3 (INTEGER), away_player_X4 (INTEGER), away_player_X5 (INTEGER), away_player_X6 (INTEGER), away_player_X7 (INTEGER), away_player_X8 (INTEGER), away_player_X9 (INTEGER), away_player_X10 (INTEGER), away_player_X11 (INTEGER), home_player_Y1 (INTEGER), home_player_Y2 (INTEGER), home_player_Y3 (INTEGER), home_player_Y4 (INTEGER), home_player_Y5 (INTEGER), home_player_Y6 (INTEGER), home_player_Y7 (INTEGER), home_player_Y8 (INTEGER), home_player_Y9 (INTEGER), home_player_Y10 (INTEGER), home_player_Y11 (INTEGER), away_player_Y1 (INTEGER), away_player_Y2 (INTEGER), away_player_Y3 (INTEGER), away_player_Y4 (INTEGER), away_player_Y5 (INTEGER), away_player_Y6 (INTEGER), away_player_Y7 (INTEGER), away_player_Y8 (INTEGER), away_player_Y9 (INTEGER), away_player_Y10 (INTEGER), away_player_Y11 (INTEGER), home_player_1 (INTEGER), home_player_2 (INTEGER), home_player_3 (INTEGER), home_player_4 (INTEGER), home_player_5 (INTEGER), home_player_6 (INTEGER), home_player_7 (INTEGER), home_player_8 (INTEGER), home_player_9 (INTEGER), home_player_10 (INTEGER), home_player_11 (INTEGER), away_player_1 (INTEGER), away_player_2 (INTEGER), away_player_3 (INTEGER), away_player_4 (INTEGER), away_player_5 (INTEGER), away_player_6 (INTEGER), away_player_7 (INTEGER), away_player_8 (INTEGER), away_player_9 (INTEGER), away_player_10 (INTEGER), away_player_11 (INTEGER), goal (TEXT), shoton (TEXT), shotoff (TEXT), foulcommit (TEXT), card (TEXT), cross (TEXT), corner (TEXT), possession (TEXT), B365H (NUMERIC), B365D (NUMERIC), B365A (NUMERIC), BWH (NUMERIC), BWD (NUMERIC), BWA (NUMERIC), IWH (NUMERIC), IWD (NUMERIC), IWA (NUMERIC), LBH (NUMERIC), LBD (NUMERIC), LBA (NUMERIC), PSH (NUMERIC), PSD (NUMERIC), PSA (NUMERIC), WHH (NUMERIC), WHD (NUMERIC), WHA (NUMERIC), SJH (NUMERIC), SJD (NUMERIC), SJA (NUMERIC), VCH (NUMERIC), VCD (NUMERIC), VCA (NUMERIC), GBH (NUMERIC), GBD (NUMERIC), GBA (NUMERIC), BSH (NUMERIC), BSD (NUMERIC), BSA (NUMERIC)\nLeague: id (INTEGER), country_id (INTEGER), name (TEXT)\nCountry: id (INTEGER), name (TEXT)\nTeam: id (INTEGER), team_api_id (INTEGER), team_fifa_api_id (INTEGER), team_long_name (TEXT), team_short_name (TEXT)\nTeam_Attributes: id (INTEGER), team_fifa_api_id (INTEGER), team_api_id (INTEGER), date (TEXT), buildUpPlaySpeed (INTEGER), buildUpPlaySpeedClass (TEXT), buildUpPlayDribbling (INTEGER), buildUpPlayDribblingClass (TEXT), buildUpPlayPassing (INTEGER), buildUpPlayPassingClass (TEXT), buildUpPlayPositioningClass (TEXT), chanceCreationPassing (INTEGER), chanceCreationPassingClass (TEXT), chanceCreationCrossing (INTEGER), chanceCreationCrossingClass (TEXT), chanceCreationShooting (INTEGER), chanceCreationShootingClass (TEXT), chanceCreationPositioningClass (TEXT), defencePressure (INTEGER), defencePressureClass (TEXT), defenceAggression (INTEGER), defenceAggressionClass (TEXT), defenceTeamWidth (INTEGER), defenceTeamWidthClass (TEXT), defenceDefenderLineClass (TEXT)" }, { "query": "SELECT count(*) FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id WHERE T1.name = \"England\"", "question": "How many leagues are there in England?", "schema": "Player_Attributes: id (INTEGER), player_fifa_api_id (INTEGER), player_api_id (INTEGER), date (TEXT), overall_rating (INTEGER), potential (INTEGER), preferred_foot (TEXT), attacking_work_rate (TEXT), defensive_work_rate (TEXT), crossing (INTEGER), finishing (INTEGER), heading_accuracy (INTEGER), short_passing (INTEGER), volleys (INTEGER), dribbling (INTEGER), curve (INTEGER), free_kick_accuracy (INTEGER), long_passing (INTEGER), ball_control (INTEGER), acceleration (INTEGER), sprint_speed (INTEGER), agility (INTEGER), reactions (INTEGER), balance (INTEGER), shot_power (INTEGER), jumping (INTEGER), stamina (INTEGER), strength (INTEGER), long_shots (INTEGER), aggression (INTEGER), interceptions (INTEGER), positioning (INTEGER), vision (INTEGER), penalties (INTEGER), marking (INTEGER), standing_tackle (INTEGER), sliding_tackle (INTEGER), gk_diving (INTEGER), gk_handling (INTEGER), gk_kicking (INTEGER), gk_positioning (INTEGER), gk_reflexes (INTEGER)\nPlayer: id (INTEGER), player_api_id (INTEGER), player_name (TEXT), player_fifa_api_id (INTEGER), birthday (TEXT), height (INTEGER), weight (INTEGER)\nMatch: id (INTEGER), country_id (INTEGER), league_id (INTEGER), season (TEXT), stage (INTEGER), date (TEXT), match_api_id (INTEGER), home_team_api_id (INTEGER), away_team_api_id (INTEGER), home_team_goal (INTEGER), away_team_goal (INTEGER), home_player_X1 (INTEGER), home_player_X2 (INTEGER), home_player_X3 (INTEGER), home_player_X4 (INTEGER), home_player_X5 (INTEGER), home_player_X6 (INTEGER), home_player_X7 (INTEGER), home_player_X8 (INTEGER), home_player_X9 (INTEGER), home_player_X10 (INTEGER), home_player_X11 (INTEGER), away_player_X1 (INTEGER), away_player_X2 (INTEGER), away_player_X3 (INTEGER), away_player_X4 (INTEGER), away_player_X5 (INTEGER), away_player_X6 (INTEGER), away_player_X7 (INTEGER), away_player_X8 (INTEGER), away_player_X9 (INTEGER), away_player_X10 (INTEGER), away_player_X11 (INTEGER), home_player_Y1 (INTEGER), home_player_Y2 (INTEGER), home_player_Y3 (INTEGER), home_player_Y4 (INTEGER), home_player_Y5 (INTEGER), home_player_Y6 (INTEGER), home_player_Y7 (INTEGER), home_player_Y8 (INTEGER), home_player_Y9 (INTEGER), home_player_Y10 (INTEGER), home_player_Y11 (INTEGER), away_player_Y1 (INTEGER), away_player_Y2 (INTEGER), away_player_Y3 (INTEGER), away_player_Y4 (INTEGER), away_player_Y5 (INTEGER), away_player_Y6 (INTEGER), away_player_Y7 (INTEGER), away_player_Y8 (INTEGER), away_player_Y9 (INTEGER), away_player_Y10 (INTEGER), away_player_Y11 (INTEGER), home_player_1 (INTEGER), home_player_2 (INTEGER), home_player_3 (INTEGER), home_player_4 (INTEGER), home_player_5 (INTEGER), home_player_6 (INTEGER), home_player_7 (INTEGER), home_player_8 (INTEGER), home_player_9 (INTEGER), home_player_10 (INTEGER), home_player_11 (INTEGER), away_player_1 (INTEGER), away_player_2 (INTEGER), away_player_3 (INTEGER), away_player_4 (INTEGER), away_player_5 (INTEGER), away_player_6 (INTEGER), away_player_7 (INTEGER), away_player_8 (INTEGER), away_player_9 (INTEGER), away_player_10 (INTEGER), away_player_11 (INTEGER), goal (TEXT), shoton (TEXT), shotoff (TEXT), foulcommit (TEXT), card (TEXT), cross (TEXT), corner (TEXT), possession (TEXT), B365H (NUMERIC), B365D (NUMERIC), B365A (NUMERIC), BWH (NUMERIC), BWD (NUMERIC), BWA (NUMERIC), IWH (NUMERIC), IWD (NUMERIC), IWA (NUMERIC), LBH (NUMERIC), LBD (NUMERIC), LBA (NUMERIC), PSH (NUMERIC), PSD (NUMERIC), PSA (NUMERIC), WHH (NUMERIC), WHD (NUMERIC), WHA (NUMERIC), SJH (NUMERIC), SJD (NUMERIC), SJA (NUMERIC), VCH (NUMERIC), VCD (NUMERIC), VCA (NUMERIC), GBH (NUMERIC), GBD (NUMERIC), GBA (NUMERIC), BSH (NUMERIC), BSD (NUMERIC), BSA (NUMERIC)\nLeague: id (INTEGER), country_id (INTEGER), name (TEXT)\nCountry: id (INTEGER), name (TEXT)\nTeam: id (INTEGER), team_api_id (INTEGER), team_fifa_api_id (INTEGER), team_long_name (TEXT), team_short_name (TEXT)\nTeam_Attributes: id (INTEGER), team_fifa_api_id (INTEGER), team_api_id (INTEGER), date (TEXT), buildUpPlaySpeed (INTEGER), buildUpPlaySpeedClass (TEXT), buildUpPlayDribbling (INTEGER), buildUpPlayDribblingClass (TEXT), buildUpPlayPassing (INTEGER), buildUpPlayPassingClass (TEXT), buildUpPlayPositioningClass (TEXT), chanceCreationPassing (INTEGER), chanceCreationPassingClass (TEXT), chanceCreationCrossing (INTEGER), chanceCreationCrossingClass (TEXT), chanceCreationShooting (INTEGER), chanceCreationShootingClass (TEXT), chanceCreationPositioningClass (TEXT), defencePressure (INTEGER), defencePressureClass (TEXT), defenceAggression (INTEGER), defenceAggressionClass (TEXT), defenceTeamWidth (INTEGER), defenceTeamWidthClass (TEXT), defenceDefenderLineClass (TEXT)" }, { "query": "SELECT avg(weight) FROM Player", "question": "What is the average weight of all players?", "schema": "Player_Attributes: id (INTEGER), player_fifa_api_id (INTEGER), player_api_id (INTEGER), date (TEXT), overall_rating (INTEGER), potential (INTEGER), preferred_foot (TEXT), attacking_work_rate (TEXT), defensive_work_rate (TEXT), crossing (INTEGER), finishing (INTEGER), heading_accuracy (INTEGER), short_passing (INTEGER), volleys (INTEGER), dribbling (INTEGER), curve (INTEGER), free_kick_accuracy (INTEGER), long_passing (INTEGER), ball_control (INTEGER), acceleration (INTEGER), sprint_speed (INTEGER), agility (INTEGER), reactions (INTEGER), balance (INTEGER), shot_power (INTEGER), jumping (INTEGER), stamina (INTEGER), strength (INTEGER), long_shots (INTEGER), aggression (INTEGER), interceptions (INTEGER), positioning (INTEGER), vision (INTEGER), penalties (INTEGER), marking (INTEGER), standing_tackle (INTEGER), sliding_tackle (INTEGER), gk_diving (INTEGER), gk_handling (INTEGER), gk_kicking (INTEGER), gk_positioning (INTEGER), gk_reflexes (INTEGER)\nPlayer: id (INTEGER), player_api_id (INTEGER), player_name (TEXT), player_fifa_api_id (INTEGER), birthday (TEXT), height (INTEGER), weight (INTEGER)\nMatch: id (INTEGER), country_id (INTEGER), league_id (INTEGER), season (TEXT), stage (INTEGER), date (TEXT), match_api_id (INTEGER), home_team_api_id (INTEGER), away_team_api_id (INTEGER), home_team_goal (INTEGER), away_team_goal (INTEGER), home_player_X1 (INTEGER), home_player_X2 (INTEGER), home_player_X3 (INTEGER), home_player_X4 (INTEGER), home_player_X5 (INTEGER), home_player_X6 (INTEGER), home_player_X7 (INTEGER), home_player_X8 (INTEGER), home_player_X9 (INTEGER), home_player_X10 (INTEGER), home_player_X11 (INTEGER), away_player_X1 (INTEGER), away_player_X2 (INTEGER), away_player_X3 (INTEGER), away_player_X4 (INTEGER), away_player_X5 (INTEGER), away_player_X6 (INTEGER), away_player_X7 (INTEGER), away_player_X8 (INTEGER), away_player_X9 (INTEGER), away_player_X10 (INTEGER), away_player_X11 (INTEGER), home_player_Y1 (INTEGER), home_player_Y2 (INTEGER), home_player_Y3 (INTEGER), home_player_Y4 (INTEGER), home_player_Y5 (INTEGER), home_player_Y6 (INTEGER), home_player_Y7 (INTEGER), home_player_Y8 (INTEGER), home_player_Y9 (INTEGER), home_player_Y10 (INTEGER), home_player_Y11 (INTEGER), away_player_Y1 (INTEGER), away_player_Y2 (INTEGER), away_player_Y3 (INTEGER), away_player_Y4 (INTEGER), away_player_Y5 (INTEGER), away_player_Y6 (INTEGER), away_player_Y7 (INTEGER), away_player_Y8 (INTEGER), away_player_Y9 (INTEGER), away_player_Y10 (INTEGER), away_player_Y11 (INTEGER), home_player_1 (INTEGER), home_player_2 (INTEGER), home_player_3 (INTEGER), home_player_4 (INTEGER), home_player_5 (INTEGER), home_player_6 (INTEGER), home_player_7 (INTEGER), home_player_8 (INTEGER), home_player_9 (INTEGER), home_player_10 (INTEGER), home_player_11 (INTEGER), away_player_1 (INTEGER), away_player_2 (INTEGER), away_player_3 (INTEGER), away_player_4 (INTEGER), away_player_5 (INTEGER), away_player_6 (INTEGER), away_player_7 (INTEGER), away_player_8 (INTEGER), away_player_9 (INTEGER), away_player_10 (INTEGER), away_player_11 (INTEGER), goal (TEXT), shoton (TEXT), shotoff (TEXT), foulcommit (TEXT), card (TEXT), cross (TEXT), corner (TEXT), possession (TEXT), B365H (NUMERIC), B365D (NUMERIC), B365A (NUMERIC), BWH (NUMERIC), BWD (NUMERIC), BWA (NUMERIC), IWH (NUMERIC), IWD (NUMERIC), IWA (NUMERIC), LBH (NUMERIC), LBD (NUMERIC), LBA (NUMERIC), PSH (NUMERIC), PSD (NUMERIC), PSA (NUMERIC), WHH (NUMERIC), WHD (NUMERIC), WHA (NUMERIC), SJH (NUMERIC), SJD (NUMERIC), SJA (NUMERIC), VCH (NUMERIC), VCD (NUMERIC), VCA (NUMERIC), GBH (NUMERIC), GBD (NUMERIC), GBA (NUMERIC), BSH (NUMERIC), BSD (NUMERIC), BSA (NUMERIC)\nLeague: id (INTEGER), country_id (INTEGER), name (TEXT)\nCountry: id (INTEGER), name (TEXT)\nTeam: id (INTEGER), team_api_id (INTEGER), team_fifa_api_id (INTEGER), team_long_name (TEXT), team_short_name (TEXT)\nTeam_Attributes: id (INTEGER), team_fifa_api_id (INTEGER), team_api_id (INTEGER), date (TEXT), buildUpPlaySpeed (INTEGER), buildUpPlaySpeedClass (TEXT), buildUpPlayDribbling (INTEGER), buildUpPlayDribblingClass (TEXT), buildUpPlayPassing (INTEGER), buildUpPlayPassingClass (TEXT), buildUpPlayPositioningClass (TEXT), chanceCreationPassing (INTEGER), chanceCreationPassingClass (TEXT), chanceCreationCrossing (INTEGER), chanceCreationCrossingClass (TEXT), chanceCreationShooting (INTEGER), chanceCreationShootingClass (TEXT), chanceCreationPositioningClass (TEXT), defencePressure (INTEGER), defencePressureClass (TEXT), defenceAggression (INTEGER), defenceAggressionClass (TEXT), defenceTeamWidth (INTEGER), defenceTeamWidthClass (TEXT), defenceDefenderLineClass (TEXT)" }, { "query": "SELECT max(weight) , min(weight) FROM Player", "question": "What is the maximum and minimum height of all players?", "schema": "Player_Attributes: id (INTEGER), player_fifa_api_id (INTEGER), player_api_id (INTEGER), date (TEXT), overall_rating (INTEGER), potential (INTEGER), preferred_foot (TEXT), attacking_work_rate (TEXT), defensive_work_rate (TEXT), crossing (INTEGER), finishing (INTEGER), heading_accuracy (INTEGER), short_passing (INTEGER), volleys (INTEGER), dribbling (INTEGER), curve (INTEGER), free_kick_accuracy (INTEGER), long_passing (INTEGER), ball_control (INTEGER), acceleration (INTEGER), sprint_speed (INTEGER), agility (INTEGER), reactions (INTEGER), balance (INTEGER), shot_power (INTEGER), jumping (INTEGER), stamina (INTEGER), strength (INTEGER), long_shots (INTEGER), aggression (INTEGER), interceptions (INTEGER), positioning (INTEGER), vision (INTEGER), penalties (INTEGER), marking (INTEGER), standing_tackle (INTEGER), sliding_tackle (INTEGER), gk_diving (INTEGER), gk_handling (INTEGER), gk_kicking (INTEGER), gk_positioning (INTEGER), gk_reflexes (INTEGER)\nPlayer: id (INTEGER), player_api_id (INTEGER), player_name (TEXT), player_fifa_api_id (INTEGER), birthday (TEXT), height (INTEGER), weight (INTEGER)\nMatch: id (INTEGER), country_id (INTEGER), league_id (INTEGER), season (TEXT), stage (INTEGER), date (TEXT), match_api_id (INTEGER), home_team_api_id (INTEGER), away_team_api_id (INTEGER), home_team_goal (INTEGER), away_team_goal (INTEGER), home_player_X1 (INTEGER), home_player_X2 (INTEGER), home_player_X3 (INTEGER), home_player_X4 (INTEGER), home_player_X5 (INTEGER), home_player_X6 (INTEGER), home_player_X7 (INTEGER), home_player_X8 (INTEGER), home_player_X9 (INTEGER), home_player_X10 (INTEGER), home_player_X11 (INTEGER), away_player_X1 (INTEGER), away_player_X2 (INTEGER), away_player_X3 (INTEGER), away_player_X4 (INTEGER), away_player_X5 (INTEGER), away_player_X6 (INTEGER), away_player_X7 (INTEGER), away_player_X8 (INTEGER), away_player_X9 (INTEGER), away_player_X10 (INTEGER), away_player_X11 (INTEGER), home_player_Y1 (INTEGER), home_player_Y2 (INTEGER), home_player_Y3 (INTEGER), home_player_Y4 (INTEGER), home_player_Y5 (INTEGER), home_player_Y6 (INTEGER), home_player_Y7 (INTEGER), home_player_Y8 (INTEGER), home_player_Y9 (INTEGER), home_player_Y10 (INTEGER), home_player_Y11 (INTEGER), away_player_Y1 (INTEGER), away_player_Y2 (INTEGER), away_player_Y3 (INTEGER), away_player_Y4 (INTEGER), away_player_Y5 (INTEGER), away_player_Y6 (INTEGER), away_player_Y7 (INTEGER), away_player_Y8 (INTEGER), away_player_Y9 (INTEGER), away_player_Y10 (INTEGER), away_player_Y11 (INTEGER), home_player_1 (INTEGER), home_player_2 (INTEGER), home_player_3 (INTEGER), home_player_4 (INTEGER), home_player_5 (INTEGER), home_player_6 (INTEGER), home_player_7 (INTEGER), home_player_8 (INTEGER), home_player_9 (INTEGER), home_player_10 (INTEGER), home_player_11 (INTEGER), away_player_1 (INTEGER), away_player_2 (INTEGER), away_player_3 (INTEGER), away_player_4 (INTEGER), away_player_5 (INTEGER), away_player_6 (INTEGER), away_player_7 (INTEGER), away_player_8 (INTEGER), away_player_9 (INTEGER), away_player_10 (INTEGER), away_player_11 (INTEGER), goal (TEXT), shoton (TEXT), shotoff (TEXT), foulcommit (TEXT), card (TEXT), cross (TEXT), corner (TEXT), possession (TEXT), B365H (NUMERIC), B365D (NUMERIC), B365A (NUMERIC), BWH (NUMERIC), BWD (NUMERIC), BWA (NUMERIC), IWH (NUMERIC), IWD (NUMERIC), IWA (NUMERIC), LBH (NUMERIC), LBD (NUMERIC), LBA (NUMERIC), PSH (NUMERIC), PSD (NUMERIC), PSA (NUMERIC), WHH (NUMERIC), WHD (NUMERIC), WHA (NUMERIC), SJH (NUMERIC), SJD (NUMERIC), SJA (NUMERIC), VCH (NUMERIC), VCD (NUMERIC), VCA (NUMERIC), GBH (NUMERIC), GBD (NUMERIC), GBA (NUMERIC), BSH (NUMERIC), BSD (NUMERIC), BSA (NUMERIC)\nLeague: id (INTEGER), country_id (INTEGER), name (TEXT)\nCountry: id (INTEGER), name (TEXT)\nTeam: id (INTEGER), team_api_id (INTEGER), team_fifa_api_id (INTEGER), team_long_name (TEXT), team_short_name (TEXT)\nTeam_Attributes: id (INTEGER), team_fifa_api_id (INTEGER), team_api_id (INTEGER), date (TEXT), buildUpPlaySpeed (INTEGER), buildUpPlaySpeedClass (TEXT), buildUpPlayDribbling (INTEGER), buildUpPlayDribblingClass (TEXT), buildUpPlayPassing (INTEGER), buildUpPlayPassingClass (TEXT), buildUpPlayPositioningClass (TEXT), chanceCreationPassing (INTEGER), chanceCreationPassingClass (TEXT), chanceCreationCrossing (INTEGER), chanceCreationCrossingClass (TEXT), chanceCreationShooting (INTEGER), chanceCreationShootingClass (TEXT), chanceCreationPositioningClass (TEXT), defencePressure (INTEGER), defencePressureClass (TEXT), defenceAggression (INTEGER), defenceAggressionClass (TEXT), defenceTeamWidth (INTEGER), defenceTeamWidthClass (TEXT), defenceDefenderLineClass (TEXT)" }, { "query": "SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.overall_rating > ( SELECT avg(overall_rating) FROM Player_Attributes )", "question": "List all player names who have an overall rating higher than the average.", "schema": "Player_Attributes: id (INTEGER), player_fifa_api_id (INTEGER), player_api_id (INTEGER), date (TEXT), overall_rating (INTEGER), potential (INTEGER), preferred_foot (TEXT), attacking_work_rate (TEXT), defensive_work_rate (TEXT), crossing (INTEGER), finishing (INTEGER), heading_accuracy (INTEGER), short_passing (INTEGER), volleys (INTEGER), dribbling (INTEGER), curve (INTEGER), free_kick_accuracy (INTEGER), long_passing (INTEGER), ball_control (INTEGER), acceleration (INTEGER), sprint_speed (INTEGER), agility (INTEGER), reactions (INTEGER), balance (INTEGER), shot_power (INTEGER), jumping (INTEGER), stamina (INTEGER), strength (INTEGER), long_shots (INTEGER), aggression (INTEGER), interceptions (INTEGER), positioning (INTEGER), vision (INTEGER), penalties (INTEGER), marking (INTEGER), standing_tackle (INTEGER), sliding_tackle (INTEGER), gk_diving (INTEGER), gk_handling (INTEGER), gk_kicking (INTEGER), gk_positioning (INTEGER), gk_reflexes (INTEGER)\nPlayer: id (INTEGER), player_api_id (INTEGER), player_name (TEXT), player_fifa_api_id (INTEGER), birthday (TEXT), height (INTEGER), weight (INTEGER)\nMatch: id (INTEGER), country_id (INTEGER), league_id (INTEGER), season (TEXT), stage (INTEGER), date (TEXT), match_api_id (INTEGER), home_team_api_id (INTEGER), away_team_api_id (INTEGER), home_team_goal (INTEGER), away_team_goal (INTEGER), home_player_X1 (INTEGER), home_player_X2 (INTEGER), home_player_X3 (INTEGER), home_player_X4 (INTEGER), home_player_X5 (INTEGER), home_player_X6 (INTEGER), home_player_X7 (INTEGER), home_player_X8 (INTEGER), home_player_X9 (INTEGER), home_player_X10 (INTEGER), home_player_X11 (INTEGER), away_player_X1 (INTEGER), away_player_X2 (INTEGER), away_player_X3 (INTEGER), away_player_X4 (INTEGER), away_player_X5 (INTEGER), away_player_X6 (INTEGER), away_player_X7 (INTEGER), away_player_X8 (INTEGER), away_player_X9 (INTEGER), away_player_X10 (INTEGER), away_player_X11 (INTEGER), home_player_Y1 (INTEGER), home_player_Y2 (INTEGER), home_player_Y3 (INTEGER), home_player_Y4 (INTEGER), home_player_Y5 (INTEGER), home_player_Y6 (INTEGER), home_player_Y7 (INTEGER), home_player_Y8 (INTEGER), home_player_Y9 (INTEGER), home_player_Y10 (INTEGER), home_player_Y11 (INTEGER), away_player_Y1 (INTEGER), away_player_Y2 (INTEGER), away_player_Y3 (INTEGER), away_player_Y4 (INTEGER), away_player_Y5 (INTEGER), away_player_Y6 (INTEGER), away_player_Y7 (INTEGER), away_player_Y8 (INTEGER), away_player_Y9 (INTEGER), away_player_Y10 (INTEGER), away_player_Y11 (INTEGER), home_player_1 (INTEGER), home_player_2 (INTEGER), home_player_3 (INTEGER), home_player_4 (INTEGER), home_player_5 (INTEGER), home_player_6 (INTEGER), home_player_7 (INTEGER), home_player_8 (INTEGER), home_player_9 (INTEGER), home_player_10 (INTEGER), home_player_11 (INTEGER), away_player_1 (INTEGER), away_player_2 (INTEGER), away_player_3 (INTEGER), away_player_4 (INTEGER), away_player_5 (INTEGER), away_player_6 (INTEGER), away_player_7 (INTEGER), away_player_8 (INTEGER), away_player_9 (INTEGER), away_player_10 (INTEGER), away_player_11 (INTEGER), goal (TEXT), shoton (TEXT), shotoff (TEXT), foulcommit (TEXT), card (TEXT), cross (TEXT), corner (TEXT), possession (TEXT), B365H (NUMERIC), B365D (NUMERIC), B365A (NUMERIC), BWH (NUMERIC), BWD (NUMERIC), BWA (NUMERIC), IWH (NUMERIC), IWD (NUMERIC), IWA (NUMERIC), LBH (NUMERIC), LBD (NUMERIC), LBA (NUMERIC), PSH (NUMERIC), PSD (NUMERIC), PSA (NUMERIC), WHH (NUMERIC), WHD (NUMERIC), WHA (NUMERIC), SJH (NUMERIC), SJD (NUMERIC), SJA (NUMERIC), VCH (NUMERIC), VCD (NUMERIC), VCA (NUMERIC), GBH (NUMERIC), GBD (NUMERIC), GBA (NUMERIC), BSH (NUMERIC), BSD (NUMERIC), BSA (NUMERIC)\nLeague: id (INTEGER), country_id (INTEGER), name (TEXT)\nCountry: id (INTEGER), name (TEXT)\nTeam: id (INTEGER), team_api_id (INTEGER), team_fifa_api_id (INTEGER), team_long_name (TEXT), team_short_name (TEXT)\nTeam_Attributes: id (INTEGER), team_fifa_api_id (INTEGER), team_api_id (INTEGER), date (TEXT), buildUpPlaySpeed (INTEGER), buildUpPlaySpeedClass (TEXT), buildUpPlayDribbling (INTEGER), buildUpPlayDribblingClass (TEXT), buildUpPlayPassing (INTEGER), buildUpPlayPassingClass (TEXT), buildUpPlayPositioningClass (TEXT), chanceCreationPassing (INTEGER), chanceCreationPassingClass (TEXT), chanceCreationCrossing (INTEGER), chanceCreationCrossingClass (TEXT), chanceCreationShooting (INTEGER), chanceCreationShootingClass (TEXT), chanceCreationPositioningClass (TEXT), defencePressure (INTEGER), defencePressureClass (TEXT), defenceAggression (INTEGER), defenceAggressionClass (TEXT), defenceTeamWidth (INTEGER), defenceTeamWidthClass (TEXT), defenceDefenderLineClass (TEXT)" }, { "query": "SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.dribbling = ( SELECT max(overall_rating) FROM Player_Attributes)", "question": "What are the names of players who have the best dribbling?", "schema": "Player_Attributes: id (INTEGER), player_fifa_api_id (INTEGER), player_api_id (INTEGER), date (TEXT), overall_rating (INTEGER), potential (INTEGER), preferred_foot (TEXT), attacking_work_rate (TEXT), defensive_work_rate (TEXT), crossing (INTEGER), finishing (INTEGER), heading_accuracy (INTEGER), short_passing (INTEGER), volleys (INTEGER), dribbling (INTEGER), curve (INTEGER), free_kick_accuracy (INTEGER), long_passing (INTEGER), ball_control (INTEGER), acceleration (INTEGER), sprint_speed (INTEGER), agility (INTEGER), reactions (INTEGER), balance (INTEGER), shot_power (INTEGER), jumping (INTEGER), stamina (INTEGER), strength (INTEGER), long_shots (INTEGER), aggression (INTEGER), interceptions (INTEGER), positioning (INTEGER), vision (INTEGER), penalties (INTEGER), marking (INTEGER), standing_tackle (INTEGER), sliding_tackle (INTEGER), gk_diving (INTEGER), gk_handling (INTEGER), gk_kicking (INTEGER), gk_positioning (INTEGER), gk_reflexes (INTEGER)\nPlayer: id (INTEGER), player_api_id (INTEGER), player_name (TEXT), player_fifa_api_id (INTEGER), birthday (TEXT), height (INTEGER), weight (INTEGER)\nMatch: id (INTEGER), country_id (INTEGER), league_id (INTEGER), season (TEXT), stage (INTEGER), date (TEXT), match_api_id (INTEGER), home_team_api_id (INTEGER), away_team_api_id (INTEGER), home_team_goal (INTEGER), away_team_goal (INTEGER), home_player_X1 (INTEGER), home_player_X2 (INTEGER), home_player_X3 (INTEGER), home_player_X4 (INTEGER), home_player_X5 (INTEGER), home_player_X6 (INTEGER), home_player_X7 (INTEGER), home_player_X8 (INTEGER), home_player_X9 (INTEGER), home_player_X10 (INTEGER), home_player_X11 (INTEGER), away_player_X1 (INTEGER), away_player_X2 (INTEGER), away_player_X3 (INTEGER), away_player_X4 (INTEGER), away_player_X5 (INTEGER), away_player_X6 (INTEGER), away_player_X7 (INTEGER), away_player_X8 (INTEGER), away_player_X9 (INTEGER), away_player_X10 (INTEGER), away_player_X11 (INTEGER), home_player_Y1 (INTEGER), home_player_Y2 (INTEGER), home_player_Y3 (INTEGER), home_player_Y4 (INTEGER), home_player_Y5 (INTEGER), home_player_Y6 (INTEGER), home_player_Y7 (INTEGER), home_player_Y8 (INTEGER), home_player_Y9 (INTEGER), home_player_Y10 (INTEGER), home_player_Y11 (INTEGER), away_player_Y1 (INTEGER), away_player_Y2 (INTEGER), away_player_Y3 (INTEGER), away_player_Y4 (INTEGER), away_player_Y5 (INTEGER), away_player_Y6 (INTEGER), away_player_Y7 (INTEGER), away_player_Y8 (INTEGER), away_player_Y9 (INTEGER), away_player_Y10 (INTEGER), away_player_Y11 (INTEGER), home_player_1 (INTEGER), home_player_2 (INTEGER), home_player_3 (INTEGER), home_player_4 (INTEGER), home_player_5 (INTEGER), home_player_6 (INTEGER), home_player_7 (INTEGER), home_player_8 (INTEGER), home_player_9 (INTEGER), home_player_10 (INTEGER), home_player_11 (INTEGER), away_player_1 (INTEGER), away_player_2 (INTEGER), away_player_3 (INTEGER), away_player_4 (INTEGER), away_player_5 (INTEGER), away_player_6 (INTEGER), away_player_7 (INTEGER), away_player_8 (INTEGER), away_player_9 (INTEGER), away_player_10 (INTEGER), away_player_11 (INTEGER), goal (TEXT), shoton (TEXT), shotoff (TEXT), foulcommit (TEXT), card (TEXT), cross (TEXT), corner (TEXT), possession (TEXT), B365H (NUMERIC), B365D (NUMERIC), B365A (NUMERIC), BWH (NUMERIC), BWD (NUMERIC), BWA (NUMERIC), IWH (NUMERIC), IWD (NUMERIC), IWA (NUMERIC), LBH (NUMERIC), LBD (NUMERIC), LBA (NUMERIC), PSH (NUMERIC), PSD (NUMERIC), PSA (NUMERIC), WHH (NUMERIC), WHD (NUMERIC), WHA (NUMERIC), SJH (NUMERIC), SJD (NUMERIC), SJA (NUMERIC), VCH (NUMERIC), VCD (NUMERIC), VCA (NUMERIC), GBH (NUMERIC), GBD (NUMERIC), GBA (NUMERIC), BSH (NUMERIC), BSD (NUMERIC), BSA (NUMERIC)\nLeague: id (INTEGER), country_id (INTEGER), name (TEXT)\nCountry: id (INTEGER), name (TEXT)\nTeam: id (INTEGER), team_api_id (INTEGER), team_fifa_api_id (INTEGER), team_long_name (TEXT), team_short_name (TEXT)\nTeam_Attributes: id (INTEGER), team_fifa_api_id (INTEGER), team_api_id (INTEGER), date (TEXT), buildUpPlaySpeed (INTEGER), buildUpPlaySpeedClass (TEXT), buildUpPlayDribbling (INTEGER), buildUpPlayDribblingClass (TEXT), buildUpPlayPassing (INTEGER), buildUpPlayPassingClass (TEXT), buildUpPlayPositioningClass (TEXT), chanceCreationPassing (INTEGER), chanceCreationPassingClass (TEXT), chanceCreationCrossing (INTEGER), chanceCreationCrossingClass (TEXT), chanceCreationShooting (INTEGER), chanceCreationShootingClass (TEXT), chanceCreationPositioningClass (TEXT), defencePressure (INTEGER), defencePressureClass (TEXT), defenceAggression (INTEGER), defenceAggressionClass (TEXT), defenceTeamWidth (INTEGER), defenceTeamWidthClass (TEXT), defenceDefenderLineClass (TEXT)" }, { "query": "SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.crossing > 90 AND T2.preferred_foot = \"right\"", "question": "List the names of all players who have a crossing score higher than 90 and prefer their right foot.", "schema": "Player_Attributes: id (INTEGER), player_fifa_api_id (INTEGER), player_api_id (INTEGER), date (TEXT), overall_rating (INTEGER), potential (INTEGER), preferred_foot (TEXT), attacking_work_rate (TEXT), defensive_work_rate (TEXT), crossing (INTEGER), finishing (INTEGER), heading_accuracy (INTEGER), short_passing (INTEGER), volleys (INTEGER), dribbling (INTEGER), curve (INTEGER), free_kick_accuracy (INTEGER), long_passing (INTEGER), ball_control (INTEGER), acceleration (INTEGER), sprint_speed (INTEGER), agility (INTEGER), reactions (INTEGER), balance (INTEGER), shot_power (INTEGER), jumping (INTEGER), stamina (INTEGER), strength (INTEGER), long_shots (INTEGER), aggression (INTEGER), interceptions (INTEGER), positioning (INTEGER), vision (INTEGER), penalties (INTEGER), marking (INTEGER), standing_tackle (INTEGER), sliding_tackle (INTEGER), gk_diving (INTEGER), gk_handling (INTEGER), gk_kicking (INTEGER), gk_positioning (INTEGER), gk_reflexes (INTEGER)\nPlayer: id (INTEGER), player_api_id (INTEGER), player_name (TEXT), player_fifa_api_id (INTEGER), birthday (TEXT), height (INTEGER), weight (INTEGER)\nMatch: id (INTEGER), country_id (INTEGER), league_id (INTEGER), season (TEXT), stage (INTEGER), date (TEXT), match_api_id (INTEGER), home_team_api_id (INTEGER), away_team_api_id (INTEGER), home_team_goal (INTEGER), away_team_goal (INTEGER), home_player_X1 (INTEGER), home_player_X2 (INTEGER), home_player_X3 (INTEGER), home_player_X4 (INTEGER), home_player_X5 (INTEGER), home_player_X6 (INTEGER), home_player_X7 (INTEGER), home_player_X8 (INTEGER), home_player_X9 (INTEGER), home_player_X10 (INTEGER), home_player_X11 (INTEGER), away_player_X1 (INTEGER), away_player_X2 (INTEGER), away_player_X3 (INTEGER), away_player_X4 (INTEGER), away_player_X5 (INTEGER), away_player_X6 (INTEGER), away_player_X7 (INTEGER), away_player_X8 (INTEGER), away_player_X9 (INTEGER), away_player_X10 (INTEGER), away_player_X11 (INTEGER), home_player_Y1 (INTEGER), home_player_Y2 (INTEGER), home_player_Y3 (INTEGER), home_player_Y4 (INTEGER), home_player_Y5 (INTEGER), home_player_Y6 (INTEGER), home_player_Y7 (INTEGER), home_player_Y8 (INTEGER), home_player_Y9 (INTEGER), home_player_Y10 (INTEGER), home_player_Y11 (INTEGER), away_player_Y1 (INTEGER), away_player_Y2 (INTEGER), away_player_Y3 (INTEGER), away_player_Y4 (INTEGER), away_player_Y5 (INTEGER), away_player_Y6 (INTEGER), away_player_Y7 (INTEGER), away_player_Y8 (INTEGER), away_player_Y9 (INTEGER), away_player_Y10 (INTEGER), away_player_Y11 (INTEGER), home_player_1 (INTEGER), home_player_2 (INTEGER), home_player_3 (INTEGER), home_player_4 (INTEGER), home_player_5 (INTEGER), home_player_6 (INTEGER), home_player_7 (INTEGER), home_player_8 (INTEGER), home_player_9 (INTEGER), home_player_10 (INTEGER), home_player_11 (INTEGER), away_player_1 (INTEGER), away_player_2 (INTEGER), away_player_3 (INTEGER), away_player_4 (INTEGER), away_player_5 (INTEGER), away_player_6 (INTEGER), away_player_7 (INTEGER), away_player_8 (INTEGER), away_player_9 (INTEGER), away_player_10 (INTEGER), away_player_11 (INTEGER), goal (TEXT), shoton (TEXT), shotoff (TEXT), foulcommit (TEXT), card (TEXT), cross (TEXT), corner (TEXT), possession (TEXT), B365H (NUMERIC), B365D (NUMERIC), B365A (NUMERIC), BWH (NUMERIC), BWD (NUMERIC), BWA (NUMERIC), IWH (NUMERIC), IWD (NUMERIC), IWA (NUMERIC), LBH (NUMERIC), LBD (NUMERIC), LBA (NUMERIC), PSH (NUMERIC), PSD (NUMERIC), PSA (NUMERIC), WHH (NUMERIC), WHD (NUMERIC), WHA (NUMERIC), SJH (NUMERIC), SJD (NUMERIC), SJA (NUMERIC), VCH (NUMERIC), VCD (NUMERIC), VCA (NUMERIC), GBH (NUMERIC), GBD (NUMERIC), GBA (NUMERIC), BSH (NUMERIC), BSD (NUMERIC), BSA (NUMERIC)\nLeague: id (INTEGER), country_id (INTEGER), name (TEXT)\nCountry: id (INTEGER), name (TEXT)\nTeam: id (INTEGER), team_api_id (INTEGER), team_fifa_api_id (INTEGER), team_long_name (TEXT), team_short_name (TEXT)\nTeam_Attributes: id (INTEGER), team_fifa_api_id (INTEGER), team_api_id (INTEGER), date (TEXT), buildUpPlaySpeed (INTEGER), buildUpPlaySpeedClass (TEXT), buildUpPlayDribbling (INTEGER), buildUpPlayDribblingClass (TEXT), buildUpPlayPassing (INTEGER), buildUpPlayPassingClass (TEXT), buildUpPlayPositioningClass (TEXT), chanceCreationPassing (INTEGER), chanceCreationPassingClass (TEXT), chanceCreationCrossing (INTEGER), chanceCreationCrossingClass (TEXT), chanceCreationShooting (INTEGER), chanceCreationShootingClass (TEXT), chanceCreationPositioningClass (TEXT), defencePressure (INTEGER), defencePressureClass (TEXT), defenceAggression (INTEGER), defenceAggressionClass (TEXT), defenceTeamWidth (INTEGER), defenceTeamWidthClass (TEXT), defenceDefenderLineClass (TEXT)" }, { "query": "SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.preferred_foot = \"left\" AND T2.overall_rating >= 85 AND T2.overall_rating <= 90", "question": "List the names of all left-footed players who have overall rating between 85 and 90.", "schema": "Player_Attributes: id (INTEGER), player_fifa_api_id (INTEGER), player_api_id (INTEGER), date (TEXT), overall_rating (INTEGER), potential (INTEGER), preferred_foot (TEXT), attacking_work_rate (TEXT), defensive_work_rate (TEXT), crossing (INTEGER), finishing (INTEGER), heading_accuracy (INTEGER), short_passing (INTEGER), volleys (INTEGER), dribbling (INTEGER), curve (INTEGER), free_kick_accuracy (INTEGER), long_passing (INTEGER), ball_control (INTEGER), acceleration (INTEGER), sprint_speed (INTEGER), agility (INTEGER), reactions (INTEGER), balance (INTEGER), shot_power (INTEGER), jumping (INTEGER), stamina (INTEGER), strength (INTEGER), long_shots (INTEGER), aggression (INTEGER), interceptions (INTEGER), positioning (INTEGER), vision (INTEGER), penalties (INTEGER), marking (INTEGER), standing_tackle (INTEGER), sliding_tackle (INTEGER), gk_diving (INTEGER), gk_handling (INTEGER), gk_kicking (INTEGER), gk_positioning (INTEGER), gk_reflexes (INTEGER)\nPlayer: id (INTEGER), player_api_id (INTEGER), player_name (TEXT), player_fifa_api_id (INTEGER), birthday (TEXT), height (INTEGER), weight (INTEGER)\nMatch: id (INTEGER), country_id (INTEGER), league_id (INTEGER), season (TEXT), stage (INTEGER), date (TEXT), match_api_id (INTEGER), home_team_api_id (INTEGER), away_team_api_id (INTEGER), home_team_goal (INTEGER), away_team_goal (INTEGER), home_player_X1 (INTEGER), home_player_X2 (INTEGER), home_player_X3 (INTEGER), home_player_X4 (INTEGER), home_player_X5 (INTEGER), home_player_X6 (INTEGER), home_player_X7 (INTEGER), home_player_X8 (INTEGER), home_player_X9 (INTEGER), home_player_X10 (INTEGER), home_player_X11 (INTEGER), away_player_X1 (INTEGER), away_player_X2 (INTEGER), away_player_X3 (INTEGER), away_player_X4 (INTEGER), away_player_X5 (INTEGER), away_player_X6 (INTEGER), away_player_X7 (INTEGER), away_player_X8 (INTEGER), away_player_X9 (INTEGER), away_player_X10 (INTEGER), away_player_X11 (INTEGER), home_player_Y1 (INTEGER), home_player_Y2 (INTEGER), home_player_Y3 (INTEGER), home_player_Y4 (INTEGER), home_player_Y5 (INTEGER), home_player_Y6 (INTEGER), home_player_Y7 (INTEGER), home_player_Y8 (INTEGER), home_player_Y9 (INTEGER), home_player_Y10 (INTEGER), home_player_Y11 (INTEGER), away_player_Y1 (INTEGER), away_player_Y2 (INTEGER), away_player_Y3 (INTEGER), away_player_Y4 (INTEGER), away_player_Y5 (INTEGER), away_player_Y6 (INTEGER), away_player_Y7 (INTEGER), away_player_Y8 (INTEGER), away_player_Y9 (INTEGER), away_player_Y10 (INTEGER), away_player_Y11 (INTEGER), home_player_1 (INTEGER), home_player_2 (INTEGER), home_player_3 (INTEGER), home_player_4 (INTEGER), home_player_5 (INTEGER), home_player_6 (INTEGER), home_player_7 (INTEGER), home_player_8 (INTEGER), home_player_9 (INTEGER), home_player_10 (INTEGER), home_player_11 (INTEGER), away_player_1 (INTEGER), away_player_2 (INTEGER), away_player_3 (INTEGER), away_player_4 (INTEGER), away_player_5 (INTEGER), away_player_6 (INTEGER), away_player_7 (INTEGER), away_player_8 (INTEGER), away_player_9 (INTEGER), away_player_10 (INTEGER), away_player_11 (INTEGER), goal (TEXT), shoton (TEXT), shotoff (TEXT), foulcommit (TEXT), card (TEXT), cross (TEXT), corner (TEXT), possession (TEXT), B365H (NUMERIC), B365D (NUMERIC), B365A (NUMERIC), BWH (NUMERIC), BWD (NUMERIC), BWA (NUMERIC), IWH (NUMERIC), IWD (NUMERIC), IWA (NUMERIC), LBH (NUMERIC), LBD (NUMERIC), LBA (NUMERIC), PSH (NUMERIC), PSD (NUMERIC), PSA (NUMERIC), WHH (NUMERIC), WHD (NUMERIC), WHA (NUMERIC), SJH (NUMERIC), SJD (NUMERIC), SJA (NUMERIC), VCH (NUMERIC), VCD (NUMERIC), VCA (NUMERIC), GBH (NUMERIC), GBD (NUMERIC), GBA (NUMERIC), BSH (NUMERIC), BSD (NUMERIC), BSA (NUMERIC)\nLeague: id (INTEGER), country_id (INTEGER), name (TEXT)\nCountry: id (INTEGER), name (TEXT)\nTeam: id (INTEGER), team_api_id (INTEGER), team_fifa_api_id (INTEGER), team_long_name (TEXT), team_short_name (TEXT)\nTeam_Attributes: id (INTEGER), team_fifa_api_id (INTEGER), team_api_id (INTEGER), date (TEXT), buildUpPlaySpeed (INTEGER), buildUpPlaySpeedClass (TEXT), buildUpPlayDribbling (INTEGER), buildUpPlayDribblingClass (TEXT), buildUpPlayPassing (INTEGER), buildUpPlayPassingClass (TEXT), buildUpPlayPositioningClass (TEXT), chanceCreationPassing (INTEGER), chanceCreationPassingClass (TEXT), chanceCreationCrossing (INTEGER), chanceCreationCrossingClass (TEXT), chanceCreationShooting (INTEGER), chanceCreationShootingClass (TEXT), chanceCreationPositioningClass (TEXT), defencePressure (INTEGER), defencePressureClass (TEXT), defenceAggression (INTEGER), defenceAggressionClass (TEXT), defenceTeamWidth (INTEGER), defenceTeamWidthClass (TEXT), defenceDefenderLineClass (TEXT)" }, { "query": "SELECT preferred_foot , avg(overall_rating) FROM Player_Attributes GROUP BY preferred_foot", "question": "What is the average rating for right-footed players and left-footed players?", "schema": "Player_Attributes: id (INTEGER), player_fifa_api_id (INTEGER), player_api_id (INTEGER), date (TEXT), overall_rating (INTEGER), potential (INTEGER), preferred_foot (TEXT), attacking_work_rate (TEXT), defensive_work_rate (TEXT), crossing (INTEGER), finishing (INTEGER), heading_accuracy (INTEGER), short_passing (INTEGER), volleys (INTEGER), dribbling (INTEGER), curve (INTEGER), free_kick_accuracy (INTEGER), long_passing (INTEGER), ball_control (INTEGER), acceleration (INTEGER), sprint_speed (INTEGER), agility (INTEGER), reactions (INTEGER), balance (INTEGER), shot_power (INTEGER), jumping (INTEGER), stamina (INTEGER), strength (INTEGER), long_shots (INTEGER), aggression (INTEGER), interceptions (INTEGER), positioning (INTEGER), vision (INTEGER), penalties (INTEGER), marking (INTEGER), standing_tackle (INTEGER), sliding_tackle (INTEGER), gk_diving (INTEGER), gk_handling (INTEGER), gk_kicking (INTEGER), gk_positioning (INTEGER), gk_reflexes (INTEGER)\nPlayer: id (INTEGER), player_api_id (INTEGER), player_name (TEXT), player_fifa_api_id (INTEGER), birthday (TEXT), height (INTEGER), weight (INTEGER)\nMatch: id (INTEGER), country_id (INTEGER), league_id (INTEGER), season (TEXT), stage (INTEGER), date (TEXT), match_api_id (INTEGER), home_team_api_id (INTEGER), away_team_api_id (INTEGER), home_team_goal (INTEGER), away_team_goal (INTEGER), home_player_X1 (INTEGER), home_player_X2 (INTEGER), home_player_X3 (INTEGER), home_player_X4 (INTEGER), home_player_X5 (INTEGER), home_player_X6 (INTEGER), home_player_X7 (INTEGER), home_player_X8 (INTEGER), home_player_X9 (INTEGER), home_player_X10 (INTEGER), home_player_X11 (INTEGER), away_player_X1 (INTEGER), away_player_X2 (INTEGER), away_player_X3 (INTEGER), away_player_X4 (INTEGER), away_player_X5 (INTEGER), away_player_X6 (INTEGER), away_player_X7 (INTEGER), away_player_X8 (INTEGER), away_player_X9 (INTEGER), away_player_X10 (INTEGER), away_player_X11 (INTEGER), home_player_Y1 (INTEGER), home_player_Y2 (INTEGER), home_player_Y3 (INTEGER), home_player_Y4 (INTEGER), home_player_Y5 (INTEGER), home_player_Y6 (INTEGER), home_player_Y7 (INTEGER), home_player_Y8 (INTEGER), home_player_Y9 (INTEGER), home_player_Y10 (INTEGER), home_player_Y11 (INTEGER), away_player_Y1 (INTEGER), away_player_Y2 (INTEGER), away_player_Y3 (INTEGER), away_player_Y4 (INTEGER), away_player_Y5 (INTEGER), away_player_Y6 (INTEGER), away_player_Y7 (INTEGER), away_player_Y8 (INTEGER), away_player_Y9 (INTEGER), away_player_Y10 (INTEGER), away_player_Y11 (INTEGER), home_player_1 (INTEGER), home_player_2 (INTEGER), home_player_3 (INTEGER), home_player_4 (INTEGER), home_player_5 (INTEGER), home_player_6 (INTEGER), home_player_7 (INTEGER), home_player_8 (INTEGER), home_player_9 (INTEGER), home_player_10 (INTEGER), home_player_11 (INTEGER), away_player_1 (INTEGER), away_player_2 (INTEGER), away_player_3 (INTEGER), away_player_4 (INTEGER), away_player_5 (INTEGER), away_player_6 (INTEGER), away_player_7 (INTEGER), away_player_8 (INTEGER), away_player_9 (INTEGER), away_player_10 (INTEGER), away_player_11 (INTEGER), goal (TEXT), shoton (TEXT), shotoff (TEXT), foulcommit (TEXT), card (TEXT), cross (TEXT), corner (TEXT), possession (TEXT), B365H (NUMERIC), B365D (NUMERIC), B365A (NUMERIC), BWH (NUMERIC), BWD (NUMERIC), BWA (NUMERIC), IWH (NUMERIC), IWD (NUMERIC), IWA (NUMERIC), LBH (NUMERIC), LBD (NUMERIC), LBA (NUMERIC), PSH (NUMERIC), PSD (NUMERIC), PSA (NUMERIC), WHH (NUMERIC), WHD (NUMERIC), WHA (NUMERIC), SJH (NUMERIC), SJD (NUMERIC), SJA (NUMERIC), VCH (NUMERIC), VCD (NUMERIC), VCA (NUMERIC), GBH (NUMERIC), GBD (NUMERIC), GBA (NUMERIC), BSH (NUMERIC), BSD (NUMERIC), BSA (NUMERIC)\nLeague: id (INTEGER), country_id (INTEGER), name (TEXT)\nCountry: id (INTEGER), name (TEXT)\nTeam: id (INTEGER), team_api_id (INTEGER), team_fifa_api_id (INTEGER), team_long_name (TEXT), team_short_name (TEXT)\nTeam_Attributes: id (INTEGER), team_fifa_api_id (INTEGER), team_api_id (INTEGER), date (TEXT), buildUpPlaySpeed (INTEGER), buildUpPlaySpeedClass (TEXT), buildUpPlayDribbling (INTEGER), buildUpPlayDribblingClass (TEXT), buildUpPlayPassing (INTEGER), buildUpPlayPassingClass (TEXT), buildUpPlayPositioningClass (TEXT), chanceCreationPassing (INTEGER), chanceCreationPassingClass (TEXT), chanceCreationCrossing (INTEGER), chanceCreationCrossingClass (TEXT), chanceCreationShooting (INTEGER), chanceCreationShootingClass (TEXT), chanceCreationPositioningClass (TEXT), defencePressure (INTEGER), defencePressureClass (TEXT), defenceAggression (INTEGER), defenceAggressionClass (TEXT), defenceTeamWidth (INTEGER), defenceTeamWidthClass (TEXT), defenceDefenderLineClass (TEXT)" }, { "query": "SELECT preferred_foot , count(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot", "question": "Of all players with an overall rating greater than 80, how many are right-footed and left-footed?", "schema": "Player_Attributes: id (INTEGER), player_fifa_api_id (INTEGER), player_api_id (INTEGER), date (TEXT), overall_rating (INTEGER), potential (INTEGER), preferred_foot (TEXT), attacking_work_rate (TEXT), defensive_work_rate (TEXT), crossing (INTEGER), finishing (INTEGER), heading_accuracy (INTEGER), short_passing (INTEGER), volleys (INTEGER), dribbling (INTEGER), curve (INTEGER), free_kick_accuracy (INTEGER), long_passing (INTEGER), ball_control (INTEGER), acceleration (INTEGER), sprint_speed (INTEGER), agility (INTEGER), reactions (INTEGER), balance (INTEGER), shot_power (INTEGER), jumping (INTEGER), stamina (INTEGER), strength (INTEGER), long_shots (INTEGER), aggression (INTEGER), interceptions (INTEGER), positioning (INTEGER), vision (INTEGER), penalties (INTEGER), marking (INTEGER), standing_tackle (INTEGER), sliding_tackle (INTEGER), gk_diving (INTEGER), gk_handling (INTEGER), gk_kicking (INTEGER), gk_positioning (INTEGER), gk_reflexes (INTEGER)\nPlayer: id (INTEGER), player_api_id (INTEGER), player_name (TEXT), player_fifa_api_id (INTEGER), birthday (TEXT), height (INTEGER), weight (INTEGER)\nMatch: id (INTEGER), country_id (INTEGER), league_id (INTEGER), season (TEXT), stage (INTEGER), date (TEXT), match_api_id (INTEGER), home_team_api_id (INTEGER), away_team_api_id (INTEGER), home_team_goal (INTEGER), away_team_goal (INTEGER), home_player_X1 (INTEGER), home_player_X2 (INTEGER), home_player_X3 (INTEGER), home_player_X4 (INTEGER), home_player_X5 (INTEGER), home_player_X6 (INTEGER), home_player_X7 (INTEGER), home_player_X8 (INTEGER), home_player_X9 (INTEGER), home_player_X10 (INTEGER), home_player_X11 (INTEGER), away_player_X1 (INTEGER), away_player_X2 (INTEGER), away_player_X3 (INTEGER), away_player_X4 (INTEGER), away_player_X5 (INTEGER), away_player_X6 (INTEGER), away_player_X7 (INTEGER), away_player_X8 (INTEGER), away_player_X9 (INTEGER), away_player_X10 (INTEGER), away_player_X11 (INTEGER), home_player_Y1 (INTEGER), home_player_Y2 (INTEGER), home_player_Y3 (INTEGER), home_player_Y4 (INTEGER), home_player_Y5 (INTEGER), home_player_Y6 (INTEGER), home_player_Y7 (INTEGER), home_player_Y8 (INTEGER), home_player_Y9 (INTEGER), home_player_Y10 (INTEGER), home_player_Y11 (INTEGER), away_player_Y1 (INTEGER), away_player_Y2 (INTEGER), away_player_Y3 (INTEGER), away_player_Y4 (INTEGER), away_player_Y5 (INTEGER), away_player_Y6 (INTEGER), away_player_Y7 (INTEGER), away_player_Y8 (INTEGER), away_player_Y9 (INTEGER), away_player_Y10 (INTEGER), away_player_Y11 (INTEGER), home_player_1 (INTEGER), home_player_2 (INTEGER), home_player_3 (INTEGER), home_player_4 (INTEGER), home_player_5 (INTEGER), home_player_6 (INTEGER), home_player_7 (INTEGER), home_player_8 (INTEGER), home_player_9 (INTEGER), home_player_10 (INTEGER), home_player_11 (INTEGER), away_player_1 (INTEGER), away_player_2 (INTEGER), away_player_3 (INTEGER), away_player_4 (INTEGER), away_player_5 (INTEGER), away_player_6 (INTEGER), away_player_7 (INTEGER), away_player_8 (INTEGER), away_player_9 (INTEGER), away_player_10 (INTEGER), away_player_11 (INTEGER), goal (TEXT), shoton (TEXT), shotoff (TEXT), foulcommit (TEXT), card (TEXT), cross (TEXT), corner (TEXT), possession (TEXT), B365H (NUMERIC), B365D (NUMERIC), B365A (NUMERIC), BWH (NUMERIC), BWD (NUMERIC), BWA (NUMERIC), IWH (NUMERIC), IWD (NUMERIC), IWA (NUMERIC), LBH (NUMERIC), LBD (NUMERIC), LBA (NUMERIC), PSH (NUMERIC), PSD (NUMERIC), PSA (NUMERIC), WHH (NUMERIC), WHD (NUMERIC), WHA (NUMERIC), SJH (NUMERIC), SJD (NUMERIC), SJA (NUMERIC), VCH (NUMERIC), VCD (NUMERIC), VCA (NUMERIC), GBH (NUMERIC), GBD (NUMERIC), GBA (NUMERIC), BSH (NUMERIC), BSD (NUMERIC), BSA (NUMERIC)\nLeague: id (INTEGER), country_id (INTEGER), name (TEXT)\nCountry: id (INTEGER), name (TEXT)\nTeam: id (INTEGER), team_api_id (INTEGER), team_fifa_api_id (INTEGER), team_long_name (TEXT), team_short_name (TEXT)\nTeam_Attributes: id (INTEGER), team_fifa_api_id (INTEGER), team_api_id (INTEGER), date (TEXT), buildUpPlaySpeed (INTEGER), buildUpPlaySpeedClass (TEXT), buildUpPlayDribbling (INTEGER), buildUpPlayDribblingClass (TEXT), buildUpPlayPassing (INTEGER), buildUpPlayPassingClass (TEXT), buildUpPlayPositioningClass (TEXT), chanceCreationPassing (INTEGER), chanceCreationPassingClass (TEXT), chanceCreationCrossing (INTEGER), chanceCreationCrossingClass (TEXT), chanceCreationShooting (INTEGER), chanceCreationShootingClass (TEXT), chanceCreationPositioningClass (TEXT), defencePressure (INTEGER), defencePressureClass (TEXT), defenceAggression (INTEGER), defenceAggressionClass (TEXT), defenceTeamWidth (INTEGER), defenceTeamWidthClass (TEXT), defenceDefenderLineClass (TEXT)" }, { "query": "SELECT player_api_id FROM Player WHERE height >= 180 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE overall_rating > 85", "question": "List all of the player ids with a height of at least 180cm and an overall rating higher than 85.", "schema": "Player_Attributes: id (INTEGER), player_fifa_api_id (INTEGER), player_api_id (INTEGER), date (TEXT), overall_rating (INTEGER), potential (INTEGER), preferred_foot (TEXT), attacking_work_rate (TEXT), defensive_work_rate (TEXT), crossing (INTEGER), finishing (INTEGER), heading_accuracy (INTEGER), short_passing (INTEGER), volleys (INTEGER), dribbling (INTEGER), curve (INTEGER), free_kick_accuracy (INTEGER), long_passing (INTEGER), ball_control (INTEGER), acceleration (INTEGER), sprint_speed (INTEGER), agility (INTEGER), reactions (INTEGER), balance (INTEGER), shot_power (INTEGER), jumping (INTEGER), stamina (INTEGER), strength (INTEGER), long_shots (INTEGER), aggression (INTEGER), interceptions (INTEGER), positioning (INTEGER), vision (INTEGER), penalties (INTEGER), marking (INTEGER), standing_tackle (INTEGER), sliding_tackle (INTEGER), gk_diving (INTEGER), gk_handling (INTEGER), gk_kicking (INTEGER), gk_positioning (INTEGER), gk_reflexes (INTEGER)\nPlayer: id (INTEGER), player_api_id (INTEGER), player_name (TEXT), player_fifa_api_id (INTEGER), birthday (TEXT), height (INTEGER), weight (INTEGER)\nMatch: id (INTEGER), country_id (INTEGER), league_id (INTEGER), season (TEXT), stage (INTEGER), date (TEXT), match_api_id (INTEGER), home_team_api_id (INTEGER), away_team_api_id (INTEGER), home_team_goal (INTEGER), away_team_goal (INTEGER), home_player_X1 (INTEGER), home_player_X2 (INTEGER), home_player_X3 (INTEGER), home_player_X4 (INTEGER), home_player_X5 (INTEGER), home_player_X6 (INTEGER), home_player_X7 (INTEGER), home_player_X8 (INTEGER), home_player_X9 (INTEGER), home_player_X10 (INTEGER), home_player_X11 (INTEGER), away_player_X1 (INTEGER), away_player_X2 (INTEGER), away_player_X3 (INTEGER), away_player_X4 (INTEGER), away_player_X5 (INTEGER), away_player_X6 (INTEGER), away_player_X7 (INTEGER), away_player_X8 (INTEGER), away_player_X9 (INTEGER), away_player_X10 (INTEGER), away_player_X11 (INTEGER), home_player_Y1 (INTEGER), home_player_Y2 (INTEGER), home_player_Y3 (INTEGER), home_player_Y4 (INTEGER), home_player_Y5 (INTEGER), home_player_Y6 (INTEGER), home_player_Y7 (INTEGER), home_player_Y8 (INTEGER), home_player_Y9 (INTEGER), home_player_Y10 (INTEGER), home_player_Y11 (INTEGER), away_player_Y1 (INTEGER), away_player_Y2 (INTEGER), away_player_Y3 (INTEGER), away_player_Y4 (INTEGER), away_player_Y5 (INTEGER), away_player_Y6 (INTEGER), away_player_Y7 (INTEGER), away_player_Y8 (INTEGER), away_player_Y9 (INTEGER), away_player_Y10 (INTEGER), away_player_Y11 (INTEGER), home_player_1 (INTEGER), home_player_2 (INTEGER), home_player_3 (INTEGER), home_player_4 (INTEGER), home_player_5 (INTEGER), home_player_6 (INTEGER), home_player_7 (INTEGER), home_player_8 (INTEGER), home_player_9 (INTEGER), home_player_10 (INTEGER), home_player_11 (INTEGER), away_player_1 (INTEGER), away_player_2 (INTEGER), away_player_3 (INTEGER), away_player_4 (INTEGER), away_player_5 (INTEGER), away_player_6 (INTEGER), away_player_7 (INTEGER), away_player_8 (INTEGER), away_player_9 (INTEGER), away_player_10 (INTEGER), away_player_11 (INTEGER), goal (TEXT), shoton (TEXT), shotoff (TEXT), foulcommit (TEXT), card (TEXT), cross (TEXT), corner (TEXT), possession (TEXT), B365H (NUMERIC), B365D (NUMERIC), B365A (NUMERIC), BWH (NUMERIC), BWD (NUMERIC), BWA (NUMERIC), IWH (NUMERIC), IWD (NUMERIC), IWA (NUMERIC), LBH (NUMERIC), LBD (NUMERIC), LBA (NUMERIC), PSH (NUMERIC), PSD (NUMERIC), PSA (NUMERIC), WHH (NUMERIC), WHD (NUMERIC), WHA (NUMERIC), SJH (NUMERIC), SJD (NUMERIC), SJA (NUMERIC), VCH (NUMERIC), VCD (NUMERIC), VCA (NUMERIC), GBH (NUMERIC), GBD (NUMERIC), GBA (NUMERIC), BSH (NUMERIC), BSD (NUMERIC), BSA (NUMERIC)\nLeague: id (INTEGER), country_id (INTEGER), name (TEXT)\nCountry: id (INTEGER), name (TEXT)\nTeam: id (INTEGER), team_api_id (INTEGER), team_fifa_api_id (INTEGER), team_long_name (TEXT), team_short_name (TEXT)\nTeam_Attributes: id (INTEGER), team_fifa_api_id (INTEGER), team_api_id (INTEGER), date (TEXT), buildUpPlaySpeed (INTEGER), buildUpPlaySpeedClass (TEXT), buildUpPlayDribbling (INTEGER), buildUpPlayDribblingClass (TEXT), buildUpPlayPassing (INTEGER), buildUpPlayPassingClass (TEXT), buildUpPlayPositioningClass (TEXT), chanceCreationPassing (INTEGER), chanceCreationPassingClass (TEXT), chanceCreationCrossing (INTEGER), chanceCreationCrossingClass (TEXT), chanceCreationShooting (INTEGER), chanceCreationShootingClass (TEXT), chanceCreationPositioningClass (TEXT), defencePressure (INTEGER), defencePressureClass (TEXT), defenceAggression (INTEGER), defenceAggressionClass (TEXT), defenceTeamWidth (INTEGER), defenceTeamWidthClass (TEXT), defenceDefenderLineClass (TEXT)" }, { "query": "SELECT player_api_id FROM Player WHERE height >= 180 AND height <= 190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot = \"left\"", "question": "List all of the ids for left-footed players with a height between 180cm and 190cm.", "schema": "Player_Attributes: id (INTEGER), player_fifa_api_id (INTEGER), player_api_id (INTEGER), date (TEXT), overall_rating (INTEGER), potential (INTEGER), preferred_foot (TEXT), attacking_work_rate (TEXT), defensive_work_rate (TEXT), crossing (INTEGER), finishing (INTEGER), heading_accuracy (INTEGER), short_passing (INTEGER), volleys (INTEGER), dribbling (INTEGER), curve (INTEGER), free_kick_accuracy (INTEGER), long_passing (INTEGER), ball_control (INTEGER), acceleration (INTEGER), sprint_speed (INTEGER), agility (INTEGER), reactions (INTEGER), balance (INTEGER), shot_power (INTEGER), jumping (INTEGER), stamina (INTEGER), strength (INTEGER), long_shots (INTEGER), aggression (INTEGER), interceptions (INTEGER), positioning (INTEGER), vision (INTEGER), penalties (INTEGER), marking (INTEGER), standing_tackle (INTEGER), sliding_tackle (INTEGER), gk_diving (INTEGER), gk_handling (INTEGER), gk_kicking (INTEGER), gk_positioning (INTEGER), gk_reflexes (INTEGER)\nPlayer: id (INTEGER), player_api_id (INTEGER), player_name (TEXT), player_fifa_api_id (INTEGER), birthday (TEXT), height (INTEGER), weight (INTEGER)\nMatch: id (INTEGER), country_id (INTEGER), league_id (INTEGER), season (TEXT), stage (INTEGER), date (TEXT), match_api_id (INTEGER), home_team_api_id (INTEGER), away_team_api_id (INTEGER), home_team_goal (INTEGER), away_team_goal (INTEGER), home_player_X1 (INTEGER), home_player_X2 (INTEGER), home_player_X3 (INTEGER), home_player_X4 (INTEGER), home_player_X5 (INTEGER), home_player_X6 (INTEGER), home_player_X7 (INTEGER), home_player_X8 (INTEGER), home_player_X9 (INTEGER), home_player_X10 (INTEGER), home_player_X11 (INTEGER), away_player_X1 (INTEGER), away_player_X2 (INTEGER), away_player_X3 (INTEGER), away_player_X4 (INTEGER), away_player_X5 (INTEGER), away_player_X6 (INTEGER), away_player_X7 (INTEGER), away_player_X8 (INTEGER), away_player_X9 (INTEGER), away_player_X10 (INTEGER), away_player_X11 (INTEGER), home_player_Y1 (INTEGER), home_player_Y2 (INTEGER), home_player_Y3 (INTEGER), home_player_Y4 (INTEGER), home_player_Y5 (INTEGER), home_player_Y6 (INTEGER), home_player_Y7 (INTEGER), home_player_Y8 (INTEGER), home_player_Y9 (INTEGER), home_player_Y10 (INTEGER), home_player_Y11 (INTEGER), away_player_Y1 (INTEGER), away_player_Y2 (INTEGER), away_player_Y3 (INTEGER), away_player_Y4 (INTEGER), away_player_Y5 (INTEGER), away_player_Y6 (INTEGER), away_player_Y7 (INTEGER), away_player_Y8 (INTEGER), away_player_Y9 (INTEGER), away_player_Y10 (INTEGER), away_player_Y11 (INTEGER), home_player_1 (INTEGER), home_player_2 (INTEGER), home_player_3 (INTEGER), home_player_4 (INTEGER), home_player_5 (INTEGER), home_player_6 (INTEGER), home_player_7 (INTEGER), home_player_8 (INTEGER), home_player_9 (INTEGER), home_player_10 (INTEGER), home_player_11 (INTEGER), away_player_1 (INTEGER), away_player_2 (INTEGER), away_player_3 (INTEGER), away_player_4 (INTEGER), away_player_5 (INTEGER), away_player_6 (INTEGER), away_player_7 (INTEGER), away_player_8 (INTEGER), away_player_9 (INTEGER), away_player_10 (INTEGER), away_player_11 (INTEGER), goal (TEXT), shoton (TEXT), shotoff (TEXT), foulcommit (TEXT), card (TEXT), cross (TEXT), corner (TEXT), possession (TEXT), B365H (NUMERIC), B365D (NUMERIC), B365A (NUMERIC), BWH (NUMERIC), BWD (NUMERIC), BWA (NUMERIC), IWH (NUMERIC), IWD (NUMERIC), IWA (NUMERIC), LBH (NUMERIC), LBD (NUMERIC), LBA (NUMERIC), PSH (NUMERIC), PSD (NUMERIC), PSA (NUMERIC), WHH (NUMERIC), WHD (NUMERIC), WHA (NUMERIC), SJH (NUMERIC), SJD (NUMERIC), SJA (NUMERIC), VCH (NUMERIC), VCD (NUMERIC), VCA (NUMERIC), GBH (NUMERIC), GBD (NUMERIC), GBA (NUMERIC), BSH (NUMERIC), BSD (NUMERIC), BSA (NUMERIC)\nLeague: id (INTEGER), country_id (INTEGER), name (TEXT)\nCountry: id (INTEGER), name (TEXT)\nTeam: id (INTEGER), team_api_id (INTEGER), team_fifa_api_id (INTEGER), team_long_name (TEXT), team_short_name (TEXT)\nTeam_Attributes: id (INTEGER), team_fifa_api_id (INTEGER), team_api_id (INTEGER), date (TEXT), buildUpPlaySpeed (INTEGER), buildUpPlaySpeedClass (TEXT), buildUpPlayDribbling (INTEGER), buildUpPlayDribblingClass (TEXT), buildUpPlayPassing (INTEGER), buildUpPlayPassingClass (TEXT), buildUpPlayPositioningClass (TEXT), chanceCreationPassing (INTEGER), chanceCreationPassingClass (TEXT), chanceCreationCrossing (INTEGER), chanceCreationCrossingClass (TEXT), chanceCreationShooting (INTEGER), chanceCreationShootingClass (TEXT), chanceCreationPositioningClass (TEXT), defencePressure (INTEGER), defencePressureClass (TEXT), defenceAggression (INTEGER), defenceAggressionClass (TEXT), defenceTeamWidth (INTEGER), defenceTeamWidthClass (TEXT), defenceDefenderLineClass (TEXT)" }, { "query": "SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY overall_rating DESC LIMIT 3", "question": "Who are the top 3 players in terms of overall rating?", "schema": "Player_Attributes: id (INTEGER), player_fifa_api_id (INTEGER), player_api_id (INTEGER), date (TEXT), overall_rating (INTEGER), potential (INTEGER), preferred_foot (TEXT), attacking_work_rate (TEXT), defensive_work_rate (TEXT), crossing (INTEGER), finishing (INTEGER), heading_accuracy (INTEGER), short_passing (INTEGER), volleys (INTEGER), dribbling (INTEGER), curve (INTEGER), free_kick_accuracy (INTEGER), long_passing (INTEGER), ball_control (INTEGER), acceleration (INTEGER), sprint_speed (INTEGER), agility (INTEGER), reactions (INTEGER), balance (INTEGER), shot_power (INTEGER), jumping (INTEGER), stamina (INTEGER), strength (INTEGER), long_shots (INTEGER), aggression (INTEGER), interceptions (INTEGER), positioning (INTEGER), vision (INTEGER), penalties (INTEGER), marking (INTEGER), standing_tackle (INTEGER), sliding_tackle (INTEGER), gk_diving (INTEGER), gk_handling (INTEGER), gk_kicking (INTEGER), gk_positioning (INTEGER), gk_reflexes (INTEGER)\nPlayer: id (INTEGER), player_api_id (INTEGER), player_name (TEXT), player_fifa_api_id (INTEGER), birthday (TEXT), height (INTEGER), weight (INTEGER)\nMatch: id (INTEGER), country_id (INTEGER), league_id (INTEGER), season (TEXT), stage (INTEGER), date (TEXT), match_api_id (INTEGER), home_team_api_id (INTEGER), away_team_api_id (INTEGER), home_team_goal (INTEGER), away_team_goal (INTEGER), home_player_X1 (INTEGER), home_player_X2 (INTEGER), home_player_X3 (INTEGER), home_player_X4 (INTEGER), home_player_X5 (INTEGER), home_player_X6 (INTEGER), home_player_X7 (INTEGER), home_player_X8 (INTEGER), home_player_X9 (INTEGER), home_player_X10 (INTEGER), home_player_X11 (INTEGER), away_player_X1 (INTEGER), away_player_X2 (INTEGER), away_player_X3 (INTEGER), away_player_X4 (INTEGER), away_player_X5 (INTEGER), away_player_X6 (INTEGER), away_player_X7 (INTEGER), away_player_X8 (INTEGER), away_player_X9 (INTEGER), away_player_X10 (INTEGER), away_player_X11 (INTEGER), home_player_Y1 (INTEGER), home_player_Y2 (INTEGER), home_player_Y3 (INTEGER), home_player_Y4 (INTEGER), home_player_Y5 (INTEGER), home_player_Y6 (INTEGER), home_player_Y7 (INTEGER), home_player_Y8 (INTEGER), home_player_Y9 (INTEGER), home_player_Y10 (INTEGER), home_player_Y11 (INTEGER), away_player_Y1 (INTEGER), away_player_Y2 (INTEGER), away_player_Y3 (INTEGER), away_player_Y4 (INTEGER), away_player_Y5 (INTEGER), away_player_Y6 (INTEGER), away_player_Y7 (INTEGER), away_player_Y8 (INTEGER), away_player_Y9 (INTEGER), away_player_Y10 (INTEGER), away_player_Y11 (INTEGER), home_player_1 (INTEGER), home_player_2 (INTEGER), home_player_3 (INTEGER), home_player_4 (INTEGER), home_player_5 (INTEGER), home_player_6 (INTEGER), home_player_7 (INTEGER), home_player_8 (INTEGER), home_player_9 (INTEGER), home_player_10 (INTEGER), home_player_11 (INTEGER), away_player_1 (INTEGER), away_player_2 (INTEGER), away_player_3 (INTEGER), away_player_4 (INTEGER), away_player_5 (INTEGER), away_player_6 (INTEGER), away_player_7 (INTEGER), away_player_8 (INTEGER), away_player_9 (INTEGER), away_player_10 (INTEGER), away_player_11 (INTEGER), goal (TEXT), shoton (TEXT), shotoff (TEXT), foulcommit (TEXT), card (TEXT), cross (TEXT), corner (TEXT), possession (TEXT), B365H (NUMERIC), B365D (NUMERIC), B365A (NUMERIC), BWH (NUMERIC), BWD (NUMERIC), BWA (NUMERIC), IWH (NUMERIC), IWD (NUMERIC), IWA (NUMERIC), LBH (NUMERIC), LBD (NUMERIC), LBA (NUMERIC), PSH (NUMERIC), PSD (NUMERIC), PSA (NUMERIC), WHH (NUMERIC), WHD (NUMERIC), WHA (NUMERIC), SJH (NUMERIC), SJD (NUMERIC), SJA (NUMERIC), VCH (NUMERIC), VCD (NUMERIC), VCA (NUMERIC), GBH (NUMERIC), GBD (NUMERIC), GBA (NUMERIC), BSH (NUMERIC), BSD (NUMERIC), BSA (NUMERIC)\nLeague: id (INTEGER), country_id (INTEGER), name (TEXT)\nCountry: id (INTEGER), name (TEXT)\nTeam: id (INTEGER), team_api_id (INTEGER), team_fifa_api_id (INTEGER), team_long_name (TEXT), team_short_name (TEXT)\nTeam_Attributes: id (INTEGER), team_fifa_api_id (INTEGER), team_api_id (INTEGER), date (TEXT), buildUpPlaySpeed (INTEGER), buildUpPlaySpeedClass (TEXT), buildUpPlayDribbling (INTEGER), buildUpPlayDribblingClass (TEXT), buildUpPlayPassing (INTEGER), buildUpPlayPassingClass (TEXT), buildUpPlayPositioningClass (TEXT), chanceCreationPassing (INTEGER), chanceCreationPassingClass (TEXT), chanceCreationCrossing (INTEGER), chanceCreationCrossingClass (TEXT), chanceCreationShooting (INTEGER), chanceCreationShootingClass (TEXT), chanceCreationPositioningClass (TEXT), defencePressure (INTEGER), defencePressureClass (TEXT), defenceAggression (INTEGER), defenceAggressionClass (TEXT), defenceTeamWidth (INTEGER), defenceTeamWidthClass (TEXT), defenceDefenderLineClass (TEXT)" }, { "query": "SELECT DISTINCT T1.player_name , T1.birthday FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY potential DESC LIMIT 5", "question": "List the names and birthdays of the top five players in terms of potential.", "schema": "Player_Attributes: id (INTEGER), player_fifa_api_id (INTEGER), player_api_id (INTEGER), date (TEXT), overall_rating (INTEGER), potential (INTEGER), preferred_foot (TEXT), attacking_work_rate (TEXT), defensive_work_rate (TEXT), crossing (INTEGER), finishing (INTEGER), heading_accuracy (INTEGER), short_passing (INTEGER), volleys (INTEGER), dribbling (INTEGER), curve (INTEGER), free_kick_accuracy (INTEGER), long_passing (INTEGER), ball_control (INTEGER), acceleration (INTEGER), sprint_speed (INTEGER), agility (INTEGER), reactions (INTEGER), balance (INTEGER), shot_power (INTEGER), jumping (INTEGER), stamina (INTEGER), strength (INTEGER), long_shots (INTEGER), aggression (INTEGER), interceptions (INTEGER), positioning (INTEGER), vision (INTEGER), penalties (INTEGER), marking (INTEGER), standing_tackle (INTEGER), sliding_tackle (INTEGER), gk_diving (INTEGER), gk_handling (INTEGER), gk_kicking (INTEGER), gk_positioning (INTEGER), gk_reflexes (INTEGER)\nPlayer: id (INTEGER), player_api_id (INTEGER), player_name (TEXT), player_fifa_api_id (INTEGER), birthday (TEXT), height (INTEGER), weight (INTEGER)\nMatch: id (INTEGER), country_id (INTEGER), league_id (INTEGER), season (TEXT), stage (INTEGER), date (TEXT), match_api_id (INTEGER), home_team_api_id (INTEGER), away_team_api_id (INTEGER), home_team_goal (INTEGER), away_team_goal (INTEGER), home_player_X1 (INTEGER), home_player_X2 (INTEGER), home_player_X3 (INTEGER), home_player_X4 (INTEGER), home_player_X5 (INTEGER), home_player_X6 (INTEGER), home_player_X7 (INTEGER), home_player_X8 (INTEGER), home_player_X9 (INTEGER), home_player_X10 (INTEGER), home_player_X11 (INTEGER), away_player_X1 (INTEGER), away_player_X2 (INTEGER), away_player_X3 (INTEGER), away_player_X4 (INTEGER), away_player_X5 (INTEGER), away_player_X6 (INTEGER), away_player_X7 (INTEGER), away_player_X8 (INTEGER), away_player_X9 (INTEGER), away_player_X10 (INTEGER), away_player_X11 (INTEGER), home_player_Y1 (INTEGER), home_player_Y2 (INTEGER), home_player_Y3 (INTEGER), home_player_Y4 (INTEGER), home_player_Y5 (INTEGER), home_player_Y6 (INTEGER), home_player_Y7 (INTEGER), home_player_Y8 (INTEGER), home_player_Y9 (INTEGER), home_player_Y10 (INTEGER), home_player_Y11 (INTEGER), away_player_Y1 (INTEGER), away_player_Y2 (INTEGER), away_player_Y3 (INTEGER), away_player_Y4 (INTEGER), away_player_Y5 (INTEGER), away_player_Y6 (INTEGER), away_player_Y7 (INTEGER), away_player_Y8 (INTEGER), away_player_Y9 (INTEGER), away_player_Y10 (INTEGER), away_player_Y11 (INTEGER), home_player_1 (INTEGER), home_player_2 (INTEGER), home_player_3 (INTEGER), home_player_4 (INTEGER), home_player_5 (INTEGER), home_player_6 (INTEGER), home_player_7 (INTEGER), home_player_8 (INTEGER), home_player_9 (INTEGER), home_player_10 (INTEGER), home_player_11 (INTEGER), away_player_1 (INTEGER), away_player_2 (INTEGER), away_player_3 (INTEGER), away_player_4 (INTEGER), away_player_5 (INTEGER), away_player_6 (INTEGER), away_player_7 (INTEGER), away_player_8 (INTEGER), away_player_9 (INTEGER), away_player_10 (INTEGER), away_player_11 (INTEGER), goal (TEXT), shoton (TEXT), shotoff (TEXT), foulcommit (TEXT), card (TEXT), cross (TEXT), corner (TEXT), possession (TEXT), B365H (NUMERIC), B365D (NUMERIC), B365A (NUMERIC), BWH (NUMERIC), BWD (NUMERIC), BWA (NUMERIC), IWH (NUMERIC), IWD (NUMERIC), IWA (NUMERIC), LBH (NUMERIC), LBD (NUMERIC), LBA (NUMERIC), PSH (NUMERIC), PSD (NUMERIC), PSA (NUMERIC), WHH (NUMERIC), WHD (NUMERIC), WHA (NUMERIC), SJH (NUMERIC), SJD (NUMERIC), SJA (NUMERIC), VCH (NUMERIC), VCD (NUMERIC), VCA (NUMERIC), GBH (NUMERIC), GBD (NUMERIC), GBA (NUMERIC), BSH (NUMERIC), BSD (NUMERIC), BSA (NUMERIC)\nLeague: id (INTEGER), country_id (INTEGER), name (TEXT)\nCountry: id (INTEGER), name (TEXT)\nTeam: id (INTEGER), team_api_id (INTEGER), team_fifa_api_id (INTEGER), team_long_name (TEXT), team_short_name (TEXT)\nTeam_Attributes: id (INTEGER), team_fifa_api_id (INTEGER), team_api_id (INTEGER), date (TEXT), buildUpPlaySpeed (INTEGER), buildUpPlaySpeedClass (TEXT), buildUpPlayDribbling (INTEGER), buildUpPlayDribblingClass (TEXT), buildUpPlayPassing (INTEGER), buildUpPlayPassingClass (TEXT), buildUpPlayPositioningClass (TEXT), chanceCreationPassing (INTEGER), chanceCreationPassingClass (TEXT), chanceCreationCrossing (INTEGER), chanceCreationCrossingClass (TEXT), chanceCreationShooting (INTEGER), chanceCreationShootingClass (TEXT), chanceCreationPositioningClass (TEXT), defencePressure (INTEGER), defencePressureClass (TEXT), defenceAggression (INTEGER), defenceAggressionClass (TEXT), defenceTeamWidth (INTEGER), defenceTeamWidthClass (TEXT), defenceDefenderLineClass (TEXT)" }, { "query": "SELECT count(*) FROM performance", "question": "How many performances are there?", "schema": "member: Member_ID (TEXT), Name (TEXT), Nationality (TEXT), Role (TEXT)\nperformance: Performance_ID (REAL), Date (TEXT), Host (TEXT), Location (TEXT), Attendance (INT)\nmember_attendance: Member_ID (INT), Performance_ID (INT), Num_of_Pieces (INT)" }, { "query": "SELECT HOST FROM performance ORDER BY Attendance ASC", "question": "List the hosts of performances in ascending order of attendance.", "schema": "member: Member_ID (TEXT), Name (TEXT), Nationality (TEXT), Role (TEXT)\nperformance: Performance_ID (REAL), Date (TEXT), Host (TEXT), Location (TEXT), Attendance (INT)\nmember_attendance: Member_ID (INT), Performance_ID (INT), Num_of_Pieces (INT)" }, { "query": "SELECT Date , LOCATION FROM performance", "question": "What are the dates and locations of performances?", "schema": "member: Member_ID (TEXT), Name (TEXT), Nationality (TEXT), Role (TEXT)\nperformance: Performance_ID (REAL), Date (TEXT), Host (TEXT), Location (TEXT), Attendance (INT)\nmember_attendance: Member_ID (INT), Performance_ID (INT), Num_of_Pieces (INT)" }, { "query": "SELECT Attendance FROM performance WHERE LOCATION = \"TD Garden\" OR LOCATION = \"Bell Centre\"", "question": "Show the attendances of the performances at location \"TD Garden\" or \"Bell Centre\"", "schema": "member: Member_ID (TEXT), Name (TEXT), Nationality (TEXT), Role (TEXT)\nperformance: Performance_ID (REAL), Date (TEXT), Host (TEXT), Location (TEXT), Attendance (INT)\nmember_attendance: Member_ID (INT), Performance_ID (INT), Num_of_Pieces (INT)" }, { "query": "SELECT avg(Attendance) FROM performance", "question": "What is the average number of attendees for performances?", "schema": "member: Member_ID (TEXT), Name (TEXT), Nationality (TEXT), Role (TEXT)\nperformance: Performance_ID (REAL), Date (TEXT), Host (TEXT), Location (TEXT), Attendance (INT)\nmember_attendance: Member_ID (INT), Performance_ID (INT), Num_of_Pieces (INT)" }, { "query": "SELECT Date FROM performance ORDER BY Attendance DESC LIMIT 1", "question": "What is the date of the performance with the highest number of attendees?", "schema": "member: Member_ID (TEXT), Name (TEXT), Nationality (TEXT), Role (TEXT)\nperformance: Performance_ID (REAL), Date (TEXT), Host (TEXT), Location (TEXT), Attendance (INT)\nmember_attendance: Member_ID (INT), Performance_ID (INT), Num_of_Pieces (INT)" }, { "query": "SELECT LOCATION , COUNT(*) FROM performance GROUP BY LOCATION", "question": "Show different locations and the number of performances at each location.", "schema": "member: Member_ID (TEXT), Name (TEXT), Nationality (TEXT), Role (TEXT)\nperformance: Performance_ID (REAL), Date (TEXT), Host (TEXT), Location (TEXT), Attendance (INT)\nmember_attendance: Member_ID (INT), Performance_ID (INT), Num_of_Pieces (INT)" }, { "query": "SELECT LOCATION FROM performance GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the most common location of performances.", "schema": "member: Member_ID (TEXT), Name (TEXT), Nationality (TEXT), Role (TEXT)\nperformance: Performance_ID (REAL), Date (TEXT), Host (TEXT), Location (TEXT), Attendance (INT)\nmember_attendance: Member_ID (INT), Performance_ID (INT), Num_of_Pieces (INT)" }, { "query": "SELECT LOCATION FROM performance GROUP BY LOCATION HAVING COUNT(*) >= 2", "question": "Show the locations that have at least two performances.", "schema": "member: Member_ID (TEXT), Name (TEXT), Nationality (TEXT), Role (TEXT)\nperformance: Performance_ID (REAL), Date (TEXT), Host (TEXT), Location (TEXT), Attendance (INT)\nmember_attendance: Member_ID (INT), Performance_ID (INT), Num_of_Pieces (INT)" }, { "query": "SELECT LOCATION FROM performance WHERE Attendance > 2000 INTERSECT SELECT LOCATION FROM performance WHERE Attendance < 1000", "question": "Show the locations that have both performances with more than 2000 attendees and performances with less than 1000 attendees.", "schema": "member: Member_ID (TEXT), Name (TEXT), Nationality (TEXT), Role (TEXT)\nperformance: Performance_ID (REAL), Date (TEXT), Host (TEXT), Location (TEXT), Attendance (INT)\nmember_attendance: Member_ID (INT), Performance_ID (INT), Num_of_Pieces (INT)" }, { "query": "SELECT T2.Name , T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID", "question": "Show the names of members and the location of the performances they attended.", "schema": "member: Member_ID (TEXT), Name (TEXT), Nationality (TEXT), Role (TEXT)\nperformance: Performance_ID (REAL), Date (TEXT), Host (TEXT), Location (TEXT), Attendance (INT)\nmember_attendance: Member_ID (INT), Performance_ID (INT), Num_of_Pieces (INT)" }, { "query": "SELECT T2.Name , T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T2.Name ASC", "question": "Show the names of members and the location of performances they attended in ascending alphabetical order of their names.", "schema": "member: Member_ID (TEXT), Name (TEXT), Nationality (TEXT), Role (TEXT)\nperformance: Performance_ID (REAL), Date (TEXT), Host (TEXT), Location (TEXT), Attendance (INT)\nmember_attendance: Member_ID (INT), Performance_ID (INT), Num_of_Pieces (INT)" }, { "query": "SELECT T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID WHERE T2.Role = \"Violin\"", "question": "Show the dates of performances with attending members whose roles are \"Violin\".", "schema": "member: Member_ID (TEXT), Name (TEXT), Nationality (TEXT), Role (TEXT)\nperformance: Performance_ID (REAL), Date (TEXT), Host (TEXT), Location (TEXT), Attendance (INT)\nmember_attendance: Member_ID (INT), Performance_ID (INT), Num_of_Pieces (INT)" }, { "query": "SELECT T2.Name , T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T3.Attendance DESC", "question": "Show the names of members and the dates of performances they attended in descending order of attendance of the performances.", "schema": "member: Member_ID (TEXT), Name (TEXT), Nationality (TEXT), Role (TEXT)\nperformance: Performance_ID (REAL), Date (TEXT), Host (TEXT), Location (TEXT), Attendance (INT)\nmember_attendance: Member_ID (INT), Performance_ID (INT), Num_of_Pieces (INT)" }, { "query": "SELECT Name FROM member WHERE Member_ID NOT IN (SELECT Member_ID FROM member_attendance)", "question": "List the names of members who did not attend any performance.", "schema": "member: Member_ID (TEXT), Name (TEXT), Nationality (TEXT), Role (TEXT)\nperformance: Performance_ID (REAL), Date (TEXT), Host (TEXT), Location (TEXT), Attendance (INT)\nmember_attendance: Member_ID (INT), Performance_ID (INT), Num_of_Pieces (INT)" }, { "query": "SELECT DISTINCT building FROM classroom WHERE capacity > 50", "question": "Find the buildings which have rooms with capacity more than 50.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT DISTINCT building FROM classroom WHERE capacity > 50", "question": "What are the distinct buildings with capacities of greater than 50?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(*) FROM classroom WHERE building != 'Lamberton'", "question": "Count the number of rooms that are not in the Lamberton building.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(*) FROM classroom WHERE building != 'Lamberton'", "question": "How many classrooms are not in Lamberton?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name , building FROM department WHERE budget > (SELECT avg(budget) FROM department)", "question": "What is the name and building of the departments whose budget is more than the average budget?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name , building FROM department WHERE budget > (SELECT avg(budget) FROM department)", "question": "Give the name and building of the departments with greater than average budget.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT building , room_number FROM classroom WHERE capacity BETWEEN 50 AND 100", "question": "Find the room number of the rooms which can sit 50 to 100 students and their buildings.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT building , room_number FROM classroom WHERE capacity BETWEEN 50 AND 100", "question": "What are the room numbers and corresponding buildings for classrooms which can seat between 50 to 100 students?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name , building FROM department ORDER BY budget DESC LIMIT 1", "question": "Find the name and building of the department with the highest budget.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name , building FROM department ORDER BY budget DESC LIMIT 1", "question": "What is the department name and corresponding building for the department with the greatest budget?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1", "question": "What is the name of the student who has the highest total credits in the History department.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1", "question": "Give the name of the student in the History department with the most credits.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(*) FROM classroom WHERE building = 'Lamberton'", "question": "How many rooms does the Lamberton building have?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(*) FROM classroom WHERE building = 'Lamberton'", "question": "Count the number of classrooms in Lamberton.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(DISTINCT s_id) FROM advisor", "question": "How many students have advisors?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(DISTINCT s_id) FROM advisor", "question": "Count the number of students who have advisors.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(DISTINCT dept_name) FROM course", "question": "How many departments offer courses?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(DISTINCT dept_name) FROM course", "question": "Count the number of departments which offer courses.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'", "question": "How many different courses offered by Physics department?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'", "question": "Count the number of courses in the Physics department.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) = 2", "question": "Find the title of courses that have two prerequisites?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) = 2", "question": "What are the titles for courses with two prerequisites?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.title , T1.credits , T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) > 1", "question": "Find the title, credit, and department name of courses that have more than one prerequisites?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.title , T1.credits , T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) > 1", "question": "What is the title, credit value, and department name for courses with more than one prerequisite?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)", "question": "How many courses that do not have prerequisite?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)", "question": "Count the number of courses without prerequisites.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)", "question": "Find the name of the courses that do not have any prerequisite?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)", "question": "What are the titles of courses without prerequisites?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT COUNT (DISTINCT id) FROM teaches", "question": "How many different instructors have taught some course?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT COUNT (DISTINCT id) FROM teaches", "question": "Count the number of distinct instructors who have taught a course.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT sum(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'", "question": "Find the total budgets of the Marketing or Finance department.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT sum(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'", "question": "What is the sum of budgets of the Marketing and Finance departments?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'", "question": "Find the department name of the instructor whose name contains 'Soisalon'.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'", "question": "What is the name of the department with an instructure who has a name like 'Soisalon'?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50", "question": "How many rooms whose capacity is less than 50 does the Lamberton building have?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50", "question": "Count the number of rooms in Lamberton with capacity lower than 50.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name , budget FROM department WHERE budget > (SELECT avg(budget) FROM department)", "question": "Find the name and budget of departments whose budgets are more than the average budget.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name , budget FROM department WHERE budget > (SELECT avg(budget) FROM department)", "question": "What are the names and budgets of departments with budgets greater than the average?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1", "question": "what is the name of the instructor who is in Statistics department and earns the lowest salary?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1", "question": "Give the name of the lowest earning instructor in the Statistics department.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'", "question": "Find the title of course that is provided by both Statistics and Psychology departments.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'", "question": "What is the title of a course that is listed in both the Statistics and Psychology departments?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'", "question": "Find the title of course that is provided by Statistics but not Psychology departments.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'", "question": "What are the titles of courses that are in the Statistics department but not the Psychology department?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010", "question": "Find the id of instructors who taught a class in Fall 2009 but not in Spring 2010.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010", "question": "What are the ids of instructors who taught in the Fall of 2009 but not in the Spring of 2010?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010", "question": "Find the name of students who took any class in the years of 2009 and 2010.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010", "question": "What are the names of the students who took classes in 2009 or 2010?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC LIMIT 3", "question": "Find the names of the top 3 departments that provide the largest amount of courses?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC LIMIT 3", "question": "What are the names of the 3 departments with the most courses?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name FROM course GROUP BY dept_name ORDER BY sum(credits) DESC LIMIT 1", "question": "Find the name of the department that offers the highest total credits?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name FROM course GROUP BY dept_name ORDER BY sum(credits) DESC LIMIT 1", "question": "What is the name of the department with the most credits?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course ORDER BY title , credits", "question": "List the names of all courses ordered by their titles and credits.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course ORDER BY title , credits", "question": "Given the titles of all courses, in order of titles and credits.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name FROM department ORDER BY budget LIMIT 1", "question": "Which department has the lowest budget?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name FROM department ORDER BY budget LIMIT 1", "question": "Give the name of the department with the lowest budget.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name , building FROM department ORDER BY budget DESC", "question": "List the names and buildings of all departments sorted by the budget from large to small.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name , building FROM department ORDER BY budget DESC", "question": "What are the names and buildings of the deparments, sorted by budget descending?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor ORDER BY salary DESC LIMIT 1", "question": "Who is the instructor with the highest salary?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor ORDER BY salary DESC LIMIT 1", "question": "Give the name of the highest paid instructor.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT * FROM instructor ORDER BY salary", "question": "List the information of all instructors ordered by their salary in ascending order.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT * FROM instructor ORDER BY salary", "question": "Give all information regarding instructors, in order of salary from least to greatest.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name , dept_name FROM student ORDER BY tot_cred", "question": "Find the name of the students and their department names sorted by their total credits in ascending order.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name , dept_name FROM student ORDER BY tot_cred", "question": "What are the names of students and their respective departments, ordered by number of credits from least to greatest?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.title , T3.name FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.id = T3.id WHERE YEAR = 2008 ORDER BY T1.title", "question": "list in alphabetic order all course names and their instructors' names in year 2008.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.title , T3.name FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.id = T3.id WHERE YEAR = 2008 ORDER BY T1.title", "question": "Show all titles and their instructors' names for courses in 2008, in alphabetical order by title.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.name FROM instructor AS T1 JOIN advisor AS T2 ON T1.id = T2.i_id GROUP BY T2.i_id HAVING count(*) > 1", "question": "Find the name of instructors who are advising more than one student.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.name FROM instructor AS T1 JOIN advisor AS T2 ON T1.id = T2.i_id GROUP BY T2.i_id HAVING count(*) > 1", "question": "What are the names of instructors who advise more than one student?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.name FROM student AS T1 JOIN advisor AS T2 ON T1.id = T2.s_id GROUP BY T2.s_id HAVING count(*) > 1", "question": "Find the name of the students who have more than one advisor?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.name FROM student AS T1 JOIN advisor AS T2 ON T1.id = T2.s_id GROUP BY T2.s_id HAVING count(*) > 1", "question": "What are the names of students who have more than one advisor?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(*) , building FROM classroom WHERE capacity > 50 GROUP BY building", "question": "Find the number of rooms with more than 50 capacity for each building.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(*) , building FROM classroom WHERE capacity > 50 GROUP BY building", "question": "How many rooms in each building have a capacity of over 50?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT max(capacity) , avg(capacity) , building FROM classroom GROUP BY building", "question": "Find the maximum and average capacity among rooms in each building.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT max(capacity) , avg(capacity) , building FROM classroom GROUP BY building", "question": "What are the greatest and average capacity for rooms in each building?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course GROUP BY title HAVING count(*) > 1", "question": "Find the title of the course that is offered by more than one department.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course GROUP BY title HAVING count(*) > 1", "question": "What are the titles of courses that are offered in more than one department?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT sum(credits) , dept_name FROM course GROUP BY dept_name", "question": "Find the total credits of courses provided by different department.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT sum(credits) , dept_name FROM course GROUP BY dept_name", "question": "How many total credits are offered by each department?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT min(salary) , dept_name FROM instructor GROUP BY dept_name HAVING avg(salary) > (SELECT avg(salary) FROM instructor)", "question": "Find the minimum salary for the departments whose average salary is above the average payment of all instructors.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT min(salary) , dept_name FROM instructor GROUP BY dept_name HAVING avg(salary) > (SELECT avg(salary) FROM instructor)", "question": "What is the lowest salary in departments with average salary greater than the overall average.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(*) , semester , YEAR FROM SECTION GROUP BY semester , YEAR", "question": "Find the number of courses provided in each semester and year.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(*) , semester , YEAR FROM SECTION GROUP BY semester , YEAR", "question": "How many courses are provided in each semester and year?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT YEAR FROM SECTION GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1", "question": "Find the year which offers the largest number of courses.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT YEAR FROM SECTION GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1", "question": "Which year had the greatest number of courses?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT semester , YEAR FROM SECTION GROUP BY semester , YEAR ORDER BY count(*) DESC LIMIT 1", "question": "Find the year and semester when offers the largest number of courses.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT semester , YEAR FROM SECTION GROUP BY semester , YEAR ORDER BY count(*) DESC LIMIT 1", "question": "What is the year and semester with the most courses?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name FROM student GROUP BY dept_name ORDER BY count(*) DESC LIMIT 1", "question": "Find the name of department has the highest amount of students?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name FROM student GROUP BY dept_name ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of the deparment with the highest enrollment?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(*) , dept_name FROM student GROUP BY dept_name", "question": "Find the total number of students in each department.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(*) , dept_name FROM student GROUP BY dept_name", "question": "How many students are in each department?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT semester , YEAR FROM takes GROUP BY semester , YEAR ORDER BY count(*) LIMIT 1", "question": "Find the semester and year which has the least number of student taking any class.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT semester , YEAR FROM takes GROUP BY semester , YEAR ORDER BY count(*) LIMIT 1", "question": "Which semeseter and year had the fewest students?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id = T2.id WHERE T2.dept_name = 'History'", "question": "What is the id of the instructor who advises of all students from History department?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id = T2.id WHERE T2.dept_name = 'History'", "question": "Give id of the instructor who advises students in the History department.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T2.name , T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'History'", "question": "Find the name and salary of the instructors who are advisors of any student from History department?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T2.name , T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'History'", "question": "What are the names and salaries of instructors who advises students in the History department?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq", "question": "Find the id of the courses that do not have any prerequisite?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq", "question": "What are the ids of courses without prerequisites?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)", "question": "Find the name of the courses that do not have any prerequisite?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)", "question": "What are the names of courses without prerequisites?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'International Finance')", "question": "What is the title of the prerequisite class of International Finance course?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'International Finance')", "question": "Give the title of the prerequisite to the course International Finance.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course WHERE course_id IN (SELECT T1.course_id FROM prereq AS T1 JOIN course AS T2 ON T1.prereq_id = T2.course_id WHERE T2.title = 'Differential Geometry')", "question": "Find the title of course whose prerequisite is course Differential Geometry.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course WHERE course_id IN (SELECT T1.course_id FROM prereq AS T1 JOIN course AS T2 ON T1.prereq_id = T2.course_id WHERE T2.title = 'Differential Geometry')", "question": "What is the title of the course with Differential Geometry as a prerequisite?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester = 'Fall' AND YEAR = 2003)", "question": "Find the names of students who have taken any course in the fall semester of year 2003.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester = 'Fall' AND YEAR = 2003)", "question": "What are the names of students who took a course in the Fall of 2003?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.title FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE building = 'Chandler' AND semester = 'Fall' AND YEAR = 2010", "question": "What is the title of the course that was offered at building Chandler during the fall semester in the year of 2010?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.title FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE building = 'Chandler' AND semester = 'Fall' AND YEAR = 2010", "question": "Give the title of the course offered in Chandler during the Fall of 2010.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.id = T2.id JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.title = 'C Programming'", "question": "Find the name of the instructors who taught C Programming course before.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.id = T2.id JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.title = 'C Programming'", "question": "What are the names of instructors who have taught C Programming courses?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T2.name , T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math'", "question": "Find the name and salary of instructors who are advisors of the students from the Math department.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T2.name , T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math'", "question": "What are the names and salaries of instructors who advise students in the Math department?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math' ORDER BY T3.tot_cred", "question": "Find the name of instructors who are advisors of the students from the Math department, and sort the results by students' total credit.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math' ORDER BY T3.tot_cred", "question": "What are the names of all instructors who advise students in the math depart sorted by total credits of the student.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'Mobile Computing')", "question": "What is the course title of the prerequisite of course Mobile Computing?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'Mobile Computing')", "question": "What is the title of the course that is a prerequisite for Mobile Computing?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id ORDER BY T3.tot_cred DESC LIMIT 1", "question": "Find the name of instructor who is the advisor of the student who has the highest number of total credits.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id ORDER BY T3.tot_cred DESC LIMIT 1", "question": "What is the name of the instructor who advises the student with the greatest number of total credits?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches)", "question": "Find the name of instructors who didn't teach any courses?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches)", "question": "What are the names of instructors who didn't teach?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT id FROM instructor EXCEPT SELECT id FROM teaches", "question": "Find the id of instructors who didn't teach any courses?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT id FROM instructor EXCEPT SELECT id FROM teaches", "question": "What are the ids of instructors who didnt' teach?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches WHERE semester = 'Spring')", "question": "Find the names of instructors who didn't each any courses in any Spring semester.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches WHERE semester = 'Spring')", "question": "What are the names of instructors who didn't teach courses in the Spring?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY avg(salary) DESC LIMIT 1", "question": "Find the name of the department which has the highest average salary of professors.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY avg(salary) DESC LIMIT 1", "question": "Which department has the highest average instructor salary?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT avg(T1.salary) , count(*) FROM instructor AS T1 JOIN department AS T2 ON T1.dept_name = T2.dept_name ORDER BY T2.budget DESC LIMIT 1", "question": "Find the number and averaged salary of all instructors who are in the department with the highest budget.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT avg(T1.salary) , count(*) FROM instructor AS T1 JOIN department AS T2 ON T1.dept_name = T2.dept_name ORDER BY T2.budget DESC LIMIT 1", "question": "How many instructors are in the department with the highest budget, and what is their average salary?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T3.title , T3.credits FROM classroom AS T1 JOIN SECTION AS T2 ON T1.building = T2.building AND T1.room_number = T2.room_number JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.capacity = (SELECT max(capacity) FROM classroom)", "question": "What is the title and credits of the course that is taught in the largest classroom (with the highest capacity)?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T3.title , T3.credits FROM classroom AS T1 JOIN SECTION AS T2 ON T1.building = T2.building AND T1.room_number = T2.room_number JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.capacity = (SELECT max(capacity) FROM classroom)", "question": "Give the title and credits for the course that is taught in the classroom with the greatest capacity.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM student WHERE id NOT IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.dept_name = 'Biology')", "question": "Find the name of students who didn't take any course from Biology department.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM student WHERE id NOT IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.dept_name = 'Biology')", "question": "What are the names of students who haven't taken any Biology courses?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(DISTINCT T2.id) , count(DISTINCT T3.id) , T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name GROUP BY T3.dept_name", "question": "Find the total number of students and total number of instructors for each department.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(DISTINCT T2.id) , count(DISTINCT T3.id) , T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name GROUP BY T3.dept_name", "question": "How many students and instructors are in each department?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE T2.course_id IN (SELECT T4.prereq_id FROM course AS T3 JOIN prereq AS T4 ON T3.course_id = T4.course_id WHERE T3.title = 'International Finance')", "question": "Find the name of students who have taken the prerequisite course of the course with title International Finance.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE T2.course_id IN (SELECT T4.prereq_id FROM course AS T3 JOIN prereq AS T4 ON T3.course_id = T4.course_id WHERE T3.title = 'International Finance')", "question": "What are the names of students who have taken the prerequisite for the course International Finance?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name , salary FROM instructor WHERE salary < (SELECT avg(salary) FROM instructor WHERE dept_name = 'Physics')", "question": "Find the name and salary of instructors whose salary is below the average salary of the instructors in the Physics department.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name , salary FROM instructor WHERE salary < (SELECT avg(salary) FROM instructor WHERE dept_name = 'Physics')", "question": "What are the names and salaries for instructors who earn less than the average salary of instructors in the Physics department?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id = T2.course_id JOIN student AS T3 ON T2.id = T3.id WHERE T1.dept_name = 'Statistics'", "question": "Find the name of students who took some course offered by Statistics department.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id = T2.course_id JOIN student AS T3 ON T2.id = T3.id WHERE T1.dept_name = 'Statistics'", "question": "What are the names of students who have taken Statistics courses?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T2.building , T2.room_number , T2.semester , T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY T1.title", "question": "Find the building, room number, semester and year of all courses offered by Psychology department sorted by course titles.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT T2.building , T2.room_number , T2.semester , T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY T1.title", "question": "What are the building, room number, semester and year of courses in the Psychology department, sorted using course title?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.'", "question": "Find the names of all instructors in computer science department", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.'", "question": "What are the names of all instructors in the Comp. Sci. department?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.' AND salary > 80000", "question": "Find the names of all instructors in Comp. Sci. department with salary > 80000.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.' AND salary > 80000", "question": "What are the names of the instructors in the Comp. Sci. department who earn more than 80000?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name , course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID", "question": "Find the names of all instructors who have taught some course and the course_id.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name , course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID", "question": "What are the names of all instructors who have taught a course, as well as the corresponding course id?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name , course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID WHERE T1.dept_name = 'Art'", "question": "Find the names of all instructors in the Art department who have taught some course and the course_id.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name , course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID WHERE T1.dept_name = 'Art'", "question": "What are the names of Art instructors who have taught a course, and the corresponding course id?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE name LIKE '%dar%'", "question": "Find the names of all instructors whose name includes the substring \u201cdar\u201d.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE name LIKE '%dar%'", "question": "What are the names of all instructors with names that include \"dar\"?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT DISTINCT name FROM instructor ORDER BY name", "question": "List in alphabetic order the names of all distinct instructors.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT DISTINCT name FROM instructor ORDER BY name", "question": "List the distinct names of the instructors, ordered by name.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 UNION SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010", "question": "Find courses that ran in Fall 2009 or in Spring 2010.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 UNION SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010", "question": "What are the ids for courses in the Fall of 2009 or the Spring of 2010?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 INTERSECT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010", "question": "Find courses that ran in Fall 2009 and in Spring 2010.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 INTERSECT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010", "question": "What are the ids for courses that were offered in both Fall of 2009 and Spring of 2010?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010", "question": "Find courses that ran in Fall 2009 but not in Spring 2010.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010", "question": "What are the ids of courses offered in Fall of 2009 but not in Spring of 2010?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT DISTINCT salary FROM instructor WHERE salary < (SELECT max(salary) FROM instructor)", "question": "Find the salaries of all distinct instructors that are less than the largest salary.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT DISTINCT salary FROM instructor WHERE salary < (SELECT max(salary) FROM instructor)", "question": "What are the distinct salaries of all instructors who earned less than the maximum salary?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT COUNT (DISTINCT ID) FROM teaches WHERE semester = 'Spring' AND YEAR = 2010", "question": "Find the total number of instructors who teach a course in the Spring 2010 semester.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT COUNT (DISTINCT ID) FROM teaches WHERE semester = 'Spring' AND YEAR = 2010", "question": "How many instructors teach a course in the Spring of 2010?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name , AVG (salary) FROM instructor GROUP BY dept_name HAVING AVG (salary) > 42000", "question": "Find the names and average salaries of all departments whose average salary is greater than 42000.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT dept_name , AVG (salary) FROM instructor GROUP BY dept_name HAVING AVG (salary) > 42000", "question": "What are the names and average salaries for departments with average salary higher than 42000?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE salary > (SELECT min(salary) FROM instructor WHERE dept_name = 'Biology')", "question": "Find names of instructors with salary greater than that of some (at least one) instructor in the Biology department.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE salary > (SELECT min(salary) FROM instructor WHERE dept_name = 'Biology')", "question": "What are the names of instructors who earn more than at least one instructor from the Biology department?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE salary > (SELECT max(salary) FROM instructor WHERE dept_name = 'Biology')", "question": "Find the names of all instructors whose salary is greater than the salary of all instructors in the Biology department.", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT name FROM instructor WHERE salary > (SELECT max(salary) FROM instructor WHERE dept_name = 'Biology')", "question": "What are the names of all instructors with a higher salary than any of the instructors in the Biology department?", "schema": "classroom: building (VARCHAR(15)), room_number (VARCHAR(7)), capacity (NUMERIC(40))\ndepartment: dept_name (VARCHAR(20)), building (VARCHAR(15))\ncourse: course_id (VARCHAR(8)), title (VARCHAR(50)), dept_name (VARCHAR(20)), REFERENCES (`DEPARTMENT`), ON (DELETE)\ninstructor: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\nsection: course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), building (VARCHAR(15)), room_number (VARCHAR(7)), time_slot_id (VARCHAR(4)), on (DELETE), on (DELETE)\nteaches: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), on (DELETE), on (DELETE)\nstudent: ID (VARCHAR(5)), name (VARCHAR(20)), dept_name (VARCHAR(20)), on (DELETE)\ntakes: ID (VARCHAR(5)), course_id (VARCHAR(8)), sec_id (VARCHAR(8)), semester (VARCHAR(6)), year (NUMERIC(40)), grade (VARCHAR(2)), on (DELETE), on (DELETE)\nadvisor: s_ID (VARCHAR(5)), i_ID (VARCHAR(5)), on (DELETE), on (DELETE)\ntime_slot: time_slot_id (VARCHAR(4)), day (VARCHAR(1))\nprereq: course_id (VARCHAR(8)), prereq_id (VARCHAR(8)), on (DELETE)" }, { "query": "SELECT count(*) FROM debate", "question": "How many debates are there?", "schema": "people: People_ID (INT), District (TEXT), Name (TEXT), Party (TEXT), Age (INT)\ndebate: Debate_ID (INT), Date (TEXT), Venue (TEXT), Num_of_Audience (INT)\ndebate_people: Debate_ID (INT), Affirmative (INT), Negative (INT), If_Affirmative_Win (BOOL)" }, { "query": "SELECT Venue FROM debate ORDER BY Num_of_Audience ASC", "question": "List the venues of debates in ascending order of the number of audience.", "schema": "people: People_ID (INT), District (TEXT), Name (TEXT), Party (TEXT), Age (INT)\ndebate: Debate_ID (INT), Date (TEXT), Venue (TEXT), Num_of_Audience (INT)\ndebate_people: Debate_ID (INT), Affirmative (INT), Negative (INT), If_Affirmative_Win (BOOL)" }, { "query": "SELECT Date , Venue FROM debate", "question": "What are the date and venue of each debate?", "schema": "people: People_ID (INT), District (TEXT), Name (TEXT), Party (TEXT), Age (INT)\ndebate: Debate_ID (INT), Date (TEXT), Venue (TEXT), Num_of_Audience (INT)\ndebate_people: Debate_ID (INT), Affirmative (INT), Negative (INT), If_Affirmative_Win (BOOL)" }, { "query": "SELECT Date FROM debate WHERE Num_of_Audience > 150", "question": "List the dates of debates with number of audience bigger than 150", "schema": "people: People_ID (INT), District (TEXT), Name (TEXT), Party (TEXT), Age (INT)\ndebate: Debate_ID (INT), Date (TEXT), Venue (TEXT), Num_of_Audience (INT)\ndebate_people: Debate_ID (INT), Affirmative (INT), Negative (INT), If_Affirmative_Win (BOOL)" }, { "query": "SELECT Name FROM people WHERE Age = 35 OR Age = 36", "question": "Show the names of people aged either 35 or 36.", "schema": "people: People_ID (INT), District (TEXT), Name (TEXT), Party (TEXT), Age (INT)\ndebate: Debate_ID (INT), Date (TEXT), Venue (TEXT), Num_of_Audience (INT)\ndebate_people: Debate_ID (INT), Affirmative (INT), Negative (INT), If_Affirmative_Win (BOOL)" }, { "query": "SELECT Party FROM people ORDER BY Age ASC LIMIT 1", "question": "What is the party of the youngest people?", "schema": "people: People_ID (INT), District (TEXT), Name (TEXT), Party (TEXT), Age (INT)\ndebate: Debate_ID (INT), Date (TEXT), Venue (TEXT), Num_of_Audience (INT)\ndebate_people: Debate_ID (INT), Affirmative (INT), Negative (INT), If_Affirmative_Win (BOOL)" }, { "query": "SELECT Party , COUNT(*) FROM people GROUP BY Party", "question": "Show different parties of people along with the number of people in each party.", "schema": "people: People_ID (INT), District (TEXT), Name (TEXT), Party (TEXT), Age (INT)\ndebate: Debate_ID (INT), Date (TEXT), Venue (TEXT), Num_of_Audience (INT)\ndebate_people: Debate_ID (INT), Affirmative (INT), Negative (INT), If_Affirmative_Win (BOOL)" }, { "query": "SELECT Party FROM people GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the party that has the most people.", "schema": "people: People_ID (INT), District (TEXT), Name (TEXT), Party (TEXT), Age (INT)\ndebate: Debate_ID (INT), Date (TEXT), Venue (TEXT), Num_of_Audience (INT)\ndebate_people: Debate_ID (INT), Affirmative (INT), Negative (INT), If_Affirmative_Win (BOOL)" }, { "query": "SELECT DISTINCT Venue FROM debate", "question": "Show the distinct venues of debates", "schema": "people: People_ID (INT), District (TEXT), Name (TEXT), Party (TEXT), Age (INT)\ndebate: Debate_ID (INT), Date (TEXT), Venue (TEXT), Num_of_Audience (INT)\ndebate_people: Debate_ID (INT), Affirmative (INT), Negative (INT), If_Affirmative_Win (BOOL)" }, { "query": "SELECT T3.Name , T2.Date , T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID", "question": "Show the names of people, and dates and venues of debates they are on the affirmative side.", "schema": "people: People_ID (INT), District (TEXT), Name (TEXT), Party (TEXT), Age (INT)\ndebate: Debate_ID (INT), Date (TEXT), Venue (TEXT), Num_of_Audience (INT)\ndebate_people: Debate_ID (INT), Affirmative (INT), Negative (INT), If_Affirmative_Win (BOOL)" }, { "query": "SELECT T3.Name , T2.Date , T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Negative = T3.People_ID ORDER BY T3.Name ASC", "question": "Show the names of people, and dates and venues of debates they are on the negative side, ordered in ascending alphabetical order of name.", "schema": "people: People_ID (INT), District (TEXT), Name (TEXT), Party (TEXT), Age (INT)\ndebate: Debate_ID (INT), Date (TEXT), Venue (TEXT), Num_of_Audience (INT)\ndebate_people: Debate_ID (INT), Affirmative (INT), Negative (INT), If_Affirmative_Win (BOOL)" }, { "query": "SELECT T3.Name FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID WHERE T2.Num_of_Audience > 200", "question": "Show the names of people that are on affirmative side of debates with number of audience bigger than 200.", "schema": "people: People_ID (INT), District (TEXT), Name (TEXT), Party (TEXT), Age (INT)\ndebate: Debate_ID (INT), Date (TEXT), Venue (TEXT), Num_of_Audience (INT)\ndebate_people: Debate_ID (INT), Affirmative (INT), Negative (INT), If_Affirmative_Win (BOOL)" }, { "query": "SELECT T2.Name , COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative = T2.People_ID GROUP BY T2.Name", "question": "Show the names of people and the number of times they have been on the affirmative side of debates.", "schema": "people: People_ID (INT), District (TEXT), Name (TEXT), Party (TEXT), Age (INT)\ndebate: Debate_ID (INT), Date (TEXT), Venue (TEXT), Num_of_Audience (INT)\ndebate_people: Debate_ID (INT), Affirmative (INT), Negative (INT), If_Affirmative_Win (BOOL)" }, { "query": "SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative = T2.People_ID GROUP BY T2.Name HAVING COUNT(*) >= 2", "question": "Show the names of people who have been on the negative side of debates at least twice.", "schema": "people: People_ID (INT), District (TEXT), Name (TEXT), Party (TEXT), Age (INT)\ndebate: Debate_ID (INT), Date (TEXT), Venue (TEXT), Num_of_Audience (INT)\ndebate_people: Debate_ID (INT), Affirmative (INT), Negative (INT), If_Affirmative_Win (BOOL)" }, { "query": "SELECT Name FROM people WHERE People_id NOT IN (SELECT Affirmative FROM debate_people)", "question": "List the names of people that have not been on the affirmative side of debates.", "schema": "people: People_ID (INT), District (TEXT), Name (TEXT), Party (TEXT), Age (INT)\ndebate: Debate_ID (INT), Date (TEXT), Venue (TEXT), Num_of_Audience (INT)\ndebate_people: Debate_ID (INT), Affirmative (INT), Negative (INT), If_Affirmative_Win (BOOL)" }, { "query": "SELECT customer_details FROM customers ORDER BY customer_details", "question": "List the names of all the customers in alphabetical order.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT customer_details FROM customers ORDER BY customer_details", "question": "Sort the customer names in alphabetical order.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT policy_type_code FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t2.customer_details = \"Dayana Robel\"", "question": "Find all the policy type codes associated with the customer \"Dayana Robel\"", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT policy_type_code FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t2.customer_details = \"Dayana Robel\"", "question": "What are the type codes of the policies used by the customer \"Dayana Robel\"?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT policy_type_code FROM policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1", "question": "Which type of policy is most frequently used? Give me the policy type code.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT policy_type_code FROM policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1", "question": "Find the type code of the most frequently used policy.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT policy_type_code FROM policies GROUP BY policy_type_code HAVING count(*) > 2", "question": "Find all the policy types that are used by more than 2 customers.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT policy_type_code FROM policies GROUP BY policy_type_code HAVING count(*) > 2", "question": "Which types of policy are chosen by more than 2 customers? Give me the policy type codes.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT sum(amount_piad) , avg(amount_piad) FROM claim_headers", "question": "Find the total and average amount paid in claim headers.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT sum(amount_piad) , avg(amount_piad) FROM claim_headers", "question": "What are the total amount and average amount paid in claim headers?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT sum(t1.amount_claimed) FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id = t2.claim_id WHERE t2.created_date = (SELECT created_date FROM claims_documents ORDER BY created_date LIMIT 1)", "question": "Find the total amount claimed in the most recently created document.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT sum(t1.amount_claimed) FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id = t2.claim_id WHERE t2.created_date = (SELECT created_date FROM claims_documents ORDER BY created_date LIMIT 1)", "question": "How much amount in total were claimed in the most recently created document?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_claimed = (SELECT max(amount_claimed) FROM claim_headers)", "question": "What is the name of the customer who has made the largest amount of claim in a single claim?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_claimed = (SELECT max(amount_claimed) FROM claim_headers)", "question": "Which customer made the largest amount of claim in a single claim? Return the customer details.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_piad = (SELECT min(amount_piad) FROM claim_headers)", "question": "What is the name of the customer who has made the minimum amount of payment in one claim?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_piad = (SELECT min(amount_piad) FROM claim_headers)", "question": "Which customer made the smallest amount of claim in one claim? Return the customer details.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT customer_details FROM customers EXCEPT SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id", "question": "Find the names of customers who have no policies associated.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT customer_details FROM customers EXCEPT SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id", "question": "What are the names of customers who do not have any policies?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT count(*) FROM claims_processing_stages", "question": "How many claim processing stages are there in total?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT count(*) FROM claims_processing_stages", "question": "Find the number of distinct stages in claim processing.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.claim_stage_id = t2.claim_stage_id GROUP BY t1.claim_stage_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of the claim processing stage that most of the claims are on?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.claim_stage_id = t2.claim_stage_id GROUP BY t1.claim_stage_id ORDER BY count(*) DESC LIMIT 1", "question": "Which claim processing stage has the most claims? Show the claim status name.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT customer_details FROM customers WHERE customer_details LIKE \"%Diana%\"", "question": "Find the names of customers whose name contains \"Diana\".", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT customer_details FROM customers WHERE customer_details LIKE \"%Diana%\"", "question": "Which customers have the substring \"Diana\" in their names? Return the customer details.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = \"Deputy\"", "question": "Find the names of the customers who have an deputy policy.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = \"Deputy\"", "question": "Which customers have an insurance policy with the type code \"Deputy\"? Give me the customer details.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = \"Deputy\" OR t1.policy_type_code = \"Uniform\"", "question": "Find the names of customers who either have an deputy policy or uniformed policy.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = \"Deputy\" OR t1.policy_type_code = \"Uniform\"", "question": "Which customers have an insurance policy with the type code \"Deputy\" or \"Uniform\"? Return the customer details.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT customer_details FROM customers UNION SELECT staff_details FROM staff", "question": "Find the names of all the customers and staff members.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT customer_details FROM customers UNION SELECT staff_details FROM staff", "question": "What are the names of the customers and staff members?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT policy_type_code , count(*) FROM policies GROUP BY policy_type_code", "question": "Find the number of records of each policy type and its type code.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT policy_type_code , count(*) FROM policies GROUP BY policy_type_code", "question": "For each policy type, return its type code and its count in the record.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY count(*) DESC LIMIT 1", "question": "Find the name of the customer that has been involved in the most policies.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY count(*) DESC LIMIT 1", "question": "Which customer have the most policies? Give me the customer details.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT claim_status_description FROM claims_processing_stages WHERE claim_status_name = \"Open\"", "question": "What is the description of the claim status \"Open\"?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT claim_status_description FROM claims_processing_stages WHERE claim_status_name = \"Open\"", "question": "Find the description of the claim status \"Open\".", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT count(DISTINCT claim_outcome_code) FROM claims_processing", "question": "How many distinct claim outcome codes are there?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT count(DISTINCT claim_outcome_code) FROM claims_processing", "question": "Count the number of distinct claim outcome codes.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.start_date = (SELECT max(start_date) FROM policies)", "question": "Which customer is associated with the latest policy?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.start_date = (SELECT max(start_date) FROM policies)", "question": "Find the customer who started a policy most recently.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Staff_Details (VARCHAR(255))\nPolicies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATETIME), End_Date (DATETIME)\nClaim_Headers: Claim_Header_ID (INTEGER), Claim_Status_Code (CHAR(15)), Claim_Type_Code (CHAR(15)), Policy_ID (INTEGER), Date_of_Claim (DATETIME), Date_of_Settlement (DATETIME), Amount_Claimed (DECIMAL(204)), Amount_Piad (DECIMAL(204))\nClaims_Documents: Claim_ID (INTEGER), Document_Type_Code (CHAR(15)), Created_by_Staff_ID (INTEGER), Created_Date (INTEGER)\nClaims_Processing_Stages: Claim_Stage_ID (INTEGER), Next_Claim_Stage_ID (INTEGER), Claim_Status_Name (VARCHAR(255)), Claim_Status_Description (VARCHAR(255))\nClaims_Processing: Claim_Processing_ID (INTEGER), Claim_ID (INTEGER), Claim_Outcome_Code (CHAR(15)), Claim_Stage_ID (INTEGER), Staff_ID (INTEGER)" }, { "query": "SELECT count(*) FROM Accounts", "question": "Show the number of accounts.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) FROM Accounts", "question": "How many accounts are there?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(DISTINCT customer_id) FROM Accounts", "question": "How many customers have opened an account?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(DISTINCT customer_id) FROM Accounts", "question": "Count the number of customers who have an account.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT account_id , date_account_opened , account_name , other_account_details FROM Accounts", "question": "Show the id, the date of account opened, the account name, and other account detail for all accounts.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT account_id , date_account_opened , account_name , other_account_details FROM Accounts", "question": "What are the ids, date opened, name, and other details for all accounts?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T1.account_id , T1.date_account_opened , T1.account_name , T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan'", "question": "Show the id, the account name, and other account details for all accounts by the customer with first name 'Meaghan'.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T1.account_id , T1.date_account_opened , T1.account_name , T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan'", "question": "What are the ids, names, dates of opening, and other details for accounts corresponding to the customer with the first name \"Meaghan\"?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T1.account_name , T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = \"Meaghan\" AND T2.customer_last_name = \"Keeling\"", "question": "Show the account name and other account detail for all accounts by the customer with first name Meaghan and last name Keeling.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T1.account_name , T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = \"Meaghan\" AND T2.customer_last_name = \"Keeling\"", "question": "What are the names and other details for accounts corresponding to the customer named Meaghan Keeling?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.customer_first_name , T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = \"900\"", "question": "Show the first name and last name for the customer with account name 900.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.customer_first_name , T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = \"900\"", "question": "What are the full names of customers with the account name 900?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts)", "question": "How many customers don't have an account?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts)", "question": "Count the number of customers who do not have an account.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT DISTINCT T1.customer_first_name , T1.customer_last_name , T1.phone_number FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id", "question": "Show the unique first names, last names, and phone numbers for all customers with any account.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT DISTINCT T1.customer_first_name , T1.customer_last_name , T1.phone_number FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id", "question": "What are the distinct first names, last names, and phone numbers for customers with accounts?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Accounts", "question": "Show customer ids who don't have an account.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Accounts", "question": "What are the customer ids for customers who do not have an account?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) , customer_id FROM Accounts GROUP BY customer_id", "question": "How many accounts does each customer have? List the number and customer id.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) , customer_id FROM Accounts GROUP BY customer_id", "question": "Count the number of accounts corresponding to each customer id.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the customer id, first and last name with most number of accounts.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1", "question": "Return the id and full name of the customer with the most accounts.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name , count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id", "question": "Show id, first name and last name for all customers and the number of accounts.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name , count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id", "question": "What are the the full names and ids for all customers, and how many accounts does each have?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.customer_first_name , T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 2", "question": "Show first name and id for all customers with at least 2 accounts.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.customer_first_name , T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 2", "question": "What are the first names and ids for customers who have two or more accounts?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) FROM Customers", "question": "Show the number of customers.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) FROM Customers", "question": "Count the number of customers.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT gender , count(*) FROM Customers GROUP BY gender", "question": "Show the number of customers for each gender.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT gender , count(*) FROM Customers GROUP BY gender", "question": "How many customers are there of each gender?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) FROM Financial_transactions", "question": "How many transactions do we have?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) FROM Financial_transactions", "question": "Count the number of transactions.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) , account_id FROM Financial_transactions", "question": "How many transaction does each account have? Show the number and account id.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) , account_id FROM Financial_transactions", "question": "Count the number of financial transactions that correspond to each account id.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id WHERE T2.account_name = \"337\"", "question": "How many transaction does account with name 337 have?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id WHERE T2.account_name = \"337\"", "question": "Count the number of financial transactions that the account with the name 337 has.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT avg(transaction_amount) , min(transaction_amount) , max(transaction_amount) , sum(transaction_amount) FROM Financial_transactions", "question": "What is the average, minimum, maximum, and total transaction amount?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT avg(transaction_amount) , min(transaction_amount) , max(transaction_amount) , sum(transaction_amount) FROM Financial_transactions", "question": "Return the average, minimum, maximum, and total transaction amounts.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT transaction_id FROM Financial_transactions WHERE transaction_amount > (SELECT avg(transaction_amount) FROM Financial_transactions)", "question": "Show ids for all transactions whose amounts are greater than the average.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT transaction_id FROM Financial_transactions WHERE transaction_amount > (SELECT avg(transaction_amount) FROM Financial_transactions)", "question": "What are the ids for transactions that have an amount greater than the average amount of a transaction?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT transaction_type , sum(transaction_amount) FROM Financial_transactions GROUP BY transaction_type", "question": "Show the transaction types and the total amount of transactions.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT transaction_type , sum(transaction_amount) FROM Financial_transactions GROUP BY transaction_type", "question": "What are total transaction amounts for each transaction type?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.account_name , T1.account_id , count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id", "question": "Show the account name, id and the number of transactions for each account.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.account_name , T1.account_id , count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id", "question": "Return the names and ids of each account, as well as the number of transactions.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY count(*) DESC LIMIT 1", "question": "Show the account id with most number of transactions.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the id of the account with the most transactions?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T1.account_id , T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id HAVING count(*) >= 4", "question": "Show the account id and name with at least 4 transactions.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T1.account_id , T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id HAVING count(*) >= 4", "question": "What are the ids and names of accounts with 4 or more transactions?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT DISTINCT product_size FROM Products", "question": "Show all product sizes.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT DISTINCT product_size FROM Products", "question": "What are the different product sizes?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT DISTINCT product_color FROM Products", "question": "Show all product colors.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT DISTINCT product_color FROM Products", "question": "What are the different product colors?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT invoice_number , count(*) FROM Financial_transactions GROUP BY invoice_number", "question": "Show the invoice number and the number of transactions for each invoice.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT invoice_number , count(*) FROM Financial_transactions GROUP BY invoice_number", "question": "How many transactions correspond to each invoice number?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.invoice_number , T2.invoice_date FROM Financial_transactions AS T1 JOIN Invoices AS T2 ON T1.invoice_number = T2.invoice_number GROUP BY T1.invoice_number ORDER BY count(*) DESC LIMIT 1", "question": "What is the invoice number and invoice date for the invoice with most number of transactions?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.invoice_number , T2.invoice_date FROM Financial_transactions AS T1 JOIN Invoices AS T2 ON T1.invoice_number = T2.invoice_number GROUP BY T1.invoice_number ORDER BY count(*) DESC LIMIT 1", "question": "What is the invoice number and invoice date corresponding to the invoice with the greatest number of transactions?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) FROM Invoices", "question": "How many invoices do we have?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) FROM Invoices", "question": "Count the number of invoices.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T1.invoice_date , T1.order_id , T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id", "question": "Show invoice dates and order id and details for all invoices.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T1.invoice_date , T1.order_id , T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id", "question": "What are the invoice dates, order ids, and order details for all invoices?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT order_id , count(*) FROM Invoices GROUP BY order_id", "question": "Show the order ids and the number of invoices for each order.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT order_id , count(*) FROM Invoices GROUP BY order_id", "question": "How many invoices correspond to each order id?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.order_id , T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id GROUP BY T2.order_id HAVING count(*) > 2", "question": "What is the order id and order details for the order more than two invoices.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.order_id , T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id GROUP BY T2.order_id HAVING count(*) > 2", "question": "Return the order ids and details for orderes with two or more invoices.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.customer_last_name , T1.customer_id , T2.phone_number FROM Orders AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the customer last name, id and phone number with most number of orders?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.customer_last_name , T1.customer_id , T2.phone_number FROM Orders AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1", "question": "Return the last name, id and phone number of the customer who has made the greatest number of orders.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT product_name FROM Products EXCEPT SELECT T1.product_name FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id = T2.product_id", "question": "Show all product names without an order.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT product_name FROM Products EXCEPT SELECT T1.product_name FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id = T2.product_id", "question": "What are the names of products that have never been ordered?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.product_name , sum(T1.product_quantity) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name", "question": "Show all product names and the total quantity ordered for each product name.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.product_name , sum(T1.product_quantity) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name", "question": "What are the different product names, and what is the sum of quantity ordered for each product?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT order_id , count(*) FROM Order_items GROUP BY order_id", "question": "Show the order ids and the number of items in each order.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT order_id , count(*) FROM Order_items GROUP BY order_id", "question": "How many order items correspond to each order id?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT product_id , count(DISTINCT order_id) FROM Order_items GROUP BY product_id", "question": "Show the product ids and the number of unique orders containing each product.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT product_id , count(DISTINCT order_id) FROM Order_items GROUP BY product_id", "question": "How many distinct order ids correspond to each product?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.product_name , count(*) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id JOIN Orders AS T3 ON T3.order_id = T1.order_id GROUP BY T2.product_name", "question": "Show all product names and the number of customers having an order on each product.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT T2.product_name , count(*) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id JOIN Orders AS T3 ON T3.order_id = T1.order_id GROUP BY T2.product_name", "question": "What are teh names of the different products, as well as the number of customers who have ordered each product.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT order_id , count(DISTINCT product_id) FROM Order_items GROUP BY order_id", "question": "Show order ids and the number of products in each order.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT order_id , count(DISTINCT product_id) FROM Order_items GROUP BY order_id", "question": "How many different products correspond to each order id?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT order_id , sum(product_quantity) FROM Order_items GROUP BY order_id", "question": "Show order ids and the total quantity in each order.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT order_id , sum(product_quantity) FROM Order_items GROUP BY order_id", "question": "Give the order ids for all orders, as well as the total product quantity in each.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) FROM products WHERE product_id NOT IN ( SELECT product_id FROM Order_items )", "question": "How many products were not included in any order?", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) FROM products WHERE product_id NOT IN ( SELECT product_id FROM Order_items )", "question": "Count the number of products that were never ordered.", "schema": "Customers: customer_id (INTEGER), customer_first_name (VARCHAR(50)), customer_middle_initial (VARCHAR(1)), customer_last_name (VARCHAR(50)), gender (VARCHAR(1)), email_address (VARCHAR(255)), login_name (VARCHAR(80)), login_password (VARCHAR(20)), phone_number (VARCHAR(255)), town_city (VARCHAR(50)), state_county_province (VARCHAR(50)), country (VARCHAR(50))\nOrders: order_id (INTEGER), customer_id (INTEGER), date_order_placed (DATETIME), order_details (VARCHAR(255))\nInvoices: invoice_number (INTEGER), order_id (INTEGER), invoice_date (DATETIME)\nAccounts: account_id (INTEGER), customer_id (INTEGER), date_account_opened (DATETIME), account_name (VARCHAR(50)), other_account_details (VARCHAR(255))\nProduct_Categories: production_type_code (VARCHAR(15)), product_type_description (VARCHAR(80)), vat_rating (DECIMAL(194))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), production_type_code (VARCHAR(15)), unit_price (DECIMAL(194)), product_name (VARCHAR(80)), product_color (VARCHAR(20)), product_size (VARCHAR(20))\nFinancial_Transactions: transaction_id (INTEGER), account_id (INTEGER), invoice_number (INTEGER), transaction_type (VARCHAR(15)), transaction_date (DATETIME), transaction_amount (DECIMAL(194)), transaction_comment (VARCHAR(255)), other_transaction_details (VARCHAR(255))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), product_quantity (VARCHAR(50)), other_order_item_details (VARCHAR(255))\nInvoice_Line_Items: order_item_id (INTEGER), invoice_number (INTEGER), product_id (INTEGER), product_title (VARCHAR(80)), product_quantity (VARCHAR(50)), product_price (DECIMAL(194)), derived_product_cost (DECIMAL(194)), derived_vat_payable (DECIMAL(194)), derived_total_cost (DECIMAL(194))" }, { "query": "SELECT count(*) FROM Church WHERE Open_Date < 1850", "question": "How many churches opened before 1850 are there?", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT name , open_date , organized_by FROM Church", "question": "Show the name, open date, and organizer for all churches.", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT name FROM church ORDER BY open_date DESC", "question": "List all church names in descending order of opening date.", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT open_date FROM church GROUP BY open_date HAVING count(*) >= 2", "question": "Show the opening year in whcih at least two churches opened.", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT organized_by , name FROM church WHERE open_date BETWEEN 1830 AND 1840", "question": "Show the organizer and name for churches that opened between 1830 and 1840.", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT open_date , count(*) FROM church GROUP BY open_date", "question": "Show all opening years and the number of churches that opened in that year.", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT name , open_date FROM church ORDER BY open_date DESC LIMIT 3", "question": "Show the name and opening year for three churches that opened most recently.", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT count(*) FROM people WHERE is_male = 'F' AND age > 30", "question": "How many female people are older than 30 in our record?", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT country FROM people WHERE age < 25 INTERSECT SELECT country FROM people WHERE age > 30", "question": "Show the country where people older than 30 and younger than 25 are from.", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT min(age) , max(age) , avg(age) FROM people", "question": "Show the minimum, maximum, and average age for all people.", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT name , country FROM people WHERE age < (SELECT avg(age) FROM people)", "question": "Show the name and country for all people whose age is smaller than the average.", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT T2.name , T3.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id WHERE T1.year > 2014", "question": "Show the pair of male and female names in all weddings after year 2014", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT name , age FROM people WHERE is_male = 'T' AND people_id NOT IN (SELECT male_id FROM wedding)", "question": "Show the name and age for all male people who don't have a wedding.", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT name FROM church EXCEPT SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id WHERE T2.year = 2015", "question": "Show all church names except for those that had a wedding in year 2015.", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id GROUP BY T1.church_id HAVING count(*) >= 2", "question": "Show all church names that have hosted least two weddings.", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id WHERE T1.year = 2016 AND T2.is_male = 'F' AND T2.country = 'Canada'", "question": "Show the names for all females from Canada having a wedding in year 2016.", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT count(*) FROM wedding WHERE YEAR = 2016", "question": "How many weddings are there in year 2016?", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT T4.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id JOIN church AS T4 ON T4.church_id = T1.church_id WHERE T2.age > 30 OR T3.age > 30", "question": "Show the church names for the weddings of all people older than 30.", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT country , count(*) FROM people GROUP BY country", "question": "Show all countries and the number of people from each country.", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT COUNT (DISTINCT church_id) FROM wedding WHERE YEAR = 2016", "question": "How many churches have a wedding in year 2016?", "schema": "people: People_ID (INT), Name (TEXT), Country (TEXT), Is_Male (TEXT), Age (INT)\nchurch: Church_ID (INT), Name (TEXT), Organized_by (TEXT), Open_Date (INT), Continuation_of (TEXT)\nwedding: Church_ID (INT), Male_ID (INT), Female_ID (INT), Year (INT)" }, { "query": "SELECT count(*) FROM artist", "question": "How many artists do we have?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT count(*) FROM artist", "question": "Count the number of artists.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT name , age , country FROM artist ORDER BY Year_Join", "question": "Show all artist name, age, and country ordered by the yeared they joined.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT name , age , country FROM artist ORDER BY Year_Join", "question": "What are the names, ages, and countries of artists, sorted by the year they joined?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT DISTINCT country FROM artist", "question": "What are all distinct country for artists?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT DISTINCT country FROM artist", "question": "Return the different countries for artists.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT name , year_join FROM artist WHERE country != 'United States'", "question": "Show all artist names and the year joined who are not from United States.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT name , year_join FROM artist WHERE country != 'United States'", "question": "What are the names and year of joining for artists that do not have the country \"United States\"?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT count(*) FROM artist WHERE age > 46 AND year_join > 1990", "question": "How many artists are above age 46 and joined after 1990?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT count(*) FROM artist WHERE age > 46 AND year_join > 1990", "question": "Count the number of artists who are older than 46 and joined after 1990.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT avg(age) , min(age) FROM artist WHERE country = 'United States'", "question": "What is the average and minimum age of all artists from United States.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT avg(age) , min(age) FROM artist WHERE country = 'United States'", "question": "Return the average and minimum ages across artists from the United States.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT name FROM artist ORDER BY year_join DESC LIMIT 1", "question": "What is the name of the artist who joined latest?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT name FROM artist ORDER BY year_join DESC LIMIT 1", "question": "Return the name of the artist who has the latest join year.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT count(*) FROM exhibition WHERE YEAR >= 2005", "question": "How many exhibition are there in year 2005 or after?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT count(*) FROM exhibition WHERE YEAR >= 2005", "question": "Count the number of exhibitions that happened in or after 2005.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT theme , YEAR FROM exhibition WHERE ticket_price < 15", "question": "Show theme and year for all exhibitions with ticket prices lower than 15.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT theme , YEAR FROM exhibition WHERE ticket_price < 15", "question": "What are the theme and year for all exhibitions that have a ticket price under 15?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT T2.name , count(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id", "question": "Show all artist names and the number of exhibitions for each artist.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT T2.name , count(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id", "question": "How many exhibitions has each artist had?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT T2.name , T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the name and country for the artist with most number of exhibitions?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT T2.name , T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id ORDER BY count(*) DESC LIMIT 1", "question": "Return the name and country corresponding to the artist who has had the most exhibitions.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT name FROM artist WHERE artist_id NOT IN (SELECT artist_id FROM exhibition)", "question": "Show names for artists without any exhibition.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT name FROM artist WHERE artist_id NOT IN (SELECT artist_id FROM exhibition)", "question": "What are the names of artists that have not had any exhibitions?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT T1.theme , T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.ticket_price > (SELECT avg(ticket_price) FROM exhibition)", "question": "What is the theme and artist name for the exhibition with a ticket price higher than the average?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT T1.theme , T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.ticket_price > (SELECT avg(ticket_price) FROM exhibition)", "question": "Return the names of artists and the themes of their exhibitions that had a ticket price higher than average.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT avg(ticket_price) , min(ticket_price) , max(ticket_price) FROM exhibition WHERE YEAR < 2009", "question": "Show the average, minimum, and maximum ticket prices for exhibitions for all years before 2009.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT avg(ticket_price) , min(ticket_price) , max(ticket_price) FROM exhibition WHERE YEAR < 2009", "question": "What are the average, minimum, and maximum ticket prices for exhibitions that happened prior to 2009?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT theme , YEAR FROM exhibition ORDER BY ticket_price DESC", "question": "Show theme and year for all exhibitions in an descending order of ticket price.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT theme , YEAR FROM exhibition ORDER BY ticket_price DESC", "question": "What are the themes and years for exhibitions, sorted by ticket price descending?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT T2.theme , T1.date , T1.attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T2.year = 2004", "question": "What is the theme, date, and attendance for the exhibition in year 2004?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT T2.theme , T1.date , T1.attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T2.year = 2004", "question": "Return the themes, dates, and attendance for exhibitions that happened in 2004.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.year = 2004", "question": "Show all artist names who didn't have an exhibition in 2004.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.year = 2004", "question": "What are the names of artists who did not have an exhibition in 2004?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance < 100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 500", "question": "Show the theme for exhibitions with both records of an attendance below 100 and above 500.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance < 100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 500", "question": "Which themes have had corresponding exhibitions that have had attendance both below 100 and above 500?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT count(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 100 OR T2.ticket_price < 10", "question": "How many exhibitions have a attendance more than 100 or have a ticket price below 10?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT count(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 100 OR T2.ticket_price < 10", "question": "Count the number of exhibitions that have had an attendnance of over 100 or a ticket prices under 10.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT T3.name FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id JOIN artist AS T3 ON T3.artist_id = T2.artist_id GROUP BY T3.artist_id HAVING avg(T1.attendance) > 200", "question": "Show all artist names with an average exhibition attendance over 200.", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT T3.name FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id JOIN artist AS T3 ON T3.artist_id = T2.artist_id GROUP BY T3.artist_id HAVING avg(T1.attendance) > 200", "question": "What are the names of artist whose exhibitions draw over 200 attendees on average?", "schema": "artist: Artist_ID (INT), Name (TEXT), Country (TEXT), Year_Join (INT), Age (INT)\nexhibition: Exhibition_ID (INT), Year (INT), Theme (TEXT), Artist_ID (INT), Ticket_Price (REAL)\nexhibition_record: Exhibition_ID (INT), Date (TEXT), Attendance (INT)" }, { "query": "SELECT count(*) FROM player", "question": "How many players are there?", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT Player_name FROM player ORDER BY Votes ASC", "question": "List the names of players in ascending order of votes.", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT Gender , Occupation FROM player", "question": "What are the gender and occupation of players?", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT Player_name , residence FROM player WHERE Occupation != \"Researcher\"", "question": "List the name and residence for players whose occupation is not \"Researcher\".", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT Sponsor_name FROM player WHERE Residence = \"Brandon\" OR Residence = \"Birtle\"", "question": "Show the names of sponsors of players whose residence is either \"Brandon\" or \"Birtle\".", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT Player_name FROM player ORDER BY Votes DESC LIMIT 1", "question": "What is the name of the player with the largest number of votes?", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT Occupation , COUNT(*) FROM player GROUP BY Occupation", "question": "Show different occupations along with the number of players in each occupation.", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT Occupation FROM player GROUP BY Occupation ORDER BY COUNT(*) DESC LIMIT 1", "question": "Please show the most common occupation of players.", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT Residence FROM player GROUP BY Residence HAVING COUNT(*) >= 2", "question": "Show the residences that have at least two players.", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT T3.Player_name , T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID", "question": "Show the names of players and names of their coaches.", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT T3.Player_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T2.Rank = 1", "question": "Show the names of players coached by the rank 1 coach.", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT T3.Player_name , T3.gender FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T1.Starting_year > 2011", "question": "Show the names and genders of players with a coach starting after 2011.", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT T3.Player_name , T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID ORDER BY T3.Votes DESC", "question": "Show the names of players and names of their coaches in descending order of the votes of players.", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT Player_name FROM player WHERE Player_ID NOT IN (SELECT Player_ID FROM player_coach)", "question": "List the names of players that do not have coaches.", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT Residence FROM player WHERE gender = \"M\" INTERSECT SELECT Residence FROM player WHERE gender = \"F\"", "question": "Show the residences that have both a player of gender \"M\" and a player of gender \"F\".", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT T1.club_id , T1.club_name, count(*) FROM club AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id", "question": "How many coaches does each club has? List the club id, name and the number of coaches.", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT T1.club_id , T1.gold FROM match_result AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id ORDER BY count(*) DESC LIMIT 1", "question": "How many gold medals has the club with the most coaches won?", "schema": "player: Player_ID (INT), Sponsor_name (TEXT), Player_name (TEXT), Gender (TEXT), Residence (TEXT), Occupation (TEXT), Votes (INT), Rank (TEXT)\nclub: Club_ID (INT), Club_name (TEXT), Region (TEXT), Start_year (INT)\ncoach: Coach_ID (INT), Coach_name (TEXT), Gender (TEXT), Club_ID (INT), Rank (INT)\nplayer_coach: Player_ID (INT), Coach_ID (INT), Starting_year (INT)\nmatch_result: Rank (INT), Club_ID (INT), Gold (INT), Big_Silver (INT), Small_Silver (INT), Bronze (INT), Points (INT)" }, { "query": "SELECT count(*) FROM gymnast", "question": "How many gymnasts are there?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT count(*) FROM gymnast", "question": "Count the number of gymnasts.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT Total_Points FROM gymnast ORDER BY Total_Points DESC", "question": "List the total points of gymnasts in descending order.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT Total_Points FROM gymnast ORDER BY Total_Points DESC", "question": "What are the total points for all gymnasts, ordered by total points descending?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT Total_Points FROM gymnast ORDER BY Floor_Exercise_Points DESC", "question": "List the total points of gymnasts in descending order of floor exercise points.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT Total_Points FROM gymnast ORDER BY Floor_Exercise_Points DESC", "question": "What are the total points of gymnasts, ordered by their floor exercise points descending?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT avg(Horizontal_Bar_Points) FROM gymnast", "question": "What is the average horizontal bar points for all gymnasts?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT avg(Horizontal_Bar_Points) FROM gymnast", "question": "Return the average horizontal bar points across all gymnasts.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT Name FROM People ORDER BY Name ASC", "question": "What are the names of people in ascending alphabetical order?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT Name FROM People ORDER BY Name ASC", "question": "Return the names of people, ordered alphabetically.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID", "question": "What are the names of gymnasts?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID", "question": "Return the names of the gymnasts.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown != \"Santo Domingo\"", "question": "What are the names of gymnasts whose hometown is not \"Santo Domingo\"?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown != \"Santo Domingo\"", "question": "Return the names of gymnasts who did not grow up in Santo Domingo.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT Age FROM people ORDER BY Height DESC LIMIT 1", "question": "What is the age of the tallest person?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT Age FROM people ORDER BY Height DESC LIMIT 1", "question": "Return the age of the person with the greatest height.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT Name FROM People ORDER BY Age DESC LIMIT 5", "question": "List the names of the top 5 oldest people.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT Name FROM People ORDER BY Age DESC LIMIT 5", "question": "What are the names of the five oldest people?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC LIMIT 1", "question": "What is the total point count of the youngest gymnast?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC LIMIT 1", "question": "Return the total points of the gymnast with the lowest age.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT avg(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID", "question": "What is the average age of all gymnasts?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT avg(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID", "question": "Return the average age across all gymnasts.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5", "question": "What are the distinct hometowns of gymnasts with total points more than 57.5?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5", "question": "Give the different hometowns of gymnasts that have a total point score of above 57.5.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T2.Hometown , COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown", "question": "What are the hometowns of gymnasts and the corresponding number of gymnasts?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T2.Hometown , COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown", "question": "How many gymnasts are from each hometown?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the most common hometown of gymnasts?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC LIMIT 1", "question": "Return the hometown that is most common among gymnasts.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*) >= 2", "question": "What are the hometowns that are shared by at least two gymnasts?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*) >= 2", "question": "Give the hometowns from which two or more gymnasts are from.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height ASC", "question": "List the names of gymnasts in ascending order by their heights.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height ASC", "question": "What are the names of gymnasts, ordered by their heights ascending?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID", "question": "List the distinct hometowns that are not associated with any gymnast.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID", "question": "From which hometowns did no gymnasts come from?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20", "question": "Show the hometowns shared by people older than 23 and younger than 20.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20", "question": "From which hometowns did both people older than 23 and younger than 20 come from?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT count(DISTINCT Hometown) FROM people", "question": "How many distinct hometowns did these people have?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT count(DISTINCT Hometown) FROM people", "question": "Count the number of different hometowns of these people.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T1.Total_Points DESC", "question": "Show the ages of gymnasts in descending order of total points.", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T1.Total_Points DESC", "question": "What are the ages of the gymnasts, ordered descending by their total points?", "schema": "gymnast: Gymnast_ID (INT), Floor_Exercise_Points (REAL), Pommel_Horse_Points (REAL), Rings_Points (REAL), Vault_Points (REAL), Parallel_Bars_Points (REAL), Horizontal_Bar_Points (REAL), Total_Points (REAL)\npeople: People_ID (INT), Name (TEXT), Age (REAL), Height (REAL), Hometown (TEXT)" }, { "query": "SELECT count(*) FROM browser WHERE market_share >= 5", "question": "How many main stream browsers whose market share is at least 5 exist?", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT name FROM browser ORDER BY market_share DESC", "question": "List the name of browsers in descending order by market share.", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT id , name , market_share FROM browser", "question": "List the ids, names and market shares of all browsers.", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT max(market_share) , min(market_share) , avg(market_share) FROM browser", "question": "What is the maximum, minimum and average market share of the listed browsers?", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT id , market_share FROM browser WHERE name = 'Safari'", "question": "What is the id and market share of the browser Safari?", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT name , operating_system FROM web_client_accelerator WHERE CONNECTION != 'Broadband'", "question": "What are the name and os of web client accelerators that do not work with only a 'Broadband' type connection?", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id JOIN web_client_accelerator AS T3 ON T2.accelerator_id = T3.id WHERE T3.name = 'CProxy' AND T2.compatible_since_year > 1998", "question": "What is the name of the browser that became compatible with the accelerator 'CProxy' after year 1998 ?", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT T1.id , T1.Name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id GROUP BY T1.id HAVING count(*) >= 2", "question": "What are the ids and names of the web accelerators that are compatible with two or more browsers?", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT T1.id , T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1", "question": "What is the id and name of the browser that is compatible with the most web accelerators?", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT T1.compatible_since_year FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id WHERE T3.name = 'CACHEbox' AND T2.name = 'Internet Explorer'", "question": "When did the web accelerator 'CACHEbox' and browser 'Internet Explorer' become compatible?", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT count(DISTINCT client) FROM web_client_accelerator", "question": "How many different kinds of clients are supported by the web clients accelerators?", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT count(*) FROM web_client_accelerator WHERE id NOT IN ( SELECT accelerator_id FROM accelerator_compatible_browser );", "question": "How many accelerators are not compatible with the browsers listed ?", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT DISTINCT T1.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.market_share > 15;", "question": "What distinct accelerator names are compatible with the browswers that have market share higher than 15?", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'CACHEbox' INTERSECT SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'Fasterfox'", "question": "List the names of the browser that are compatible with both 'CACHEbox' and 'Fasterfox'.", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT name , operating_system FROM web_client_accelerator EXCEPT SELECT T1.name , T1.operating_system FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.name = 'Opera'", "question": "Show the accelerator names and supporting operating systems that are not compatible with the browser named 'Opera'.", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT name FROM web_client_accelerator WHERE name LIKE \"%Opera%\"", "question": "Which accelerator name contains substring \"Opera\"?", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT Operating_system , count(*) FROM web_client_accelerator GROUP BY Operating_system", "question": "Find the number of web accelerators used for each Operating system.", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT T2.name , T3.name FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id ORDER BY T1.compatible_since_year DESC", "question": "give me names of all compatible browsers and accelerators in the descending order of compatible year", "schema": "Web_client_accelerator: id (INT), name (TEXT), Operating_system (TEXT), Client (TEXT), Connection (TEXT)\nbrowser: id (INT), name (TEXT), market_share (REAL)\naccelerator_compatible_browser: accelerator_id (INT), browser_id (INT), compatible_since_year (INT)" }, { "query": "SELECT count(*) FROM wrestler", "question": "How many wrestlers are there?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT count(*) FROM wrestler", "question": "Count the number of wrestlers.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Name FROM wrestler ORDER BY Days_held DESC", "question": "List the names of wrestlers in descending order of days held.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Name FROM wrestler ORDER BY Days_held DESC", "question": "What are the names of the wrestlers, ordered descending by days held?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Name FROM wrestler ORDER BY Days_held ASC LIMIT 1", "question": "What is the name of the wrestler with the fewest days held?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Name FROM wrestler ORDER BY Days_held ASC LIMIT 1", "question": "Return the name of the wrestler who had the lowest number of days held.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT DISTINCT Reign FROM wrestler WHERE LOCATION != \"Tokyo , Japan\"", "question": "What are the distinct reigns of wrestlers whose location is not \"Tokyo,Japan\" ?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT DISTINCT Reign FROM wrestler WHERE LOCATION != \"Tokyo , Japan\"", "question": "Give the different reigns of wrestlers who are not located in Tokyo, Japan.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Name , LOCATION FROM wrestler", "question": "What are the names and location of the wrestlers?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Name , LOCATION FROM wrestler", "question": "Give the names and locations of all wrestlers.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Elimination_Move FROM Elimination WHERE Team = \"Team Orton\"", "question": "What are the elimination moves of wrestlers whose team is \"Team Orton\"?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Elimination_Move FROM Elimination WHERE Team = \"Team Orton\"", "question": "Return the elimination movies of wrestlers on Team Orton.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT T2.Name , T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID", "question": "What are the names of wrestlers and the elimination moves?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT T2.Name , T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID", "question": "Give the names of wrestlers and their elimination moves.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT T2.Name , T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC", "question": "List the names of wrestlers and the teams in elimination in descending order of days held.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT T2.Name , T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC", "question": "What are the names of wrestlers and their teams in elimination, ordered descending by days held?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1", "question": "List the time of elimination of the wrestlers with largest days held.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1", "question": "What is the time of elimination for the wrestler with the most days held?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T2.Days_held > 50", "question": "Show times of elimination of wrestlers with days held more than 50.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T2.Days_held > 50", "question": "What are the times of elimination for wrestlers with over 50 days held?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Team , COUNT(*) FROM elimination GROUP BY Team", "question": "Show different teams in eliminations and the number of eliminations from each team.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Team , COUNT(*) FROM elimination GROUP BY Team", "question": "How many eliminations did each team have?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*) > 3", "question": "Show teams that have suffered more than three eliminations.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*) > 3", "question": "Which teams had more than 3 eliminations?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Reign , Days_held FROM wrestler", "question": "Show the reign and days held of wrestlers.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Reign , Days_held FROM wrestler", "question": "What are the reigns and days held of all wrestlers?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Name FROM wrestler WHERE Days_held < 100", "question": "What are the names of wrestlers days held less than 100?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Name FROM wrestler WHERE Days_held < 100", "question": "Return the names of wrestlers with fewer than 100 days held.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1", "question": "Please show the most common reigns of wrestlers.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1", "question": "Which reign is the most common among wrestlers?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*) > 2", "question": "List the locations that are shared by more than two wrestlers.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*) > 2", "question": "Which locations are shared by more than two wrestlers?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Name FROM wrestler WHERE Wrestler_ID NOT IN (SELECT Wrestler_ID FROM elimination)", "question": "List the names of wrestlers that have not been eliminated.", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Name FROM wrestler WHERE Wrestler_ID NOT IN (SELECT Wrestler_ID FROM elimination)", "question": "What are the names of wrestlers who have never been eliminated?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Team FROM Elimination WHERE Eliminated_By = \"Orton\" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By = \"Benjamin\"", "question": "Show the teams that have both wrestlers eliminated by \"Orton\" and wrestlers eliminated by \"Benjamin\".", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT Team FROM Elimination WHERE Eliminated_By = \"Orton\" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By = \"Benjamin\"", "question": "What are the teams that have both wrestlers eliminated by Orton and wrestlers eliminated by Benjamin?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT COUNT (DISTINCT team) FROM elimination", "question": "What is the number of distinct teams that suffer elimination?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT COUNT (DISTINCT team) FROM elimination", "question": "How many different teams have had eliminated wrestlers?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT TIME FROM elimination WHERE Eliminated_By = \"Punk\" OR Eliminated_By = \"Orton\"", "question": "Show the times of elimination by \"Punk\" or \"Orton\".", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT TIME FROM elimination WHERE Eliminated_By = \"Punk\" OR Eliminated_By = \"Orton\"", "question": "What are the times of elimination for any instances in which the elimination was done by Punk or Orton?", "schema": "wrestler: Wrestler_ID (INT), Name (TEXT), Reign (TEXT), Days_held (TEXT), Location (TEXT), Event (TEXT)\nElimination: Elimination_ID (TEXT), Wrestler_ID (TEXT), Team (TEXT), Eliminated_By (TEXT), Elimination_Move (TEXT), Time (TEXT)" }, { "query": "SELECT count(*) FROM school", "question": "How many schools are there?", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT count(*) FROM school", "question": "Count the number of schools.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT school_name FROM school ORDER BY school_name", "question": "Show all school names in alphabetical order.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT school_name , LOCATION , mascot FROM school", "question": "List the name, location, mascot for all schools.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT sum(enrollment) , avg(enrollment) FROM school", "question": "What are the total and average enrollment of all schools?", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT mascot FROM school WHERE enrollment > (SELECT avg(enrollment) FROM school)", "question": "What are the mascots for schools with enrollments above the average?", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT school_name FROM school ORDER BY enrollment LIMIT 1", "question": "List the name of the school with the smallest enrollment.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT avg(enrollment) , max(enrollment) , min(enrollment) FROM school", "question": "Show the average, maximum, minimum enrollment of all schools.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT county , count(*) , sum(enrollment) FROM school GROUP BY county", "question": "Show each county along with the number of schools and total enrollment in each county.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT count(DISTINCT T1.donator_name) FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = \"Glenn\"", "question": "How many donors have endowment for school named \"Glenn\"?", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT donator_name , sum(amount) FROM endowment GROUP BY donator_name ORDER BY sum(amount) DESC", "question": "List each donator name and the amount of endowment in descending order of the amount of endowment.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT school_name FROM school WHERE school_id NOT IN (SELECT school_id FROM endowment)", "question": "List the names of the schools without any endowment.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id HAVING sum(T1.amount) <= 10", "question": "List all the names of schools with an endowment amount smaller than or equal to 10.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn' INTERSECT SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Triton'", "question": "Show the names of donors who donated to both school \"Glenn\" and \"Triton.\"", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount < 9", "question": "Show the names of all the donors except those whose donation amount less than 9.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT amount , donator_name FROM endowment ORDER BY amount DESC LIMIT 1", "question": "List the amount and donor name for the largest amount of donation.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT count(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001", "question": "How many budgets are above 3000 in year 2001 or before?", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT count(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001", "question": "Count the number of budgets in year 2001 or before whose budgeted amount is greater than 3000", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT T2.school_name , T1.budgeted , T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.year >= 2002", "question": "Show each school name, its budgeted amount, and invested amount in year 2002 or after.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT DISTINCT donator_name FROM endowment", "question": "Show all donor names.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT count(*) FROM budget WHERE budgeted < invested", "question": "How many budget record has a budget amount smaller than the invested amount?", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT sum(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn'", "question": "What is the total budget amount for school \"Glenn\" in all years?", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN endowment AS T3 ON T2.school_id = T3.school_id GROUP BY T2.school_name HAVING sum(T1.budgeted) > 100 OR sum(T3.amount) > 10", "question": "Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.amount > 8.5 GROUP BY T1.school_id HAVING count(*) > 1", "question": "Find the names of schools that have more than one donator with donation amount above 8.5.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT count(*) FROM (SELECT * FROM endowment WHERE amount > 8.5 GROUP BY school_id HAVING count(*) > 1)", "question": "Find the number of schools that have more than one donator whose donation amount is less than 8.5.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT T1.School_name , T1.Mascot , T1.IHSAA_Football_Class FROM school AS T1 JOIN budget AS T2 ON T1.school_id = T2.school_id WHERE Budgeted > 6000 OR YEAR < 2003 ORDER BY T2.total_budget_percent_invested , T2.total_budget_percent_budgeted", "question": "List the name, IHSAA Football Class, and Mascot of the schools that have more than 6000 of budgeted amount or were founded before 2003, in the order of percent of total invested budget and total budgeted budget.", "schema": "School: School_id (TEXT), School_name (TEXT), Location (TEXT), Mascot (TEXT), Enrollment (INT), IHSAA_Class (TEXT), IHSAA_Football_Class (TEXT), County (TEXT)\nbudget: School_id (INT), Year (INT), Budgeted (INT), total_budget_percent_budgeted (REAL), Invested (INT), total_budget_percent_invested (REAL), Budget_invested_percent (TEXT)\nendowment: endowment_id (INT), School_id (INT), donator_name (TEXT), amount (REAL)" }, { "query": "SELECT count(*) FROM building", "question": "How many buildings are there?", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT name , street_address , floors FROM building ORDER BY floors", "question": "Show the name, street address, and number of floors for all buildings ordered by the number of floors.", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT name FROM building ORDER BY height_feet DESC LIMIT 1", "question": "What is the name of the tallest building?", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT avg(floors) , max(floors) , min(floors) FROM building", "question": "What are the average, maximum, and minimum number of floors for all buildings?", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT count(*) FROM building WHERE height_feet > (SELECT avg(height_feet) FROM building) OR floors > (SELECT avg(floors) FROM building)", "question": "Show the number of buildings with a height above the average or a number of floors above the average.", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20", "question": "List the names of buildings with at least 200 feet of height and with at least 20 floors.", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT institution , LOCATION FROM institution WHERE founded > 1990 AND TYPE = 'Private'", "question": "Show the names and locations of institutions that are founded after 1990 and have the type \"Private\".", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT TYPE , count(*) , sum(enrollment) FROM institution GROUP BY TYPE", "question": "Show institution types, along with the number of institutions and total enrollment for each type.", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT TYPE FROM institution GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1", "question": "Show the institution type with the largest number of institutions.", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000", "question": "Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment.", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT name FROM building WHERE building_id NOT IN (SELECT building_id FROM institution)", "question": "Show the name of buildings that do not have any institution.", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003", "question": "Show the names of buildings except for those having an institution founded in 2003.", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT T1.name , count(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id", "question": "For each building, show the name of the building and the number of institutions in it.", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT T1.name , T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING count(*) >= 2", "question": "Show the names and heights of buildings with at least two institutions founded after 1880.", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT DISTINCT TYPE FROM institution", "question": "Show all the distinct institution types.", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT T1.institution , count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id GROUP BY T1.institution_id", "question": "Show institution names along with the number of proteins for each institution.", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880 OR T1.type = 'Private'", "question": "How many proteins are associated with an institution founded after 1880 or an institution with type \"Private\"?", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT T2.protein_name , T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id", "question": "Show the protein name and the institution name.", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 20", "question": "How many proteins are associated with an institution in a building with at least 20 floors?", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT count(*) FROM institution WHERE institution_id NOT IN (SELECT institution_id FROM protein)", "question": "How many institutions do not have an associated protein in our record?", "schema": "building: building_id (TEXT), Name (TEXT), Street_address (TEXT), Years_as_tallest (TEXT), Height_feet (INT), Floors (INT)\nInstitution: Institution_id (TEXT), Institution (TEXT), Location (TEXT), Founded (REAL), Type (TEXT), Enrollment (INT), Team (TEXT), Primary_Conference (TEXT), building_id (TEXT)\nprotein: common_name (TEXT), protein_name (TEXT), divergence_from_human_lineage (REAL), accession_number (TEXT), sequence_length (REAL), sequence_identity_to_human_protein (TEXT), Institution_id (TEXT)" }, { "query": "SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity > 800", "question": "Show all the locations where no cinema has capacity over 800.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT LOCATION FROM cinema WHERE openning_year = 2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year = 2011", "question": "Show all the locations where some cinemas were opened in both year 2010 and year 2011.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT count(*) FROM cinema", "question": "How many cinema do we have?", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT count(*) FROM cinema", "question": "Count the number of cinemas.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT name , openning_year , capacity FROM cinema", "question": "Show name, opening year, and capacity for each cinema.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT name , LOCATION FROM cinema WHERE capacity > (SELECT avg(capacity) FROM cinema)", "question": "Show the cinema name and location for cinemas with capacity above average.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT DISTINCT LOCATION FROM cinema", "question": "What are all the locations with a cinema?", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT DISTINCT LOCATION FROM cinema", "question": "Find the distinct locations that has a cinema.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT name , openning_year FROM cinema ORDER BY openning_year DESC", "question": "Show all the cinema names and opening years in descending order of opening year.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT name , LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1", "question": "What are the name and location of the cinema with the largest capacity?", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT avg(capacity) , min(capacity) , max(capacity) FROM cinema WHERE openning_year >= 2011", "question": "Show the average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT LOCATION , count(*) FROM cinema GROUP BY LOCATION", "question": "Show each location and the number of cinemas there.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT LOCATION FROM cinema WHERE openning_year >= 2010 GROUP BY LOCATION ORDER BY count(*) DESC LIMIT 1", "question": "What is the location with the most cinemas opened in year 2010 or later?", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) >= 2", "question": "Show all the locations with at least two cinemas with capacity above 300.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) >= 2", "question": "Which locations have 2 or more cinemas with capacity over 300?", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT title , directed_by FROM film", "question": "Show the title and director for all films.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT title , directed_by FROM film", "question": "What are the title and director of each film?", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT DISTINCT directed_by FROM film", "question": "Show all directors.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT DISTINCT directed_by FROM film", "question": "Who are all the directors?", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT directed_by , count(*) FROM film GROUP BY directed_by", "question": "List all directors along with the number of films directed by each director.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT T2.name , sum(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id", "question": "What is total number of show times per dat for each cinema?", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT T2.title , max(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id", "question": "What are the title and maximum price of each film?", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT T2.title , max(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id", "question": "Give me the title and highest price for each film.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT T3.name , T2.title , T1.date , T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id JOIN cinema AS T3 ON T1.cinema_id = T3.cinema_id", "question": "Show cinema name, film title, date, and price for each record in schedule.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT title , directed_by FROM film WHERE film_id NOT IN (SELECT film_id FROM schedule)", "question": "What are the title and director of the films without any schedule?", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.directed_by ORDER BY sum(T1.show_times_per_day) DESC LIMIT 1", "question": "Show director with the largest number of show times in total.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) > 1", "question": "Find the locations that have more than one movie theater with capacity above 300.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) > 1", "question": "In which locations are there more than one movie theater with capacity above 300?", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT count(*) FROM film WHERE title LIKE \"%Dummy%\"", "question": "How many films have the word 'Dummy' in their titles?", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT count(*) FROM film WHERE title LIKE \"%Dummy%\"", "question": "Count the number of films whose title contains the word 'Dummy'.", "schema": "film: Film_ID (INT), Rank_in_series (INT), Number_in_season (INT), Title (TEXT), Directed_by (TEXT), Original_air_date (TEXT), Production_code (TEXT)\ncinema: Cinema_ID (INT), Name (TEXT), Openning_year (INT), Capacity (INT), Location (TEXT)\nschedule: Cinema_ID (INT), Film_ID (INT), Date (TEXT), Show_times_per_day (INT), Price (FLOAT)" }, { "query": "SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500", "question": "Are the customers holding coupons with amount 500 bad or good?", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT T1.customer_id , T1.first_name , count(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id", "question": "How many bookings did each customer make? List the customer id, first name, and the count.", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT customer_id , sum(amount_paid) FROM Payments GROUP BY customer_id ORDER BY sum(amount_paid) DESC LIMIT 1", "question": "What is the maximum total amount paid by a customer? List the customer id and amount.", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT T1.booking_id , T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id = T2.booking_id GROUP BY T1.booking_id ORDER BY count(*) DESC LIMIT 1", "question": "What are the id and the amount of refund of the booking that incurred the most times of payments?", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT product_id FROM products_booked GROUP BY product_id HAVING count(*) = 3", "question": "What is the id of the product that is booked for 3 times?", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76", "question": "What is the product description of the product booked with an amount of 102.76?", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT T3.booking_start_date , T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id = T2.product_id JOIN bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection A'", "question": "What are the start date and end date of the booking that has booked the product named 'Book collection A'?", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT T2.product_name FROM view_product_availability AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.available_yn = 1", "question": "What are the names of products whose availability equals to 1?", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT count(DISTINCT product_type_code) FROM products_for_hire", "question": "How many different product types are there?", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT first_name , last_name , gender_mf FROM customers WHERE good_or_bad_customer = 'good' ORDER BY last_name", "question": "What are the first name, last name, and gender of all the good customers? Order by their last name.", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT avg(amount_due) FROM payments", "question": "What is the average amount due for all the payments?", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT max(booked_count) , min(booked_count) , avg(booked_count) FROM products_booked", "question": "What are the maximum, minimum, and average booked count for the products booked?", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT DISTINCT payment_type_code FROM payments", "question": "What are all the distinct payment types?", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT daily_hire_cost FROM Products_for_hire WHERE product_name LIKE '%Book%'", "question": "What are the daily hire costs for the products with substring 'Book' in its name?", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT count(*) FROM Products_for_hire WHERE product_id NOT IN ( SELECT product_id FROM products_booked WHERE booked_amount > 200 )", "question": "How many products are never booked with amount higher than 200?", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'good' INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'bad'", "question": "What are the coupon amount of the coupons owned by both good and bad customers?", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check'", "question": "What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check'", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT product_name , product_description FROM products_for_hire WHERE product_type_code = 'Cutlery' AND daily_hire_cost < 20", "question": "What are the names and descriptions of the products that are of 'Cutlery' type and have daily hire cost lower than 20?", "schema": "Discount_Coupons: coupon_id (INTEGER), date_issued (DATETIME), coupon_amount (DECIMAL(194))\nCustomers: customer_id (INTEGER), coupon_id (INTEGER), good_or_bad_customer (VARCHAR(4)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), gender_mf (VARCHAR(1)), date_became_customer (DATETIME), date_last_hire (DATETIME)\nBookings: booking_id (INTEGER), customer_id (INTEGER), booking_status_code (VARCHAR(10)), returned_damaged_yn (VARCHAR(40)), booking_start_date (DATETIME), booking_end_date (DATETIME), count_hired (VARCHAR(40)), amount_payable (DECIMAL(194)), amount_of_discount (DECIMAL(194)), amount_outstanding (DECIMAL(194)), amount_of_refund (DECIMAL(194))\nProducts_for_Hire: product_id (INTEGER), product_type_code (VARCHAR(15)), daily_hire_cost (DECIMAL(194)), product_name (VARCHAR(80)), product_description (VARCHAR(255))\nPayments: payment_id (INTEGER), booking_id (INTEGER), customer_id (INTEGER), payment_type_code (VARCHAR(15)), amount_paid_in_full_yn (VARCHAR(1)), payment_date (DATETIME), amount_due (DECIMAL(194)), amount_paid (DECIMAL(194))\nProducts_Booked: booking_id (INTEGER), product_id (INTEGER), returned_yn (VARCHAR(1)), returned_late_yn (VARCHAR(1)), booked_count (INTEGER), booked_amount (FLOAT)\nView_Product_Availability: product_id (INTEGER), booking_id (INTEGER), status_date (DATETIME), available_yn (VARCHAR(1))" }, { "query": "SELECT count(*) FROM phone", "question": "How many phones are there?", "schema": "phone: Name (TEXT), Phone_ID (INT), Memory_in_G (INT), Carrier (TEXT), Price (REAL)\nmarket: Market_ID (INT), District (TEXT), Num_of_employees (INT), Num_of_shops (REAL), Ranking (INT)\nphone_market: Market_ID (INT), Phone_ID (TEXT), Num_of_stock (INT)" }, { "query": "SELECT Name FROM phone ORDER BY Price ASC", "question": "List the names of phones in ascending order of price.", "schema": "phone: Name (TEXT), Phone_ID (INT), Memory_in_G (INT), Carrier (TEXT), Price (REAL)\nmarket: Market_ID (INT), District (TEXT), Num_of_employees (INT), Num_of_shops (REAL), Ranking (INT)\nphone_market: Market_ID (INT), Phone_ID (TEXT), Num_of_stock (INT)" }, { "query": "SELECT Memory_in_G , Carrier FROM phone", "question": "What are the memories and carriers of phones?", "schema": "phone: Name (TEXT), Phone_ID (INT), Memory_in_G (INT), Carrier (TEXT), Price (REAL)\nmarket: Market_ID (INT), District (TEXT), Num_of_employees (INT), Num_of_shops (REAL), Ranking (INT)\nphone_market: Market_ID (INT), Phone_ID (TEXT), Num_of_stock (INT)" }, { "query": "SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G > 32", "question": "List the distinct carriers of phones with memories bigger than 32.", "schema": "phone: Name (TEXT), Phone_ID (INT), Memory_in_G (INT), Carrier (TEXT), Price (REAL)\nmarket: Market_ID (INT), District (TEXT), Num_of_employees (INT), Num_of_shops (REAL), Ranking (INT)\nphone_market: Market_ID (INT), Phone_ID (TEXT), Num_of_stock (INT)" }, { "query": "SELECT Name FROM phone WHERE Carrier = \"Sprint\" OR Carrier = \"TMobile\"", "question": "Show the names of phones with carrier either \"Sprint\" or \"TMobile\".", "schema": "phone: Name (TEXT), Phone_ID (INT), Memory_in_G (INT), Carrier (TEXT), Price (REAL)\nmarket: Market_ID (INT), District (TEXT), Num_of_employees (INT), Num_of_shops (REAL), Ranking (INT)\nphone_market: Market_ID (INT), Phone_ID (TEXT), Num_of_stock (INT)" }, { "query": "SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1", "question": "What is the carrier of the most expensive phone?", "schema": "phone: Name (TEXT), Phone_ID (INT), Memory_in_G (INT), Carrier (TEXT), Price (REAL)\nmarket: Market_ID (INT), District (TEXT), Num_of_employees (INT), Num_of_shops (REAL), Ranking (INT)\nphone_market: Market_ID (INT), Phone_ID (TEXT), Num_of_stock (INT)" }, { "query": "SELECT Carrier , COUNT(*) FROM phone GROUP BY Carrier", "question": "Show different carriers of phones together with the number of phones with each carrier.", "schema": "phone: Name (TEXT), Phone_ID (INT), Memory_in_G (INT), Carrier (TEXT), Price (REAL)\nmarket: Market_ID (INT), District (TEXT), Num_of_employees (INT), Num_of_shops (REAL), Ranking (INT)\nphone_market: Market_ID (INT), Phone_ID (TEXT), Num_of_stock (INT)" }, { "query": "SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the most frequently used carrier of the phones.", "schema": "phone: Name (TEXT), Phone_ID (INT), Memory_in_G (INT), Carrier (TEXT), Price (REAL)\nmarket: Market_ID (INT), District (TEXT), Num_of_employees (INT), Num_of_shops (REAL), Ranking (INT)\nphone_market: Market_ID (INT), Phone_ID (TEXT), Num_of_stock (INT)" }, { "query": "SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64", "question": "Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64.", "schema": "phone: Name (TEXT), Phone_ID (INT), Memory_in_G (INT), Carrier (TEXT), Price (REAL)\nmarket: Market_ID (INT), District (TEXT), Num_of_employees (INT), Num_of_shops (REAL), Ranking (INT)\nphone_market: Market_ID (INT), Phone_ID (TEXT), Num_of_stock (INT)" }, { "query": "SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID", "question": "Show the names of phones and the districts of markets they are on.", "schema": "phone: Name (TEXT), Phone_ID (INT), Memory_in_G (INT), Carrier (TEXT), Price (REAL)\nmarket: Market_ID (INT), District (TEXT), Num_of_employees (INT), Num_of_shops (REAL), Ranking (INT)\nphone_market: Market_ID (INT), Phone_ID (TEXT), Num_of_stock (INT)" }, { "query": "SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID ORDER BY T2.Ranking", "question": "Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market.", "schema": "phone: Name (TEXT), Phone_ID (INT), Memory_in_G (INT), Carrier (TEXT), Price (REAL)\nmarket: Market_ID (INT), District (TEXT), Num_of_employees (INT), Num_of_shops (REAL), Ranking (INT)\nphone_market: Market_ID (INT), Phone_ID (TEXT), Num_of_stock (INT)" }, { "query": "SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID WHERE T2.Num_of_shops > 50", "question": "Show the names of phones that are on market with number of shops greater than 50.", "schema": "phone: Name (TEXT), Phone_ID (INT), Memory_in_G (INT), Carrier (TEXT), Price (REAL)\nmarket: Market_ID (INT), District (TEXT), Num_of_employees (INT), Num_of_shops (REAL), Ranking (INT)\nphone_market: Market_ID (INT), Phone_ID (TEXT), Num_of_stock (INT)" }, { "query": "SELECT T2.Name , sum(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name", "question": "For each phone, show its names and total number of stocks.", "schema": "phone: Name (TEXT), Phone_ID (INT), Memory_in_G (INT), Carrier (TEXT), Price (REAL)\nmarket: Market_ID (INT), District (TEXT), Num_of_employees (INT), Num_of_shops (REAL), Ranking (INT)\nphone_market: Market_ID (INT), Phone_ID (TEXT), Num_of_stock (INT)" }, { "query": "SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock) >= 2000 ORDER BY sum(T1.Num_of_stock) DESC", "question": "Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks.", "schema": "phone: Name (TEXT), Phone_ID (INT), Memory_in_G (INT), Carrier (TEXT), Price (REAL)\nmarket: Market_ID (INT), District (TEXT), Num_of_employees (INT), Num_of_shops (REAL), Ranking (INT)\nphone_market: Market_ID (INT), Phone_ID (TEXT), Num_of_stock (INT)" }, { "query": "SELECT Name FROM phone WHERE Phone_id NOT IN (SELECT Phone_ID FROM phone_market)", "question": "List the names of phones that are not on any market.", "schema": "phone: Name (TEXT), Phone_ID (INT), Memory_in_G (INT), Carrier (TEXT), Price (REAL)\nmarket: Market_ID (INT), District (TEXT), Num_of_employees (INT), Num_of_shops (REAL), Ranking (INT)\nphone_market: Market_ID (INT), Phone_ID (TEXT), Num_of_stock (INT)" }, { "query": "SELECT count(*) FROM company", "question": "How many gas companies are there?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT count(*) FROM company", "question": "What is the total number of companies?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT company , rank FROM company ORDER BY Sales_billion DESC", "question": "List the company name and rank for all companies in the decreasing order of their sales.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT company , rank FROM company ORDER BY Sales_billion DESC", "question": "What is the name and rank of every company ordered by descending number of sales?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT company , main_industry FROM company WHERE headquarters != 'USA'", "question": "Show the company name and the main industry for all companies whose headquarters are not from USA.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT company , main_industry FROM company WHERE headquarters != 'USA'", "question": "What are the companies and main industries of all companies that are not headquartered in the United States?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT company , headquarters FROM company ORDER BY market_value DESC", "question": "Show all company names and headquarters in the descending order of market value.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT company , headquarters FROM company ORDER BY market_value DESC", "question": "What are the names and headquarters of all companies ordered by descending market value?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT min(market_value) , max(market_value) , avg(market_value) FROM company", "question": "Show minimum, maximum, and average market value for all companies.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT min(market_value) , max(market_value) , avg(market_value) FROM company", "question": "What is the minimum, maximum, and average market value for every company?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT DISTINCT main_industry FROM company", "question": "Show all main industry for all companies.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT DISTINCT main_industry FROM company", "question": "What are the different main industries for all companies?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT headquarters , count(*) FROM company GROUP BY headquarters", "question": "List all headquarters and the number of companies in each headquarter.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT headquarters , count(*) FROM company GROUP BY headquarters", "question": "For each headquarter, what are the headquarter and how many companies are centered there?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT main_industry , sum(market_value) FROM company GROUP BY main_industry", "question": "Show all main industry and total market value in each industry.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT main_industry , sum(market_value) FROM company GROUP BY main_industry", "question": "What are the main indstries and total market value for each industry?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT main_industry , count(*) FROM company GROUP BY main_industry ORDER BY sum(market_value) DESC LIMIT 1", "question": "List the main industry with highest total market value and its number of companies.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT main_industry , count(*) FROM company GROUP BY main_industry ORDER BY sum(market_value) DESC LIMIT 1", "question": "For each main industry, what is the total number of companies for the industry with the highest total market value?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING count(*) >= 2", "question": "Show headquarters with at least two companies in the banking industry.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING count(*) >= 2", "question": "What are the headquarters with at least two companies in the banking industry?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT station_id , LOCATION , manager_name FROM gas_station ORDER BY open_year", "question": "Show gas station id, location, and manager_name for all gas stations ordered by open year.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT station_id , LOCATION , manager_name FROM gas_station ORDER BY open_year", "question": "What are the gas station ids, locations, and manager names for the gas stations ordered by opening year?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT count(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005", "question": "How many gas station are opened between 2000 and 2005?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT count(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005", "question": "What is the total number of gas stations that opened between 2000 and 2005?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT LOCATION , count(*) FROM gas_station GROUP BY LOCATION ORDER BY count(*)", "question": "Show all locations and the number of gas stations in each location ordered by the count.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT LOCATION , count(*) FROM gas_station GROUP BY LOCATION ORDER BY count(*)", "question": "For each location, how many gas stations are there in order?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas'", "question": "Show all headquarters with both a company in banking industry and a company in Oil and gas.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas'", "question": "What are the headquarters that have both a company in the banking and 'oil and gas' industries?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking'", "question": "Show all headquarters without a company in banking industry.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking'", "question": "What are the headquarters without companies that are in the banking industry?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT T2.company , count(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id", "question": "Show the company name with the number of gas station.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT T2.company , count(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id", "question": "For each company id, what are the companies and how many gas stations does each one operate?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT company , main_industry FROM company WHERE company_id NOT IN (SELECT company_id FROM station_company)", "question": "Show company name and main industry without a gas station.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT company , main_industry FROM company WHERE company_id NOT IN (SELECT company_id FROM station_company)", "question": "What are the main industries of the companies without gas stations and what are the companies?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil'", "question": "Show the manager name for gas stations belonging to the ExxonMobil company.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil'", "question": "What are the names of the managers for gas stations that are operated by the ExxonMobil company?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.market_value > 100", "question": "Show all locations where a gas station for company with market value greater than 100 is located.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.market_value > 100", "question": "What are the locations that have gas stations owned by a company with a market value greater than 100?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY count(*) DESC LIMIT 1", "question": "Show the manager name with most number of gas stations opened after 2000.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of the manager with the most gas stations that opened after 2000?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT LOCATION FROM gas_station ORDER BY open_year", "question": "order all gas station locations by the opening year.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT LOCATION FROM gas_station ORDER BY open_year", "question": "What are the locations of all the gas stations ordered by opening year?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT rank , company , market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion , profits_billion", "question": "find the rank, company names, market values of the companies in the banking industry order by their sales and profits in billion.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT rank , company , market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion , profits_billion", "question": "What is the rank, company, and market value of every comapny in the banking industry ordered by sales and profits?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT T3.location , T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3", "question": "find the location and Representative name of the gas stations owned by the companies with top 3 Asset amounts.", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT T3.location , T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3", "question": "What are the locations and representatives' names of the gas stations owned by the companies with the 3 largest amounts of assets?", "schema": "company: Company_ID (INT), Rank (INT), Company (TEXT), Headquarters (TEXT), Main_Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value (REAL)\ngas_station: Station_ID (INT), Open_Year (INT), Location (TEXT), Manager_Name (TEXT), Vice_Manager_Name (TEXT), Representative_Name (TEXT)\nstation_company: Station_ID (INT), Company_ID (INT), Rank_of_the_Year (INT)" }, { "query": "SELECT count(*) FROM region", "question": "How many regions do we have?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT count(*) FROM region", "question": "Count the number of regions.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT DISTINCT region_name FROM region ORDER BY Label", "question": "Show all distinct region names ordered by their labels.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT DISTINCT region_name FROM region ORDER BY Label", "question": "What are the different region names, ordered by labels?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT count(DISTINCT party_name) FROM party", "question": "How many parties do we have?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT count(DISTINCT party_name) FROM party", "question": "Count the number of different parties.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT minister , took_office , left_office FROM party ORDER BY left_office", "question": "Show the ministers and the time they took and left office, listed by the time they left office.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT minister , took_office , left_office FROM party ORDER BY left_office", "question": "Who are the ministers, when did they take office, and when did they leave office, ordered by when they left office?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959", "question": "Show the minister who took office after 1961 or before 1959.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959", "question": "Who are the ministers who took office after 1961 or before 1959?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT minister FROM party WHERE party_name != 'Progress Party'", "question": "Show all ministers who do not belong to Progress Party.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT minister FROM party WHERE party_name != 'Progress Party'", "question": "Which ministers are not a part of the Progress Party?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT minister , party_name FROM party ORDER BY took_office DESC", "question": "Show all ministers and parties they belong to in descending order of the time they took office.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT minister , party_name FROM party ORDER BY took_office DESC", "question": "Who are the ministers and what parties do they belong to, listed descending by the times they took office?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT minister FROM party ORDER BY left_office DESC LIMIT 1", "question": "Return the minister who left office at the latest time.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT minister FROM party ORDER BY left_office DESC LIMIT 1", "question": "Which minister left office the latest?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T1.member_name , T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id", "question": "List member names and their party names.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T1.member_name , T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id", "question": "What are the names of members and their corresponding parties?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T2.party_name , count(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id", "question": "Show all party names and the number of members in each party.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T2.party_name , count(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id", "question": "How many members are in each party?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of party with most number of members?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY count(*) DESC LIMIT 1", "question": "Return the name of the party with the most members.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T1.party_name , T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id", "question": "Show all party names and their region names.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T1.party_name , T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id", "question": "What are the names of parties and their respective regions?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT party_name FROM party WHERE party_id NOT IN (SELECT party_id FROM Member)", "question": "Show names of parties that does not have any members.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT party_name FROM party WHERE party_id NOT IN (SELECT party_id FROM Member)", "question": "What are the names of parties that have no members?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1", "question": "Show the member names which are in both the party with id 3 and the party with id 1.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1", "question": "Which member names are shared among members in the party with the id 3 and the party with the id 1?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name != \"Progress Party\"", "question": "Show member names that are not in the Progress Party.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name != \"Progress Party\"", "question": "Which member names corresponding to members who are not in the Progress Party?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT count(*) FROM party_events", "question": "How many party events do we have?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT count(*) FROM party_events", "question": "Count the number of party events.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T2.party_name , count(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id", "question": "Show party names and the number of events for each party.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T2.party_name , count(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id", "question": "How many events are there for each party?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id", "question": "Show all member names who are not in charge of any event.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id", "question": "What are the names of members who are not in charge of any events?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING count(*) >= 2", "question": "What are the names of parties with at least 2 events?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING count(*) >= 2", "question": "Return the names of parties that have two or more events.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of member in charge of greatest number of events?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY count(*) DESC LIMIT 1", "question": "Return the name of the member who is in charge of the most events.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT event_name FROM party_events GROUP BY event_name HAVING count(*) > 2", "question": "find the event names that have more than 2 records.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT event_name FROM party_events GROUP BY event_name HAVING count(*) > 2", "question": "Which event names were used more than twice for party events?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT count(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = \"United Kingdom\" AND t3.Event_Name = \"Annaual Meeting\"", "question": "How many Annual Meeting events happened in the United Kingdom region?", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT count(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = \"United Kingdom\" AND t3.Event_Name = \"Annaual Meeting\"", "question": "Count the number of Annual Meeting events that took place in the region of the United Kingdom.", "schema": "region: Region_ID (INT), Region_name (TEXT), Date (TEXT), Label (TEXT), Format (TEXT), Catalogue (TEXT)\nparty: Party_ID (INT), Minister (TEXT), Took_office (TEXT), Left_office (TEXT), Region_ID (INT), Party_name (TEXT)\nmember: Member_ID (INT), Member_Name (TEXT), Party_ID (TEXT), In_office (TEXT)\nparty_events: Event_ID (INT), Event_Name (TEXT), Party_ID (INT), Member_in_charge_ID (INT)" }, { "query": "SELECT count(*) FROM pilot", "question": "How many pilots are there?", "schema": "aircraft: Aircraft_ID (INT), Order_Year (INT), Manufacturer (TEXT), Model (TEXT), Fleet_Series (TEXT), Powertrain (TEXT), Fuel_Propulsion (TEXT)\npilot: Pilot_ID (INT), Pilot_name (TEXT), Rank (INT), Age (INT), Nationality (TEXT), Position (TEXT), Join_Year (INT), Team (TEXT)\npilot_record: Record_ID (INT), Pilot_ID (INT), Aircraft_ID (INT), Date (TEXT)" }, { "query": "SELECT Pilot_name FROM pilot ORDER BY Rank ASC", "question": "List the names of pilots in ascending order of rank.", "schema": "aircraft: Aircraft_ID (INT), Order_Year (INT), Manufacturer (TEXT), Model (TEXT), Fleet_Series (TEXT), Powertrain (TEXT), Fuel_Propulsion (TEXT)\npilot: Pilot_ID (INT), Pilot_name (TEXT), Rank (INT), Age (INT), Nationality (TEXT), Position (TEXT), Join_Year (INT), Team (TEXT)\npilot_record: Record_ID (INT), Pilot_ID (INT), Aircraft_ID (INT), Date (TEXT)" }, { "query": "SELECT POSITION , Team FROM pilot", "question": "What are the positions and teams of pilots?", "schema": "aircraft: Aircraft_ID (INT), Order_Year (INT), Manufacturer (TEXT), Model (TEXT), Fleet_Series (TEXT), Powertrain (TEXT), Fuel_Propulsion (TEXT)\npilot: Pilot_ID (INT), Pilot_name (TEXT), Rank (INT), Age (INT), Nationality (TEXT), Position (TEXT), Join_Year (INT), Team (TEXT)\npilot_record: Record_ID (INT), Pilot_ID (INT), Aircraft_ID (INT), Date (TEXT)" }, { "query": "SELECT DISTINCT POSITION FROM pilot WHERE Age > 30", "question": "List the distinct positions of pilots older than 30.", "schema": "aircraft: Aircraft_ID (INT), Order_Year (INT), Manufacturer (TEXT), Model (TEXT), Fleet_Series (TEXT), Powertrain (TEXT), Fuel_Propulsion (TEXT)\npilot: Pilot_ID (INT), Pilot_name (TEXT), Rank (INT), Age (INT), Nationality (TEXT), Position (TEXT), Join_Year (INT), Team (TEXT)\npilot_record: Record_ID (INT), Pilot_ID (INT), Aircraft_ID (INT), Date (TEXT)" }, { "query": "SELECT Pilot_name FROM pilot WHERE Team = \"Bradley\" OR Team = \"Fordham\"", "question": "Show the names of pilots from team \"Bradley\" or \"Fordham\".", "schema": "aircraft: Aircraft_ID (INT), Order_Year (INT), Manufacturer (TEXT), Model (TEXT), Fleet_Series (TEXT), Powertrain (TEXT), Fuel_Propulsion (TEXT)\npilot: Pilot_ID (INT), Pilot_name (TEXT), Rank (INT), Age (INT), Nationality (TEXT), Position (TEXT), Join_Year (INT), Team (TEXT)\npilot_record: Record_ID (INT), Pilot_ID (INT), Aircraft_ID (INT), Date (TEXT)" }, { "query": "SELECT Join_Year FROM pilot ORDER BY Rank ASC LIMIT 1", "question": "What is the joined year of the pilot of the highest rank?", "schema": "aircraft: Aircraft_ID (INT), Order_Year (INT), Manufacturer (TEXT), Model (TEXT), Fleet_Series (TEXT), Powertrain (TEXT), Fuel_Propulsion (TEXT)\npilot: Pilot_ID (INT), Pilot_name (TEXT), Rank (INT), Age (INT), Nationality (TEXT), Position (TEXT), Join_Year (INT), Team (TEXT)\npilot_record: Record_ID (INT), Pilot_ID (INT), Aircraft_ID (INT), Date (TEXT)" }, { "query": "SELECT Nationality , COUNT(*) FROM pilot GROUP BY Nationality", "question": "What are the different nationalities of pilots? Show each nationality and the number of pilots of each nationality.", "schema": "aircraft: Aircraft_ID (INT), Order_Year (INT), Manufacturer (TEXT), Model (TEXT), Fleet_Series (TEXT), Powertrain (TEXT), Fuel_Propulsion (TEXT)\npilot: Pilot_ID (INT), Pilot_name (TEXT), Rank (INT), Age (INT), Nationality (TEXT), Position (TEXT), Join_Year (INT), Team (TEXT)\npilot_record: Record_ID (INT), Pilot_ID (INT), Aircraft_ID (INT), Date (TEXT)" }, { "query": "SELECT Nationality FROM pilot GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the most common nationality of pilots.", "schema": "aircraft: Aircraft_ID (INT), Order_Year (INT), Manufacturer (TEXT), Model (TEXT), Fleet_Series (TEXT), Powertrain (TEXT), Fuel_Propulsion (TEXT)\npilot: Pilot_ID (INT), Pilot_name (TEXT), Rank (INT), Age (INT), Nationality (TEXT), Position (TEXT), Join_Year (INT), Team (TEXT)\npilot_record: Record_ID (INT), Pilot_ID (INT), Aircraft_ID (INT), Date (TEXT)" }, { "query": "SELECT POSITION FROM pilot WHERE Join_Year\t < 2000 INTERSECT SELECT POSITION FROM pilot WHERE Join_Year\t > 2005", "question": "Show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000.", "schema": "aircraft: Aircraft_ID (INT), Order_Year (INT), Manufacturer (TEXT), Model (TEXT), Fleet_Series (TEXT), Powertrain (TEXT), Fuel_Propulsion (TEXT)\npilot: Pilot_ID (INT), Pilot_name (TEXT), Rank (INT), Age (INT), Nationality (TEXT), Position (TEXT), Join_Year (INT), Team (TEXT)\npilot_record: Record_ID (INT), Pilot_ID (INT), Aircraft_ID (INT), Date (TEXT)" }, { "query": "SELECT T3.Pilot_name , T2.Model FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID", "question": "Show the names of pilots and models of aircrafts they have flied with.", "schema": "aircraft: Aircraft_ID (INT), Order_Year (INT), Manufacturer (TEXT), Model (TEXT), Fleet_Series (TEXT), Powertrain (TEXT), Fuel_Propulsion (TEXT)\npilot: Pilot_ID (INT), Pilot_name (TEXT), Rank (INT), Age (INT), Nationality (TEXT), Position (TEXT), Join_Year (INT), Team (TEXT)\npilot_record: Record_ID (INT), Pilot_ID (INT), Aircraft_ID (INT), Date (TEXT)" }, { "query": "SELECT T3.Pilot_name , T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID ORDER BY T3.Rank", "question": "Show the names of pilots and fleet series of the aircrafts they have flied with in ascending order of the rank of the pilot.", "schema": "aircraft: Aircraft_ID (INT), Order_Year (INT), Manufacturer (TEXT), Model (TEXT), Fleet_Series (TEXT), Powertrain (TEXT), Fuel_Propulsion (TEXT)\npilot: Pilot_ID (INT), Pilot_name (TEXT), Rank (INT), Age (INT), Nationality (TEXT), Position (TEXT), Join_Year (INT), Team (TEXT)\npilot_record: Record_ID (INT), Pilot_ID (INT), Aircraft_ID (INT), Date (TEXT)" }, { "query": "SELECT T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID WHERE T3.Age < 34", "question": "Show the fleet series of the aircrafts flied by pilots younger than 34", "schema": "aircraft: Aircraft_ID (INT), Order_Year (INT), Manufacturer (TEXT), Model (TEXT), Fleet_Series (TEXT), Powertrain (TEXT), Fuel_Propulsion (TEXT)\npilot: Pilot_ID (INT), Pilot_name (TEXT), Rank (INT), Age (INT), Nationality (TEXT), Position (TEXT), Join_Year (INT), Team (TEXT)\npilot_record: Record_ID (INT), Pilot_ID (INT), Aircraft_ID (INT), Date (TEXT)" }, { "query": "SELECT T2.Pilot_name , COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name", "question": "Show the names of pilots and the number of records they have.", "schema": "aircraft: Aircraft_ID (INT), Order_Year (INT), Manufacturer (TEXT), Model (TEXT), Fleet_Series (TEXT), Powertrain (TEXT), Fuel_Propulsion (TEXT)\npilot: Pilot_ID (INT), Pilot_name (TEXT), Rank (INT), Age (INT), Nationality (TEXT), Position (TEXT), Join_Year (INT), Team (TEXT)\npilot_record: Record_ID (INT), Pilot_ID (INT), Aircraft_ID (INT), Date (TEXT)" }, { "query": "SELECT T2.Pilot_name , COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name HAVING COUNT(*) > 1", "question": "Show names of pilots that have more than one record.", "schema": "aircraft: Aircraft_ID (INT), Order_Year (INT), Manufacturer (TEXT), Model (TEXT), Fleet_Series (TEXT), Powertrain (TEXT), Fuel_Propulsion (TEXT)\npilot: Pilot_ID (INT), Pilot_name (TEXT), Rank (INT), Age (INT), Nationality (TEXT), Position (TEXT), Join_Year (INT), Team (TEXT)\npilot_record: Record_ID (INT), Pilot_ID (INT), Aircraft_ID (INT), Date (TEXT)" }, { "query": "SELECT Pilot_name FROM pilot WHERE Pilot_ID NOT IN (SELECT Pilot_ID FROM pilot_record)", "question": "List the names of pilots that do not have any record.", "schema": "aircraft: Aircraft_ID (INT), Order_Year (INT), Manufacturer (TEXT), Model (TEXT), Fleet_Series (TEXT), Powertrain (TEXT), Fuel_Propulsion (TEXT)\npilot: Pilot_ID (INT), Pilot_name (TEXT), Rank (INT), Age (INT), Nationality (TEXT), Position (TEXT), Join_Year (INT), Team (TEXT)\npilot_record: Record_ID (INT), Pilot_ID (INT), Aircraft_ID (INT), Date (TEXT)" }, { "query": "SELECT document_status_code FROM Ref_Document_Status;", "question": "What document status codes do we have?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT document_status_description FROM Ref_Document_Status WHERE document_status_code = \"working\";", "question": "What is the description of document status code 'working'?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT document_type_code FROM Ref_Document_Types;", "question": "What document type codes do we have?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT document_type_description FROM Ref_Document_Types WHERE document_type_code = \"Paper\";", "question": "What is the description of document type 'Paper'?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT shipping_agent_name FROM Ref_Shipping_Agents;", "question": "What are the shipping agent names?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = \"UPS\";", "question": "What is the shipping agent code of shipping agent UPS?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT role_code FROM ROLES;", "question": "What are all role codes?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT role_description FROM ROLES WHERE role_code = \"ED\";", "question": "What is the description of role code ED?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT count(*) FROM Employees;", "question": "How many employees do we have?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = \"Koby\";", "question": "What is the role of the employee named Koby?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT document_id , receipt_date FROM Documents;", "question": "List all document ids and receipt dates of documents.", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT T1.role_description , T2.role_code , count(*) FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code;", "question": "How many employees does each role have? List role description, id and number of employees.", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT Roles.role_description , count(Employees.employee_id) FROM ROLES JOIN Employees ON Employees.role_code = Roles.role_code GROUP BY Employees.role_code HAVING count(Employees.employee_id) > 1;", "question": "List roles that have more than one employee. List the role description and number of employees.", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT Ref_Document_Status.document_status_description FROM Ref_Document_Status JOIN Documents ON Documents.document_status_code = Ref_Document_Status.document_status_code WHERE Documents.document_id = 1;", "question": "What is the document status description of the document with id 1?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT count(*) FROM Documents WHERE document_status_code = \"done\";", "question": "How many documents have the status code done?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT document_type_code FROM Documents WHERE document_id = 2;", "question": "List the document type code for the document with the id 2.", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT document_id FROM Documents WHERE document_status_code = \"done\" AND document_type_code = \"Paper\";", "question": "List the document ids for any documents with the status code done and the type code paper.", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT Ref_Shipping_Agents.shipping_agent_name FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Documents.document_id = 2;", "question": "What is the name of the shipping agent of the document with id 2?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT count(*) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = \"USPS\";", "question": "How many documents were shipped by USPS?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT Ref_Shipping_Agents.shipping_agent_name , count(Documents.document_id) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code GROUP BY Ref_Shipping_Agents.shipping_agent_code ORDER BY count(Documents.document_id) DESC LIMIT 1;", "question": "Which shipping agent shipped the most documents? List the shipping agent name and the number of documents.", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT receipt_date FROM Documents WHERE document_id = 3;", "question": "What is the receipt date of the document with id 3?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT Addresses.address_details FROM Addresses JOIN Documents_Mailed ON Documents_Mailed.mailed_to_address_id = Addresses.address_id WHERE document_id = 4;", "question": "What address was the document with id 4 mailed to?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT mailing_date FROM Documents_Mailed WHERE document_id = 7;", "question": "What is the mail date of the document with id 7?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT document_id FROM Documents WHERE document_status_code = \"done\" AND document_type_code = \"Paper\" EXCEPT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = \"USPS\";", "question": "List the document ids of documents with the status done and type Paper, which not shipped by the shipping agent named USPS.", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT document_id FROM Documents WHERE document_status_code = \"done\" AND document_type_code = \"Paper\" INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = \"USPS\";", "question": "List document id of documents status is done and document type is Paper and the document is shipped by shipping agent named USPS.", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT draft_details FROM Document_Drafts WHERE document_id = 7;", "question": "What is draft detail of the document with id 7?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT count(*) FROM Draft_Copies WHERE document_id = 2;", "question": "How many draft copies does the document with id 2 have?", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT document_id , count(copy_number) FROM Draft_Copies GROUP BY document_id ORDER BY count(copy_number) DESC LIMIT 1;", "question": "Which document has the most draft copies? List its document id and number of draft copies.", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT document_id , count(*) FROM Draft_Copies GROUP BY document_id HAVING count(*) > 1;", "question": "Which documents have more than 1 draft copies? List document id and number of draft copies.", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id WHERE Circulation_History.document_id = 1;", "question": "List all employees in the circulation history of the document with id 1. List the employee's name.", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id", "question": "List the employees who have not showed up in any circulation history of documents. List the employee's name.", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT Employees.employee_name , count(*) FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id GROUP BY Circulation_History.document_id , Circulation_History.draft_number , Circulation_History.copy_number ORDER BY count(*) DESC LIMIT 1;", "question": "Which employee has showed up in most circulation history documents. List the employee's name and the number of drafts and copies.", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT document_id , count(DISTINCT employee_id) FROM Circulation_History GROUP BY document_id;", "question": "For each document, list the number of employees who have showed up in the circulation history of that document. List the document ids and number of employees.", "schema": "Ref_Document_Types: document_type_code (CHAR(15)), document_type_description (VARCHAR(255))\nRoles: role_code (CHAR(15)), role_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(255))\nRef_Document_Status: document_status_code (CHAR(15)), document_status_description (VARCHAR(255))\nRef_Shipping_Agents: shipping_agent_code (CHAR(15)), shipping_agent_name (VARCHAR(255)), shipping_agent_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_status_code (CHAR(15)), document_type_code (CHAR(15)), shipping_agent_code (CHAR(15)), receipt_date (DATETIME), receipt_number (VARCHAR(255)), other_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), role_code (CHAR(15)), employee_name (VARCHAR(255)), other_details (VARCHAR(255))\nDocument_Drafts: document_id (INTEGER), draft_number (INTEGER), draft_details (VARCHAR(255))\nDraft_Copies: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER)\nCirculation_History: document_id (INTEGER), draft_number (INTEGER), copy_number (INTEGER), employee_id (INTEGER)\nDocuments_Mailed: document_id (INTEGER), mailed_to_address_id (INTEGER), mailing_date (DATETIME)" }, { "query": "SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage'", "question": "what are the event details of the services that have the type code 'Marriage'?", "schema": "Services: Service_ID (INTEGER), Service_Type_Code (CHAR(15))\nParticipants: Participant_ID (INTEGER), Participant_Type_Code (CHAR(15)), Participant_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Service_ID (INTEGER), Event_Details (VARCHAR(255))\nParticipants_in_Events: Event_ID (INTEGER), Participant_ID (INTEGER)" }, { "query": "SELECT T1.event_id , T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_ID HAVING count(*) > 1", "question": "What are the ids and details of events that have more than one participants?", "schema": "Services: Service_ID (INTEGER), Service_Type_Code (CHAR(15))\nParticipants: Participant_ID (INTEGER), Participant_Type_Code (CHAR(15)), Participant_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Service_ID (INTEGER), Event_Details (VARCHAR(255))\nParticipants_in_Events: Event_ID (INTEGER), Participant_ID (INTEGER)" }, { "query": "SELECT T1.Participant_ID , T1.Participant_Type_Code , count(*) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_ID", "question": "How many events have each participants attended? List the participant id, type and the number.", "schema": "Services: Service_ID (INTEGER), Service_Type_Code (CHAR(15))\nParticipants: Participant_ID (INTEGER), Participant_Type_Code (CHAR(15)), Participant_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Service_ID (INTEGER), Event_Details (VARCHAR(255))\nParticipants_in_Events: Event_ID (INTEGER), Participant_ID (INTEGER)" }, { "query": "SELECT Participant_ID , Participant_Type_Code , Participant_Details FROM Participants", "question": "What are all the the participant ids, type code and details?", "schema": "Services: Service_ID (INTEGER), Service_Type_Code (CHAR(15))\nParticipants: Participant_ID (INTEGER), Participant_Type_Code (CHAR(15)), Participant_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Service_ID (INTEGER), Event_Details (VARCHAR(255))\nParticipants_in_Events: Event_ID (INTEGER), Participant_ID (INTEGER)" }, { "query": "SELECT count(*) FROM participants WHERE participant_type_code = 'Organizer'", "question": "How many participants belong to the type 'Organizer'?", "schema": "Services: Service_ID (INTEGER), Service_Type_Code (CHAR(15))\nParticipants: Participant_ID (INTEGER), Participant_Type_Code (CHAR(15)), Participant_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Service_ID (INTEGER), Event_Details (VARCHAR(255))\nParticipants_in_Events: Event_ID (INTEGER), Participant_ID (INTEGER)" }, { "query": "SELECT service_type_code FROM services ORDER BY service_type_code", "question": "List the type of the services in alphabetical order.", "schema": "Services: Service_ID (INTEGER), Service_Type_Code (CHAR(15))\nParticipants: Participant_ID (INTEGER), Participant_Type_Code (CHAR(15)), Participant_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Service_ID (INTEGER), Event_Details (VARCHAR(255))\nParticipants_in_Events: Event_ID (INTEGER), Participant_ID (INTEGER)" }, { "query": "SELECT service_id , event_details FROM EVENTS", "question": "List the service id and details for the events.", "schema": "Services: Service_ID (INTEGER), Service_Type_Code (CHAR(15))\nParticipants: Participant_ID (INTEGER), Participant_Type_Code (CHAR(15)), Participant_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Service_ID (INTEGER), Event_Details (VARCHAR(255))\nParticipants_in_Events: Event_ID (INTEGER), Participant_ID (INTEGER)" }, { "query": "SELECT count(*) FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE T1.participant_details LIKE '%Dr.%'", "question": "How many events had participants whose details had the substring 'Dr.'", "schema": "Services: Service_ID (INTEGER), Service_Type_Code (CHAR(15))\nParticipants: Participant_ID (INTEGER), Participant_Type_Code (CHAR(15)), Participant_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Service_ID (INTEGER), Event_Details (VARCHAR(255))\nParticipants_in_Events: Event_ID (INTEGER), Participant_ID (INTEGER)" }, { "query": "SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY count(*) DESC LIMIT 1", "question": "What is the most common participant type?", "schema": "Services: Service_ID (INTEGER), Service_Type_Code (CHAR(15))\nParticipants: Participant_ID (INTEGER), Participant_Type_Code (CHAR(15)), Participant_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Service_ID (INTEGER), Event_Details (VARCHAR(255))\nParticipants_in_Events: Event_ID (INTEGER), Participant_ID (INTEGER)" }, { "query": "SELECT T3.service_id , T4.Service_Type_Code FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID JOIN EVENTS AS T3 ON T2.Event_ID = T3.Event_ID JOIN services AS T4 ON T3.service_id = T4.service_id GROUP BY T3.service_id ORDER BY count(*) ASC LIMIT 1", "question": "Which service id and type has the least number of participants?", "schema": "Services: Service_ID (INTEGER), Service_Type_Code (CHAR(15))\nParticipants: Participant_ID (INTEGER), Participant_Type_Code (CHAR(15)), Participant_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Service_ID (INTEGER), Event_Details (VARCHAR(255))\nParticipants_in_Events: Event_ID (INTEGER), Participant_ID (INTEGER)" }, { "query": "SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY count(*) DESC LIMIT 1", "question": "What is the id of the event with the most participants?", "schema": "Services: Service_ID (INTEGER), Service_Type_Code (CHAR(15))\nParticipants: Participant_ID (INTEGER), Participant_Type_Code (CHAR(15)), Participant_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Service_ID (INTEGER), Event_Details (VARCHAR(255))\nParticipants_in_Events: Event_ID (INTEGER), Participant_ID (INTEGER)" }, { "query": "SELECT event_id FROM EVENTS EXCEPT SELECT T1.event_id FROM Participants_in_Events AS T1 JOIN Participants AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE Participant_Details = 'Kenyatta Kuhn'", "question": "Which events id does not have any participant with detail 'Kenyatta Kuhn'?", "schema": "Services: Service_ID (INTEGER), Service_Type_Code (CHAR(15))\nParticipants: Participant_ID (INTEGER), Participant_Type_Code (CHAR(15)), Participant_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Service_ID (INTEGER), Event_Details (VARCHAR(255))\nParticipants_in_Events: Event_ID (INTEGER), Participant_ID (INTEGER)" }, { "query": "SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail'", "question": "Which services type had both successful and failure event details?", "schema": "Services: Service_ID (INTEGER), Service_Type_Code (CHAR(15))\nParticipants: Participant_ID (INTEGER), Participant_Type_Code (CHAR(15)), Participant_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Service_ID (INTEGER), Event_Details (VARCHAR(255))\nParticipants_in_Events: Event_ID (INTEGER), Participant_ID (INTEGER)" }, { "query": "SELECT count(*) FROM EVENTS WHERE event_id NOT IN (SELECT event_id FROM Participants_in_Events)", "question": "How many events did not have any participants?", "schema": "Services: Service_ID (INTEGER), Service_Type_Code (CHAR(15))\nParticipants: Participant_ID (INTEGER), Participant_Type_Code (CHAR(15)), Participant_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Service_ID (INTEGER), Event_Details (VARCHAR(255))\nParticipants_in_Events: Event_ID (INTEGER), Participant_ID (INTEGER)" }, { "query": "SELECT count(DISTINCT participant_id) FROM participants_in_Events", "question": "What are all the distinct participant ids who attended any events?", "schema": "Services: Service_ID (INTEGER), Service_Type_Code (CHAR(15))\nParticipants: Participant_ID (INTEGER), Participant_Type_Code (CHAR(15)), Participant_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Service_ID (INTEGER), Event_Details (VARCHAR(255))\nParticipants_in_Events: Event_ID (INTEGER), Participant_ID (INTEGER)" }, { "query": "SELECT name FROM races ORDER BY date DESC LIMIT 1", "question": "What is the name of the race held most recently?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT name FROM races ORDER BY date DESC LIMIT 1", "question": "What is the name of the race that occurred most recently?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT name , date FROM races ORDER BY date DESC LIMIT 1", "question": "What is the name and date of the most recent race?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT name , date FROM races ORDER BY date DESC LIMIT 1", "question": "What is the name and date of the race that occurred most recently?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT name FROM races WHERE YEAR = 2017", "question": "Find the names of all races held in 2017.", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT name FROM races WHERE YEAR = 2017", "question": "What are the names of all the races that occurred in the year 2017?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017", "question": "Find the distinct names of all races held between 2014 and 2017?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017", "question": "What are the unique names of all race held between 2014 and 2017?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000", "question": "List the forename and surname of all distinct drivers who once had laptime less than 93000 milliseconds?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000", "question": "What are the forenames and surnames of all unique drivers who had a lap time of less than 93000 milliseconds?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT T1.driverid , T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000", "question": "Find all the distinct id and nationality of drivers who have had laptime more than 100000 milliseconds?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT T1.driverid , T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000", "question": "What are the different driver ids and nationalities of all drivers who had a laptime of more than 100000 milliseconds?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1", "question": "What are the forename and surname of the driver who has the smallest laptime?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1", "question": "What is the forename and surname of the driver with the shortest laptime?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1", "question": "What is the id and family name of the driver who has the longest laptime?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1", "question": "What is the id and last name of the driver with the longest laptime?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.driverid , T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING count(*) >= 2", "question": "What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.driverid , T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING count(*) >= 2", "question": "What is the id, first name, and last name of the driver who was in the first position for laptime at least twice?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT count(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = \"Australian Grand Prix\" AND YEAR = 2009", "question": "How many drivers participated in the race Australian Grand Prix held in 2009?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT count(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = \"Australian Grand Prix\" AND YEAR = 2009", "question": "How many drivers were in the Australian Grand Prix held in 2009?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 )", "question": "How many drivers did not participate in the races held in 2009?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 )", "question": "How many drivers did not race in 2009?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T2.name , T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = \"Lewis\"", "question": "Give me a list of names and years of races that had any driver whose forename is Lewis?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T2.name , T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = \"Lewis\"", "question": "What are the names and years of all races that had a driver with the last name Lewis?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT forename , surname FROM drivers WHERE nationality = \"German\"", "question": "Find the forename and surname of drivers whose nationality is German?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT forename , surname FROM drivers WHERE nationality = \"German\"", "question": "What is the first and last name of all the German drivers?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T2.driverid , T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = \"Australian Grand Prix\" INTERSECT SELECT T2.driverid , T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = \"Chinese Grand Prix\"", "question": "Find the id and forenames of drivers who participated both the races with name Australian Grand Prix and the races with name Chinese Grand Prix?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T2.driverid , T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = \"Australian Grand Prix\" INTERSECT SELECT T2.driverid , T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = \"Chinese Grand Prix\"", "question": "What is the id and first name of all the drivers who participated in the Australian Grand Prix and the Chinese Grand Prix?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = \"Australian Grand Prix\" EXCEPT SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = \"Chinese Grand Prix\"", "question": "What are the forenames and surnames of drivers who participated in the races named Australian Grand Prix but not the races named Chinese Grand Prix?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = \"Australian Grand Prix\" EXCEPT SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = \"Chinese Grand Prix\"", "question": "What are the first and last names of all drivers who participated in the Australian Grand Prix but not the Chinese Grand Prix?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1", "question": "Find all the forenames of distinct drivers who was in position 1 as standing and won?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1", "question": "What are all the different first names of the drivers who are in position as standing and won?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20", "question": "Find all the forenames of distinct drivers who won in position 1 as driver standing and had more than 20 points?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20", "question": "What are the first names of the different drivers who won in position 1 as driver standing and had more than 20 points?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT count(*) , nationality FROM constructors GROUP BY nationality", "question": "What are the numbers of constructors for different nationalities?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT count(*) , nationality FROM constructors GROUP BY nationality", "question": "For each nationality, how many different constructors are there?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT count(*) , constructorid FROM constructorStandings GROUP BY constructorid", "question": "What are the numbers of races for each constructor id?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT count(*) , constructorid FROM constructorStandings GROUP BY constructorid", "question": "For each constructor id, how many races are there?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = \"Spain\" AND T1.year > 2017", "question": "What are the names of races that were held after 2017 and the circuits were in the country of Spain?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = \"Spain\" AND T1.year > 2017", "question": "What are the names of the races held after 2017 in Spain?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = \"Spain\" AND T1.year > 2000", "question": "What are the unique names of races that held after 2000 and the circuits were in Spain?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = \"Spain\" AND T1.year > 2000", "question": "What are the names of all races held after 2000 in Spain?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration < (SELECT max(duration) FROM pitstops WHERE raceid = 841)", "question": "Find the distinct driver id and the stop number of all drivers that have a shorter pit stop duration than some drivers in the race with id 841.", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration < (SELECT max(duration) FROM pitstops WHERE raceid = 841)", "question": "What is the id and stop number for each driver that has a shorter pit stop than the driver in the race with id 841?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration > (SELECT min(duration) FROM pitstops WHERE raceid = 841)", "question": "Find the distinct driver id of all drivers that have a longer stop duration than some drivers in the race whose id is 841?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration > (SELECT min(duration) FROM pitstops WHERE raceid = 841)", "question": "What are the different ids and stop durations of all the drivers whose stop lasted longer than the driver in the race with the id 841?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT forename FROM drivers ORDER BY forename ASC", "question": "List the forenames of all distinct drivers in alphabetical order?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT forename FROM drivers ORDER BY forename ASC", "question": "What are the first names of all the different drivers in alphabetical order?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT name FROM races ORDER BY name DESC", "question": "List the names of all distinct races in reversed lexicographic order?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT DISTINCT name FROM races ORDER BY name DESC", "question": "What are the different names of all the races in reverse alphabetical order?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011", "question": "What are the names of races held between 2009 and 2011?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011", "question": "What are the names of all races held between 2009 and 2011?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT name FROM races WHERE TIME > \"12:00:00\" OR TIME < \"09:00:00\"", "question": "What are the names of races held after 12:00:00 or before 09:00:00?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT name FROM races WHERE TIME > \"12:00:00\" OR TIME < \"09:00:00\"", "question": "What are the names of all races that occurred after 12:00:00 or before 09:00:00?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.forename , T1.surname , T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 8 UNION SELECT T1.forename , T1.surname , T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 5", "question": "What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 race results?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.forename , T1.surname , T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 8 UNION SELECT T1.forename , T1.surname , T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 5", "question": "What are the drivers' first names,last names, and ids for all those that had more than 8 stops or participated in more than 5 races?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.surname , T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) = 11 INTERSECT SELECT T1.surname , T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 5", "question": "What are the drivers' last names and id who had 11 pit stops and participated in more than 5 race results?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.surname , T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) = 11 INTERSECT SELECT T1.surname , T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 5", "question": "What are the last names and ids of all drivers who had 11 pit stops and participated in more than 5 races?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY count(*) DESC LIMIT 1", "question": "What is the id and last name of the driver who participated in the most races after 2010?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY count(*) DESC LIMIT 1", "question": "What is the id and last name of the driver who participated in the most races after 2010?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT name FROM circuits WHERE country = \"UK\" OR country = \"Malaysia\"", "question": "What are the names of circuits that belong to UK or Malaysia?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT name FROM circuits WHERE country = \"UK\" OR country = \"Malaysia\"", "question": "What are the names of all the circuits that are in the UK or Malaysia?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT circuitid , LOCATION FROM circuits WHERE country = \"France\" OR country = \"Belgium\"", "question": "Find the id and location of circuits that belong to France or Belgium?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT circuitid , LOCATION FROM circuits WHERE country = \"France\" OR country = \"Belgium\"", "question": "What are the ids and locations of all circuits in France or Belgium?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = \"Japanese\" AND T2.points > 5", "question": "Find the names of Japanese constructors that have once earned more than 5 points?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = \"Japanese\" AND T2.points > 5", "question": "What are the names of all the Japanese constructors that have earned more than 5 points?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT avg(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = \"Monaco Grand Prix\"", "question": "What is the average fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT avg(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = \"Monaco Grand Prix\"", "question": "What is the average fastest lap speed for the Monaco Grand Prix in 2008?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT max(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = \"Monaco Grand Prix\"", "question": "What is the maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT max(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = \"Monaco Grand Prix\"", "question": "What is the maximum fastest lap speed in the Monaco Grand Prix in 2008?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT max(T2.fastestlapspeed) , T1.name , T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year", "question": "What are the maximum fastest lap speed in races held after 2004 grouped by race name and ordered by year?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT max(T2.fastestlapspeed) , T1.name , T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year", "question": "For each race name, What is the maximum fastest lap speed for races after 2004 ordered by year?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT avg(T2.fastestlapspeed) , T1.name , T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year", "question": "What are the average fastest lap speed in races held after 2004 grouped by race name and ordered by year?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT avg(T2.fastestlapspeed) , T1.name , T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year", "question": "What is the average fastest lap speed for races held after 2004, for each race, ordered by year?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.driverid , T1.forename , count(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING count(*) >= 2", "question": "Find the id, forename and number of races of all drivers who have at least participated in two races?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.driverid , T1.forename , count(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING count(*) >= 2", "question": "What is the id, forename, and number of races for all drivers that have participated in at least 2 races?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.driverid , count(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING count(*) <= 30", "question": "Find the driver id and number of races of all drivers who have at most participated in 30 races?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.driverid , count(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING count(*) <= 30", "question": "For each id of a driver who participated in at most 30 races, how many races did they participate in?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY count(*) DESC LIMIT 1", "question": "Find the id and surname of the driver who participated the most number of races?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY count(*) DESC LIMIT 1", "question": "What are the ids and last names of all drivers who participated in the most races?", "schema": "circuits: circuitId (INTEGER), circuitRef (TEXT), name (TEXT), location (TEXT), country (TEXT), lat (REAL), lng (REAL), alt (INTEGER), url (TEXT)\nraces: raceId (INTEGER), year (INTEGER), round (INTEGER), circuitId (INTEGER), name (TEXT), date (TEXT), time (TEXT), url (TEXT)\ndrivers: driverId (INTEGER), driverRef (TEXT), number (INTEGER), code (TEXT), forename (TEXT), surname (TEXT), dob (TEXT), nationality (TEXT), url (TEXT)\nstatus: statusId (INTEGER), status (TEXT)\nseasons: year (INTEGER), url (TEXT)\nconstructors: constructorId (INTEGER), constructorRef (TEXT), name (TEXT), nationality (TEXT), url (TEXT)\nconstructorStandings: constructorStandingsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nresults: resultId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), grid (INTEGER), position (INTEGER), positionText (TEXT), positionOrder (INTEGER), points (REAL), laps (INTEGER), time (TEXT), milliseconds (INTEGER), fastestLap (INTEGER), rank (INTEGER), fastestLapTime (TEXT), fastestLapSpeed (TEXT), statusId (INTEGER)\ndriverStandings: driverStandingsId (INTEGER), raceId (INTEGER), driverId (INTEGER), points (REAL), position (INTEGER), positionText (TEXT), wins (INTEGER)\nconstructorResults: constructorResultsId (INTEGER), raceId (INTEGER), constructorId (INTEGER), points (REAL), status (REAL)\nqualifying: qualifyId (INTEGER), raceId (INTEGER), driverId (INTEGER), constructorId (INTEGER), number (INTEGER), position (INTEGER), q1 (TEXT), q2 (TEXT), q3 (TEXT)\npitStops: raceId (INTEGER), driverId (INTEGER), stop (INTEGER), lap (INTEGER), time (TEXT), duration (TEXT), milliseconds (INTEGER)\nlapTimes: raceId (INTEGER), driverId (INTEGER), lap (INTEGER), position (INTEGER), time (TEXT), milliseconds (INTEGER)" }, { "query": "SELECT count(*) FROM technician", "question": "How many technicians are there?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT count(*) FROM technician", "question": "What is the number of technicians?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Name FROM technician ORDER BY Age ASC", "question": "List the names of technicians in ascending order of age.", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Name FROM technician ORDER BY Age ASC", "question": "What are the names of the technicians by ascending order of age?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Team , Starting_Year FROM technician", "question": "What are the team and starting year of technicians?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Team , Starting_Year FROM technician", "question": "What is the team and starting year for each technician?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Name FROM technician WHERE Team != \"NYY\"", "question": "List the name of technicians whose team is not \"NYY\".", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Name FROM technician WHERE Team != \"NYY\"", "question": "What is the name of the technician whose team is not 'NYY'?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Name FROM technician WHERE Age = 36 OR Age = 37", "question": "Show the name of technicians aged either 36 or 37", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Name FROM technician WHERE Age = 36 OR Age = 37", "question": "What are the names of the technicians aged either 36 or 37?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1", "question": "What is the starting year of the oldest technicians?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1", "question": "What is the starting year for the oldest technician?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Team , COUNT(*) FROM technician GROUP BY Team", "question": "Show different teams of technicians and the number of technicians in each team.", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Team , COUNT(*) FROM technician GROUP BY Team", "question": "For each team, how many technicians are there?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1", "question": "Please show the team that has the most number of technicians.", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1", "question": "What are the teams with the most technicians?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2", "question": "Show the team that have at least two technicians.", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2", "question": "What is the team with at least 2 technicians?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT T3.Name , T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID", "question": "Show names of technicians and series of machines they are assigned to repair.", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT T3.Name , T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID", "question": "What are the names of technicians and the machine series that they repair?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID ORDER BY T2.quality_rank", "question": "Show names of technicians in ascending order of quality rank of the machine they are assigned.", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID ORDER BY T2.quality_rank", "question": "What are the names of the technicians by ascending order of quality rank for the machine they are assigned?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID WHERE T2.value_points > 70", "question": "Show names of technicians who are assigned to repair machines with value point more than 70.", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID WHERE T2.value_points > 70", "question": "What are the names of the technicians that are assigned to repair machines with more point values than 70?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT T2.Name , COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name", "question": "Show names of technicians and the number of machines they are assigned to repair.", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT T2.Name , COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name", "question": "What are the names of the technicians and how many machines are they assigned to repair?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Name FROM technician WHERE technician_id NOT IN (SELECT technician_id FROM repair_assignment)", "question": "List the names of technicians who have not been assigned to repair machines.", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Name FROM technician WHERE technician_id NOT IN (SELECT technician_id FROM repair_assignment)", "question": "What are the names of the technicians that have not been assigned to repair machines?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Starting_Year FROM technician WHERE Team = \"CLE\" INTERSECT SELECT Starting_Year FROM technician WHERE Team = \"CWS\"", "question": "Show the starting years shared by technicians from team \"CLE\" and \"CWS\".", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT Starting_Year FROM technician WHERE Team = \"CLE\" INTERSECT SELECT Starting_Year FROM technician WHERE Team = \"CWS\"", "question": "What are the starting years shared by the technicians from the team \"CLE\" or \"CWS\"?", "schema": "repair: repair_ID (INT), name (TEXT), Launch_Date (TEXT), Notes (TEXT)\nmachine: Machine_ID (INT), Making_Year (INT), Class (TEXT), Team (TEXT), Machine_series (TEXT), value_points (REAL), quality_rank (INT)\ntechnician: technician_id (REAL), Name (TEXT), Team (TEXT), Starting_Year (REAL), Age (INT)\nrepair_assignment: technician_id (INT), repair_ID (INT), Machine_ID (INT)" }, { "query": "SELECT count(*) FROM entrepreneur", "question": "How many entrepreneurs are there?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT count(*) FROM entrepreneur", "question": "Count the number of entrepreneurs.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC", "question": "List the companies of entrepreneurs in descending order of money requested.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC", "question": "What are the companies of entrepreneurs, ordered descending by amount of money requested?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Company , Investor FROM entrepreneur", "question": "List the companies and the investors of entrepreneurs.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Company , Investor FROM entrepreneur", "question": "What are the companies and investors that correspond to each entrepreneur?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT avg(Money_Requested) FROM entrepreneur", "question": "What is the average money requested by all entrepreneurs?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT avg(Money_Requested) FROM entrepreneur", "question": "Return the average money requested across all entrepreneurs.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Name FROM People ORDER BY Weight ASC", "question": "What are the names of people in ascending order of weight?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Name FROM People ORDER BY Weight ASC", "question": "Return the names of people, ordered by weight ascending.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID", "question": "What are the names of entrepreneurs?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID", "question": "Return the names of entrepreneurs.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor != \"Rachel Elnaugh\"", "question": "What are the names of entrepreneurs whose investor is not \"Rachel Elnaugh\"?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor != \"Rachel Elnaugh\"", "question": "Return the names of entrepreneurs do no not have the investor Rachel Elnaugh.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Weight FROM people ORDER BY Height ASC LIMIT 1", "question": "What is the weight of the shortest person?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Weight FROM people ORDER BY Height ASC LIMIT 1", "question": "Return the weight of the shortest person.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1", "question": "What is the name of the entrepreneur with the greatest weight?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1", "question": "Return the name of the heaviest entrepreneur.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT sum(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85", "question": "What is the total money requested by entrepreneurs with height more than 1.85?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT sum(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85", "question": "Give the total money requested by entrepreneurs who are taller than 1.85.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = \"Simon Woodroffe\" OR T1.Investor = \"Peter Jones\"", "question": "What are the dates of birth of entrepreneurs with investor \"Simon Woodroffe\" or \"Peter Jones\"?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = \"Simon Woodroffe\" OR T1.Investor = \"Peter Jones\"", "question": "Return the dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC", "question": "What are the weights of entrepreneurs in descending order of money requested?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC", "question": "Return the weights of entrepreneurs, ordered descending by amount of money requested.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Investor , COUNT(*) FROM entrepreneur GROUP BY Investor", "question": "What are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Investor , COUNT(*) FROM entrepreneur GROUP BY Investor", "question": "How many entrepreneurs correspond to each investor?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the investor that has invested in the most number of entrepreneurs?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1", "question": "Return the investor who have invested in the greatest number of entrepreneurs.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2", "question": "What are the investors that have invested in at least two entrepreneurs?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2", "question": "Return the investors who have invested in two or more entrepreneurs.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT T2.Name , T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested", "question": "List the names of entrepreneurs and their companies in descending order of money requested?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT T2.Name , T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested", "question": "What are the names of entrepreneurs and their corresponding investors, ordered descending by the amount of money requested?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM entrepreneur)", "question": "List the names of people that are not entrepreneurs.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM entrepreneur)", "question": "What are the names of people who are not entrepreneurs?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000", "question": "Show the investors shared by entrepreneurs that requested more than 140000 and entrepreneurs that requested less than 120000.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000", "question": "What are the investors who have invested in both entrepreneurs who requested more than 140000 and entrepreneurs who requested less than 120000?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT count(DISTINCT Company) FROM entrepreneur", "question": "How many distinct companies are there?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT count(DISTINCT Company) FROM entrepreneur", "question": "Count the number of different companies.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1", "question": "Show the company of the tallest entrepreneur.", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1", "question": "Which company was started by the entrepreneur with the greatest height?", "schema": "entrepreneur: Entrepreneur_ID (INT), People_ID (INT), Company (TEXT), Money_Requested (REAL), Investor (TEXT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Date_of_Birth (TEXT)" }, { "query": "SELECT count(*) FROM perpetrator", "question": "How many perpetrators are there?", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT Date FROM perpetrator ORDER BY Killed DESC", "question": "List the date of perpetrators in descending order of the number of people killed.", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT Injured FROM perpetrator ORDER BY Injured ASC", "question": "List the number of people injured by perpetrators in ascending order.", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT avg(Injured) FROM perpetrator", "question": "What is the average number of people injured by all perpetrators?", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1", "question": "What is the location of the perpetrator with the largest kills.", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT Name FROM People ORDER BY Height ASC", "question": "What are the names of people in ascending order of height?", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID", "question": "What are the names of perpetrators?", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country != \"China\"", "question": "What are the names of perpetrators whose country is not \"China\"?", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Weight DESC LIMIT 1", "question": "What is the name of the perpetrator with the biggest weight.", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT sum(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 1.84", "question": "What is the total kills of the perpetrators with height more than 1.84.", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country = \"China\" OR T2.Country = \"Japan\"", "question": "What are the names of perpetrators in country \"China\" or \"Japan\"?", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Injured DESC", "question": "What are the heights of perpetrators in descending order of the number of people they injured?", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT Country , COUNT(*) FROM perpetrator GROUP BY Country", "question": "What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there.", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT Country , COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the country that has the most perpetrators?", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT Country , COUNT(*) FROM perpetrator GROUP BY Country HAVING COUNT(*) >= 2", "question": "What are the countries that have at least two perpetrators?", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Year DESC", "question": "List the names of perpetrators in descending order of the year.", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM perpetrator)", "question": "List the names of people that are not perpetrators.", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT Country FROM perpetrator WHERE Injured > 50 INTERSECT SELECT Country FROM perpetrator WHERE Injured < 20", "question": "Show the countries that have both perpetrators with injures more than 50 and perpetrators with injures smaller than 20.", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT count(DISTINCT LOCATION) FROM perpetrator", "question": "How many distinct locations of perpetrators are there?", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1", "question": "Show the date of the tallest perpetrator.", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT max(YEAR) FROM perpetrator;", "question": "In which year did the most recent crime happen?", "schema": "perpetrator: Perpetrator_ID (INT), People_ID (INT), Date (TEXT), Year (REAL), Location (TEXT), Country (TEXT), Killed (INT), Injured (INT)\npeople: People_ID (INT), Name (TEXT), Height (REAL), Weight (REAL), Home (TOWN\")" }, { "query": "SELECT campus FROM campuses WHERE county = \"Los Angeles\"", "question": "Report the name of all campuses in Los Angeles county.", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM campuses WHERE county = \"Los Angeles\"", "question": "What campuses are located in the county of Los Angeles?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM campuses WHERE LOCATION = \"Chico\"", "question": "What are the names of all campuses located at Chico?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM campuses WHERE LOCATION = \"Chico\"", "question": "What campuses are located in Chico?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM campuses WHERE YEAR = 1958", "question": "Find all the campuses opened in 1958.", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM campuses WHERE YEAR = 1958", "question": "What are the campuses that opened in 1958?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM campuses WHERE YEAR < 1800", "question": "Find the name of the campuses opened before 1800.", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM campuses WHERE YEAR < 1800", "question": "What campuses opened before 1800?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM campuses WHERE YEAR >= 1935 AND YEAR <= 1939", "question": "Which campus was opened between 1935 and 1939?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM campuses WHERE YEAR >= 1935 AND YEAR <= 1939", "question": "What campuses opened between 1935 and 1939?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM campuses WHERE LOCATION = \"Northridge\" AND county = \"Los Angeles\" UNION SELECT campus FROM campuses WHERE LOCATION = \"San Francisco\" AND county = \"San Francisco\"", "question": "Find the name of the campuses that is in Northridge, Los Angeles or in San Francisco, San Francisco.", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM campuses WHERE LOCATION = \"Northridge\" AND county = \"Los Angeles\" UNION SELECT campus FROM campuses WHERE LOCATION = \"San Francisco\" AND county = \"San Francisco\"", "question": "What campuses are located in Northridge, Los Angeles or in San Francisco, San Francisco?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = \"San Jose State University\" AND T2.year = 1996", "question": "What is the campus fee of \"San Jose State University\" in year 1996?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = \"San Jose State University\" AND T2.year = 1996", "question": "What is the campus fee for San Jose State University in 1996?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = \"San Francisco State University\" AND T2.year = 1996", "question": "What is the campus fee of \"San Francisco State University\" in year 1996?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = \"San Francisco State University\" AND T2.year = 1996", "question": "What is the campus fee for San Francisco State University in 1996?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT count(*) FROM csu_fees WHERE campusfee > (SELECT avg(campusfee) FROM csu_fees)", "question": "Find the count of universities whose campus fee is greater than the average campus fee.", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT count(*) FROM csu_fees WHERE campusfee > (SELECT avg(campusfee) FROM csu_fees)", "question": "How many universities have a campus fee higher than average?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT count(*) FROM csu_fees WHERE campusfee > (SELECT avg(campusfee) FROM csu_fees)", "question": "Find the count of universities whose campus fee is greater than the average campus fee.", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT count(*) FROM csu_fees WHERE campusfee > (SELECT avg(campusfee) FROM csu_fees)", "question": "How many universities have a campus fee greater than the average?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM campuses WHERE county = \"Los Angeles\" AND YEAR > 1950", "question": "Which university is in Los Angeles county and opened after 1950?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM campuses WHERE county = \"Los Angeles\" AND YEAR > 1950", "question": "What campuses are located in Los Angeles county and opened after 1950?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT YEAR FROM degrees GROUP BY YEAR ORDER BY sum(degrees) DESC LIMIT 1", "question": "Which year has the most degrees conferred?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT YEAR FROM degrees GROUP BY YEAR ORDER BY sum(degrees) DESC LIMIT 1", "question": "In what year was the most degrees conferred?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM degrees GROUP BY campus ORDER BY sum(degrees) DESC LIMIT 1", "question": "Which campus has the most degrees conferred in all times?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM degrees GROUP BY campus ORDER BY sum(degrees) DESC LIMIT 1", "question": "What campus has the most degrees conferrred over its entire existence?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1", "question": "Which campus has the most faculties in year 2003?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1", "question": "What campus has the most faculties in 2003?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT avg(campusfee) FROM csu_fees WHERE YEAR = 1996", "question": "Find the average fee on a CSU campus in 1996", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT avg(campusfee) FROM csu_fees WHERE YEAR = 1996", "question": "What is the average fee for a CSU campus in the year of 1996?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT avg(campusfee) FROM csu_fees WHERE YEAR = 2005", "question": "What is the average fee on a CSU campus in 2005?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT avg(campusfee) FROM csu_fees WHERE YEAR = 2005", "question": "What is the average fee for a CSU campus in the year of 2005?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T1.campus , sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus", "question": "report the total number of degrees granted between 1998 and 2002.", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T1.campus , sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus", "question": "how many degrees were conferred between 1998 and 2002?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T1.campus , sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = \"Orange\" AND T2.year >= 2000 GROUP BY T1.campus", "question": "For each Orange county campus, report the number of degrees granted after 2000.", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T1.campus , sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = \"Orange\" AND T2.year >= 2000 GROUP BY T1.campus", "question": "What is the total number of degrees granted after 2000 for each Orange county campus?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT max(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = \"Orange\")", "question": "Find the names of the campus which has more faculties in 2002 than every campus in Orange county.", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT max(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = \"Orange\")", "question": "What are the names of the campus that have more faculties in 2002 than the maximum number in Orange county?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200", "question": "What campus had more than 400 total enrollment but more than 200 full time enrollment in year 1956?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200", "question": "What campus started in year 1956, has more than 200 full time students, and more than 400 students enrolled?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT count(*) FROM campuses WHERE county = \"Los Angeles\"", "question": "How many campuses are there in Los Angeles county?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT count(*) FROM campuses WHERE county = \"Los Angeles\"", "question": "How many campuses exist are in the county of LA?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM campuses WHERE county = \"Los Angeles\"", "question": "List the campuses in Los Angeles county.", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT campus FROM campuses WHERE county = \"Los Angeles\"", "question": "What campuses are in Los Angeles county?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = \"San Jose State University\" AND t2.year = 2000", "question": "How many degrees were conferred in \"San Jose State University\" in 2000?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = \"San Jose State University\" AND t2.year = 2000", "question": "How many degrees were conferred at San Jose State University in 2000?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = \"San Francisco State University\" AND t2.year = 2001", "question": "What are the degrees conferred in \"San Francisco State University\" in 2001.", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = \"San Francisco State University\" AND t2.year = 2001", "question": "What degrees were conferred in San Francisco State University in the year 2001?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT sum(faculty) FROM faculty WHERE YEAR = 2002", "question": "How many faculty is there in total in the year of 2002?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT sum(faculty) FROM faculty WHERE YEAR = 2002", "question": "How many faculty, in total, are there in the year 2002?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = \"Long Beach State University\"", "question": "What is the number of faculty lines in campus \"Long Beach State University\" in 2002?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = \"Long Beach State University\"", "question": "What is the number of faculty at Long Beach State University in 2002?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = \"San Francisco State University\"", "question": "How many faculty lines are there in \"San Francisco State University\" in year 2004?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = \"San Francisco State University\"", "question": "How many faculty lines are there at San Francisco State University in 2004?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id = t2.campus WHERE t2.faculty >= 600 AND t2.faculty <= 1000 AND T1.year = 2004", "question": "List the campus that have between 600 and 1000 faculty lines in year 2004.", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id = t2.campus WHERE t2.faculty >= 600 AND t2.faculty <= 1000 AND T1.year = 2004", "question": "What are the campuses that had between 600 and 1000 faculty members in 2004?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1", "question": "How many faculty lines are there in the university that conferred the most number of degrees in year 2002?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1", "question": "How many faculty members did the university that conferred the most degrees in 2002 have?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees LIMIT 1", "question": "How many faculty lines are there in the university that conferred the least number of degrees in year 2001?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees LIMIT 1", "question": "How many faculty members are at the university that gave the least number of degrees in 2001?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT sum(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = \"San Jose State University\"", "question": "How many undergraduates are there in \"San Jose State University\" in year 2004?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT sum(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = \"San Jose State University\"", "question": "How many undergraduates are there at San Jose State", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT sum(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = \"San Francisco State University\"", "question": "What is the number of graduates in \"San Francisco State University\" in year 2004?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT sum(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = \"San Francisco State University\"", "question": "How many people graduated from San Francisco State University in 2004?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = \"San Francisco State University\" AND t1.year = 2000", "question": "What is the campus fee of \"San Francisco State University\" in year 2000?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = \"San Francisco State University\" AND t1.year = 2000", "question": "In the year 2000, what is the campus fee for San Francisco State University?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = \"San Jose State University\" AND t1.year = 2000", "question": "Find the campus fee of \"San Jose State University\" in year 2000.", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = \"San Jose State University\" AND t1.year = 2000", "question": "What is the campus fee in the year 2000 for San Jose State University?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT count(*) FROM campuses", "question": "How many CSU campuses are there?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT count(*) FROM campuses", "question": "What is the total number of campuses?", "schema": "Campuses: Id (INTEGER), Campus (TEXT), Location (TEXT), County (TEXT), Year (INTEGER)\ncsu_fees: Campus (INTEGER), Year (INTEGER), CampusFee (INTEGER)\ndegrees: Year (INTEGER), Campus (INTEGER), Degrees (INTEGER)\ndiscipline_enrollments: Campus (INTEGER), Discipline (INTEGER), Year (INTEGER), Undergraduate (INTEGER), Graduate (INTEGER)\nenrollments: Campus (INTEGER), Year (INTEGER), TotalEnrollment_AY (INTEGER), FTE_AY (INTEGER)\nfaculty: Campus (INTEGER), Year (INTEGER), Faculty (REAL)" }, { "query": "SELECT count(*) FROM candidate", "question": "How many candidates are there?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT count(*) FROM candidate", "question": "Count the number of candidates.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY count(*) DESC LIMIT 1", "question": "Which poll resource provided the most number of candidate information?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY count(*) DESC LIMIT 1", "question": "Return the poll resource associated with the most candidates.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3", "question": "what are the top 3 highest support rates?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3", "question": "Return the top 3 greatest support rates.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1", "question": "Find the id of the candidate who got the lowest oppose rate.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1", "question": "What is the id of the candidate with the lowest oppose rate?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT Support_rate , Consider_rate , Oppose_rate FROM candidate ORDER BY unsure_rate", "question": "Please list support, consider, and oppose rates for each candidate in ascending order by unsure rate.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT Support_rate , Consider_rate , Oppose_rate FROM candidate ORDER BY unsure_rate", "question": "What are the support, consider, and oppose rates of each candidate, ordered ascending by their unsure rate?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1", "question": "which poll source does the highest oppose rate come from?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1", "question": "Return the poll source corresponding to the candidate who has the oppose rate.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT name FROM people ORDER BY date_of_birth", "question": "List all people names in the order of their date of birth from old to young.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT name FROM people ORDER BY date_of_birth", "question": "What are the names of all people, ordered by their date of birth?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT avg(height) , avg(weight) FROM people WHERE sex = 'M'", "question": "Find the average height and weight for all males (sex is M).", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT avg(height) , avg(weight) FROM people WHERE sex = 'M'", "question": "What are the average height and weight across males (sex is M)?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT name FROM people WHERE height > 200 OR height < 190", "question": "find the names of people who are taller than 200 or lower than 190.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT name FROM people WHERE height > 200 OR height < 190", "question": "What are the names of people who have a height greater than 200 or less than 190?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT avg(weight) , min(weight) , sex FROM people GROUP BY sex", "question": "Find the average and minimum weight for each gender.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT avg(weight) , min(weight) , sex FROM people GROUP BY sex", "question": "What are the average and minimum weights for people of each sex?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT t1.name , t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id ORDER BY t2.support_rate DESC LIMIT 1", "question": "Find the name and gender of the candidate who got the highest support rate.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT t1.name , t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id ORDER BY t2.support_rate DESC LIMIT 1", "question": "What is the name and sex of the candidate with the highest support rate?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT t1.name , t1.sex , min(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex", "question": "Find the name of the candidates whose oppose percentage is the lowest for each sex.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT t1.name , t1.sex , min(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex", "question": "For each sex, what is the name and sex of the candidate with the oppose rate for their sex?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY avg(t2.unsure_rate) DESC LIMIT 1", "question": "which gender got the highest average uncertain ratio.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY avg(t2.unsure_rate) DESC LIMIT 1", "question": "What is the sex of the candidate who had the highest unsure rate?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT name FROM people WHERE people_id NOT IN (SELECT people_id FROM candidate)", "question": "what are the names of people who did not participate in the candidate election.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT name FROM people WHERE people_id NOT IN (SELECT people_id FROM candidate)", "question": "Give the names of people who did not participate in the candidate election.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate", "question": "Find the names of the candidates whose support percentage is lower than their oppose rate.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate", "question": "What are the names of candidates who have a lower support rate than oppose rate?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT count(*) , sex FROM people WHERE weight > 85 GROUP BY sex", "question": "how many people are there whose weight is higher than 85 for each gender?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT count(*) , sex FROM people WHERE weight > 85 GROUP BY sex", "question": "Count the number of people of each sex who have a weight higher than 85.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT max(support_rate) , min(consider_rate) , min(oppose_rate) FROM candidate", "question": "find the highest support percentage, lowest consider rate and oppose rate of all candidates.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT max(support_rate) , min(consider_rate) , min(oppose_rate) FROM candidate", "question": "Return the maximum support rate, minimum consider rate, and minimum oppose rate across all candidates?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name", "question": "list all female (sex is F) candidate names in the alphabetical order.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name", "question": "What are the names of all female candidates in alphabetical order (sex is F)?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT name FROM people WHERE height < (SELECT avg(height) FROM people)", "question": "find the name of people whose height is lower than the average.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT name FROM people WHERE height < (SELECT avg(height) FROM people)", "question": "What are the names of people who are shorter than average?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT * FROM people", "question": "List all info about all people.", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT * FROM people", "question": "What is all the information about all people?", "schema": "candidate: Candidate_ID (INT), People_ID (INT), Poll_Source (TEXT), Date (TEXT), Support_rate (REAL), Consider_rate (REAL), Oppose_rate (REAL), Unsure_rate (REAL)\npeople: People_ID (INT), Sex (TEXT), Name (TEXT), Date_of_Birth (TEXT), Height (REAL), Weight (REAL)" }, { "query": "SELECT title FROM Movie WHERE director = 'Steven Spielberg'", "question": "Find the titles of all movies directed by steven spielberg.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT title FROM Movie WHERE director = 'Steven Spielberg'", "question": "What are the names of all movies directed by Steven Spielberg?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000", "question": "What is the name of the movie produced after 2000 and directed by James Cameron?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000", "question": "What are the titles of all movies that James Cameron directed after 2000?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT count(*) FROM Movie WHERE YEAR < 2000", "question": "How many movies were made before 2000?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT count(*) FROM Movie WHERE YEAR < 2000", "question": "How many movies were made before 2000?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT director FROM Movie WHERE title = 'Avatar'", "question": "Who is the director of movie Avatar?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT director FROM Movie WHERE title = 'Avatar'", "question": "Who directed Avatar?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT count(*) FROM Reviewer", "question": "How many reviewers listed?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT count(*) FROM Reviewer", "question": "How many reviewers are there?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT rID FROM Reviewer WHERE name LIKE \"%Mike%\"", "question": "What is the id of the reviewer whose name has substring \u201cMike\u201d?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT rID FROM Reviewer WHERE name LIKE \"%Mike%\"", "question": "What is the id of the reviewer whose name includes the word \"Mike\"?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT rID FROM Reviewer WHERE name = \"Daniel Lewis\"", "question": "What is the reviewer id of Daniel Lewis?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT rID FROM Reviewer WHERE name = \"Daniel Lewis\"", "question": "What is the id of the reviewer named Daniel Lewis?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT count(*) FROM Rating WHERE stars > 3", "question": "What is the total number of ratings that has more than 3 stars?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT count(*) FROM Rating WHERE stars > 3", "question": "How many movie ratings have more than 3 stars?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT max(stars) , min(stars) FROM Rating", "question": "What is the lowest and highest rating star?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT max(stars) , min(stars) FROM Rating", "question": "What is the maximum and mininum number of stars a rating can receive?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT DISTINCT YEAR FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year", "question": "Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT DISTINCT YEAR FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year", "question": "In what years did a movie receive a 4 or 5 star rating, and list the years from oldest to most recently?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T1.director , T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 5", "question": "What are the names of directors who directed movies with 5 star rating? Also return the title of these movies.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T1.director , T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 5", "question": "What are the names of the directors who created a movie with a 5 star rating, and what was the name of those movies?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.name , avg(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name", "question": "What is the average rating star for each reviewer?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.name , avg(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name", "question": "What is the average number of stars that each reviewer awards for a movie?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT title FROM Movie WHERE mID NOT IN (SELECT mID FROM Rating)", "question": "Find the titles of all movies that have no ratings.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT title FROM Movie WHERE mID NOT IN (SELECT mID FROM Rating)", "question": "What are the titles of all movies that have not been rated?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT DISTINCT name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE ratingDate = \"null\"", "question": "Find the names of all reviewers who have ratings with a NULL value for the date.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT DISTINCT name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE ratingDate = \"null\"", "question": "What are the different names of all reviewers whose ratings do not have a date field?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT avg(T1.stars) , T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT min(YEAR) FROM Movie)", "question": "What is the average rating stars and title for the oldest movie?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT avg(T1.stars) , T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT min(YEAR) FROM Movie)", "question": "For the oldest movie listed, what is its average rating and title?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT title FROM Movie WHERE YEAR = (SELECT max(YEAR) FROM Movie)", "question": "What is the name of the most recent movie?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT title FROM Movie WHERE YEAR = (SELECT max(YEAR) FROM Movie)", "question": "What is the title of the newest movie?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT max(T1.stars) , T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT max(YEAR) FROM Movie)", "question": "What is the maximum stars and year for the most recent movie?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT max(T1.stars) , T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT max(YEAR) FROM Movie)", "question": "What is highest rating for the most recent movie and when was it released?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT title FROM Movie WHERE YEAR > (SELECT max(YEAR) FROM Movie WHERE director = \"Steven Spielberg\")", "question": "What is the names of movies whose created year is after all movies directed by Steven Spielberg?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT title FROM Movie WHERE YEAR > (SELECT max(YEAR) FROM Movie WHERE director = \"Steven Spielberg\")", "question": "What are the names of all movies that were created after the most recent Steven Spielberg film?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars > (SELECT avg(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.director = \"James Cameron\")", "question": "What are the titles and directors of the movies whose star is greater than the average stars of the movies directed by James Cameron?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars > (SELECT avg(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.director = \"James Cameron\")", "question": "What are the titles and directors of all movies that have a rating higher than the average James Cameron film rating?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T3.name , T2.title , T1.stars , T1.ratingDate FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID ORDER BY T3.name , T2.title , T1.stars", "question": "Return reviewer name, movie title, stars, and ratingDate. And sort the data first by reviewer name, then by movie title, and lastly by number of stars.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T3.name , T2.title , T1.stars , T1.ratingDate FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID ORDER BY T3.name , T2.title , T1.stars", "question": "What is the reviewer name, film title, movie rating, and rating date for every movie ordered by reviewer name, movie title, then finally rating?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T1.rID HAVING COUNT(*) >= 3", "question": "Find the names of all reviewers who have contributed three or more ratings.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T1.rID HAVING COUNT(*) >= 3", "question": "What are the names of all reviewers that have rated 3 or more movies?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT DISTINCT T3.name FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.title = 'Gone with the Wind'", "question": "Find the names of all reviewers who rated Gone with the Wind.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT DISTINCT T3.name FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.title = 'Gone with the Wind'", "question": "What are the names of all the different reviewers who rates Gone with the Wind?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT DISTINCT T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Sarah Martinez'", "question": "Find the names of all directors whose movies are rated by Sarah Martinez.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT DISTINCT T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Sarah Martinez'", "question": "What are the names of all directors whose movies have been reviewed by Sarah Martinez?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT DISTINCT T3.name , T2.title , T1.stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.director = T3.name", "question": "For any rating where the name of reviewer is the same as the director of the movie, return the reviewer name, movie title, and number of stars.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT DISTINCT T3.name , T2.title , T1.stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.director = T3.name", "question": "What are the different reviewer names, movie titles, and stars for every rating where the reviewer had the same name as the director?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT name FROM Reviewer UNION SELECT title FROM Movie", "question": "Return all reviewer names and movie names together in a single list.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT name FROM Reviewer UNION SELECT title FROM Movie", "question": "What are the names of all the reviewers and movie names?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT DISTINCT title FROM Movie EXCEPT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Chris Jackson'", "question": "Find the titles of all movies not reviewed by Chris Jackson.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT DISTINCT title FROM Movie EXCEPT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Chris Jackson'", "question": "What are the titles of all movies that were not reviewed by Chris Jackson?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T1.title , T1.director FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title != T2.title ORDER BY T1.director , T1.title", "question": "For all directors who directed more than one movie, return the titles of all movies directed by them, along with the director name. Sort by director name, then movie title.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T1.title , T1.director FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title != T2.title ORDER BY T1.director , T1.title", "question": "For all directors who have directed more than one movie, what movies have they directed and what are their names?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T1.title , T1.year FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title != T2.title", "question": "For directors who had more than one movie, return the titles and produced years of all movies directed by them.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T1.title , T1.year FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title != T2.title", "question": "For each director who directed more than one movie, what are the titles and dates of release for all those movies?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT director FROM Movie GROUP BY director HAVING count(*) = 1", "question": "What are the names of the directors who made exactly one movie?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT director FROM Movie GROUP BY director HAVING count(*) = 1", "question": "What are the names of all directors who made one movie?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT director FROM Movie WHERE director != \"null\" GROUP BY director HAVING count(*) = 1", "question": "What are the names of the directors who made exactly one movie excluding director NULL?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT director FROM Movie WHERE director != \"null\" GROUP BY director HAVING count(*) = 1", "question": "What are the names of all directors who have made one movie except for the director named NULL?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT count(*) , T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director", "question": "How many movie reviews does each director get?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT count(*) , T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director", "question": "For each director, how many reviews have they received?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , avg(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY avg(T1.stars) DESC LIMIT 1", "question": "Find the movies with the highest average rating. Return the movie titles and average rating.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , avg(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY avg(T1.stars) DESC LIMIT 1", "question": "What are the movie titles with the highest average rating and what are those ratings?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , avg(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY avg(T1.stars) LIMIT 1", "question": "What are the movie titles and average rating of the movies with the lowest average rating?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , avg(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY avg(T1.stars) LIMIT 1", "question": "What are the titles and average ratings for all movies that have the lowest average rating?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY T1.stars DESC LIMIT 3", "question": "What are the names and years of the movies that has the top 3 highest rating star?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY T1.stars DESC LIMIT 3", "question": "What are the names and years released for the movies with the top 3 highest ratings?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , T1.stars , T2.director , max(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director != \"null\" GROUP BY director", "question": "For each director, return the director's name together with the title of the movie they directed that received the highest rating among all of their movies, and the value of that rating. Ignore movies whose director is NULL.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , T1.stars , T2.director , max(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director != \"null\" GROUP BY director", "question": "For each director, what are the titles and ratings for all the movies they reviewed?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , T1.rID , T1.stars , min(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID", "question": "Find the title and star rating of the movie that got the least rating star for each reviewer.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , T1.rID , T1.stars , min(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID", "question": "For each reviewer id, what is the title and rating for the movie with the smallest rating?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , T1.stars , T2.director , min(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director", "question": "Find the title and score of the movie with the lowest rating among all movies directed by each director.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , T1.stars , T2.director , min(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director", "question": "For each director, what is the title and score of their most poorly rated movie?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , T1.mID FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of the movie that is rated by most of times?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title , T1.mID FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of the movie that has been reviewed the most?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5", "question": "What are the titles of all movies that have rating star is between 3 and 5?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5", "question": "What are the titles of all movies that have between 3 and 5 stars?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars > 3", "question": "Find the names of reviewers who had given higher than 3 star ratings.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars > 3", "question": "What are the names of the reviewers who have rated a movie more than 3 stars before?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT mID , avg(stars) FROM Rating WHERE mID NOT IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = \"Brittany Harris\") GROUP BY mID", "question": "Find the average rating star for each movie that are not reviewed by Brittany Harris.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT mID , avg(stars) FROM Rating WHERE mID NOT IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = \"Brittany Harris\") GROUP BY mID", "question": "What is the average rating for each movie that has never been reviewed by Brittany Harris?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT mID FROM Rating EXCEPT SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = \"Brittany Harris\"", "question": "What are the ids of the movies that are not reviewed by Brittany Harris.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT mID FROM Rating EXCEPT SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = \"Brittany Harris\"", "question": "What are the ids of all moviest hat have not been reviewed by Britanny Harris?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT mID , avg(stars) FROM Rating GROUP BY mID HAVING count(*) >= 2", "question": "Find the average rating star for each movie that received at least 2 ratings.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT mID , avg(stars) FROM Rating GROUP BY mID HAVING count(*) >= 2", "question": "For each movie that received more than 3 reviews, what is the average rating?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars = 4", "question": "find the ids of reviewers who did not give 4 star.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars = 4", "question": "What are the ids of all reviewers who did not give 4 stars?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT rID FROM Rating WHERE stars != 4", "question": "Find the ids of reviewers who didn't only give 4 star.", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT rID FROM Rating WHERE stars != 4", "question": "What are the ids of all reviewers who have not given 4 stars at least once?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT DISTINCT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Brittany Harris' OR T2.year > 2000", "question": "What are names of the movies that are either made after 2000 or reviewed by Brittany Harris?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT DISTINCT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Brittany Harris' OR T2.year > 2000", "question": "What are the names of all movies that were made after 2000 or reviewed by Brittany Harris?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT title FROM Movie WHERE director = \"James Cameron\" OR YEAR < 1980", "question": "What are names of the movies that are either made before 1980 or directed by James Cameron?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT title FROM Movie WHERE director = \"James Cameron\" OR YEAR < 1980", "question": "What are the names of all movies made before 1980 or had James Cameron as the director?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 4", "question": "What are the names of reviewers who had rated 3 star and 4 star?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 4", "question": "What are the names of all reviewers that have given 3 or 4 stars for reviews?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 3 INTERSECT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 4", "question": "What are the names of movies that get 3 star and 4 star?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 3 INTERSECT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 4", "question": "What are the names of all movies that received 3 or 4 stars?", "schema": "Movie(: mID (INT), title (TEXT), year (INT), director (TEXT)\nReviewer(: rID (INT), name (TEXT)\nRating(: rID (INT), mID (INT), stars (INT), ratingDate (DATE)" }, { "query": "SELECT count(*) FROM county_public_safety", "question": "How many counties are there?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT count(*) FROM county_public_safety", "question": "Count the number of countries.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Name FROM county_public_safety ORDER BY Population DESC", "question": "List the names of counties in descending order of population.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Name FROM county_public_safety ORDER BY Population DESC", "question": "What are the names of the counties of public safety, ordered by population descending?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT DISTINCT Police_force FROM county_public_safety WHERE LOCATION != \"East\"", "question": "List the distinct police forces of counties whose location is not on east side.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT DISTINCT Police_force FROM county_public_safety WHERE LOCATION != \"East\"", "question": "What are the different police forces of counties that are not located in the East?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT min(Crime_rate) , max(Crime_rate) FROM county_public_safety", "question": "What are the minimum and maximum crime rate of counties?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT min(Crime_rate) , max(Crime_rate) FROM county_public_safety", "question": "Return the minimum and maximum crime rates across all counties.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Crime_rate FROM county_public_safety ORDER BY Police_officers ASC", "question": "Show the crime rates of counties in ascending order of number of police officers.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Crime_rate FROM county_public_safety ORDER BY Police_officers ASC", "question": "What are the crime rates of counties sorted by number of offices ascending?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Name FROM city ORDER BY Name ASC", "question": "What are the names of cities in ascending alphabetical order?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Name FROM city ORDER BY Name ASC", "question": "Return the names of cities, ordered alphabetically.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Hispanic FROM city WHERE Black > 10", "question": "What are the percentage of hispanics in cities with the black percentage higher than 10?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Hispanic FROM city WHERE Black > 10", "question": "Return the hispanic percentage for cities in which the black percentage is greater than 10.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1", "question": "List the name of the county with the largest population.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1", "question": "What is the name of the county with the greatest population?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Name FROM city ORDER BY White DESC LIMIT 5", "question": "List the names of the city with the top 5 white percentages.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Name FROM city ORDER BY White DESC LIMIT 5", "question": "What are the names of the five cities with the greatest proportion of white people?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT T1.Name , T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID", "question": "Show names of cities and names of counties they are in.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT T1.Name , T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID", "question": "What are the names of cities, as well as the names of the counties they correspond to?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT T1.White , T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID", "question": "Show white percentages of cities and the crime rates of counties they are in.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT T1.White , T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID", "question": "What are the white percentages of cities, and the corresponding crime rates of the counties they correspond to?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT name FROM city WHERE county_ID = (SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1)", "question": "Show the name of cities in the county that has the largest number of police officers.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT name FROM city WHERE county_ID = (SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1)", "question": "What are the names of cities that are in the county with the most police officers?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT count(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population > 20000)", "question": "Show the number of cities in counties that have a population more than 20000.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT count(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population > 20000)", "question": "How many cities are in counties that have populations of over 20000?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID WHERE T1.White > 90", "question": "Show the crime rate of counties with a city having white percentage more than 90.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID WHERE T1.White > 90", "question": "What are the crime rates of counties that contain cities that have white percentages of over 90?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Police_force , COUNT(*) FROM county_public_safety GROUP BY Police_force", "question": "Please show the police forces and the number of counties with each police force.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Police_force , COUNT(*) FROM county_public_safety GROUP BY Police_force", "question": "How many counties correspond to each police force?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the location shared by most counties?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1", "question": "Which location has the most corresponding counties?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Name FROM county_public_safety WHERE County_ID NOT IN (SELECT County_ID FROM city)", "question": "List the names of counties that do not have any cities.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Name FROM county_public_safety WHERE County_ID NOT IN (SELECT County_ID FROM city)", "question": "What are the names of counties that do not contain any cities?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Police_force FROM county_public_safety WHERE LOCATION = \"East\" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION = \"West\"", "question": "Show the police force shared by counties with location on the east and west.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Police_force FROM county_public_safety WHERE LOCATION = \"East\" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION = \"West\"", "question": "Which police forces operate in both counties that are located in the East and in the West?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT name FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE Crime_rate < 100)", "question": "Show the names of cities in counties that have a crime rate less than 100.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT name FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE Crime_rate < 100)", "question": "What are the names of cities that are in counties that have a crime rate below 100?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Case_burden FROM county_public_safety ORDER BY Population DESC", "question": "Show the case burden of counties in descending order of population.", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT Case_burden FROM county_public_safety ORDER BY Population DESC", "question": "What are the case burdens of counties, ordered descending by population?", "schema": "county_public_safety: County_ID (INT), Name (TEXT), Population (INT), Police_officers (INT), Residents_per_officer (INT), Case_burden (INT), Crime_rate (REAL), Police_force (TEXT), Location (TEXT)\ncity: City_ID (INT), County_ID (INT), Name (TEXT), White (REAL), Black (REAL), Amerindian (REAL), Asian (REAL), Multiracial (REAL), Hispanic (REAL)" }, { "query": "SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern';", "question": "Find the names of all modern rooms with a base price below $160 and two beds.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern';", "question": "What are the names of modern rooms that have a base price lower than $160 and two beds.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName , RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 2;", "question": "Find all the rooms that have a price higher than 160 and can accommodate more than 2 people. Report room names and ids.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName , RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 2;", "question": "What are the room names and ids of all the rooms that cost more than 160 and can accommodate more than two people.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY count(*) DESC LIMIT 1;", "question": "Find the most popular room in the hotel. The most popular room is the room that had seen the largest number of reservations.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY count(*) DESC LIMIT 1;", "question": "Which room has the largest number of reservations?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT kids FROM Reservations WHERE FirstName = \"ROY\" AND LastName = \"SWEAZY\";", "question": "How many kids stay in the rooms reserved by ROY SWEAZY?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT kids FROM Reservations WHERE FirstName = \"ROY\" AND LastName = \"SWEAZY\";", "question": "Find the number of kids staying in the rooms reserved by a person called ROY SWEAZ.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT count(*) FROM Reservations WHERE FirstName = \"ROY\" AND LastName = \"SWEAZY\";", "question": "How many times does ROY SWEAZY has reserved a room.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT count(*) FROM Reservations WHERE FirstName = \"ROY\" AND LastName = \"SWEAZY\";", "question": "Find the number of times ROY SWEAZY has reserved a room.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT T2.roomName , T1.Rate , T1.CheckIn , T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1;", "question": "Which room has the highest rate? List the room's full name, rate, check in and check out date.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT T2.roomName , T1.Rate , T1.CheckIn , T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1;", "question": "Return the name, rate, check in and check out date for the room with the highest rate.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT Adults FROM Reservations WHERE CheckIn = \"2010-10-23\" AND FirstName = \"CONRAD\" AND LastName = \"SELBIG\";", "question": "How many adults stay in the room CONRAD SELBIG checked in on Oct 23, 2010?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT Adults FROM Reservations WHERE CheckIn = \"2010-10-23\" AND FirstName = \"CONRAD\" AND LastName = \"SELBIG\";", "question": "Find the number of adults for the room reserved and checked in by CONRAD SELBIG on Oct 23, 2010.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT Kids FROM Reservations WHERE CheckIn = \"2010-09-21\" AND FirstName = \"DAMIEN\" AND LastName = \"TRACHSEL\";", "question": "How many kids stay in the room DAMIEN TRACHSEL checked in on Sep 21, 2010?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT Kids FROM Reservations WHERE CheckIn = \"2010-09-21\" AND FirstName = \"DAMIEN\" AND LastName = \"TRACHSEL\";", "question": "Return the number of kids for the room reserved and checked in by DAMIEN TRACHSEL on Sep 21, 2010.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT sum(beds) FROM Rooms WHERE bedtype = 'King';", "question": "How many king beds are there?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT sum(beds) FROM Rooms WHERE bedtype = 'King';", "question": "Find the total number of king beds available.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName , decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice;", "question": "List the names and decor of rooms that have a king bed. Sort the list by their price.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName , decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice;", "question": "What are the names and decor of rooms with a king bed? Sort them by their price", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName , basePrice FROM Rooms ORDER BY basePrice ASC LIMIT 1;", "question": "Which room has cheapest base price? List the room's name and the base price.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName , basePrice FROM Rooms ORDER BY basePrice ASC LIMIT 1;", "question": "What are the room name and base price of the room with the lowest base price?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT decor FROM Rooms WHERE roomName = \"Recluse and defiance\";", "question": "What is the decor of room Recluse and defiance?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT decor FROM Rooms WHERE roomName = \"Recluse and defiance\";", "question": "Return the decor of the room named \"Recluse and defiance\".", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT bedType , avg(basePrice) FROM Rooms GROUP BY bedType;", "question": "What is the average base price of different bed type? List bed type and average base price.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT bedType , avg(basePrice) FROM Rooms GROUP BY bedType;", "question": "For each bed type, find the average base price of different bed type.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT sum(maxOccupancy) FROM Rooms WHERE decor = 'modern';", "question": "What is the total number of people who could stay in the modern rooms in this inn?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT sum(maxOccupancy) FROM Rooms WHERE decor = 'modern';", "question": "How many people in total can stay in the modern rooms of this inn?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T2.decor ORDER BY count(T2.decor) ASC LIMIT 1;", "question": "What kind of decor has the least number of reservations?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T2.decor ORDER BY count(T2.decor) ASC LIMIT 1;", "question": "What is the least popular kind of decor?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT count(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids;", "question": "List how many times the number of people in the room reached the maximum occupancy of the room. The number of people include adults and kids.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT count(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids;", "question": "How many times the number of adults and kids staying in a room reached the maximum capacity of the room?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT T1.firstname , T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0", "question": "Find the first and last names of people who payed more than the rooms' base prices.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT T1.firstname , T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0", "question": "What are the first and last names of people who payed more than the rooms' base prices?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT count(*) FROM Rooms;", "question": "How many rooms are there?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT count(*) FROM Rooms;", "question": "What is the total number of rooms available in this inn?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT count(*) FROM Rooms WHERE bedType = \"King\";", "question": "Find the number of rooms with a king bed.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT count(*) FROM Rooms WHERE bedType = \"King\";", "question": "How many rooms have a king bed?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT bedType , count(*) FROM Rooms GROUP BY bedType;", "question": "Find the number of rooms for each bed type.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT bedType , count(*) FROM Rooms GROUP BY bedType;", "question": "What are the number of rooms for each bed type?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1;", "question": "Find the name of the room with the maximum occupancy.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1;", "question": "What is the name of the room that can accommodate the most people?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1;", "question": "Find the id and name of the most expensive base price room.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1;", "question": "Which room has the highest base price?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName , bedType FROM Rooms WHERE decor = \"traditional\";", "question": "List the type of bed and name of all traditional rooms.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName , bedType FROM Rooms WHERE decor = \"traditional\";", "question": "What are the bed type and name of all the rooms with traditional decor?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT decor , count(*) FROM Rooms WHERE bedType = \"King\" GROUP BY decor;", "question": "Find the number of rooms with king bed for each decor type.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT decor , count(*) FROM Rooms WHERE bedType = \"King\" GROUP BY decor;", "question": "How many rooms have king beds? Report the number for each decor type.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT decor , avg(basePrice) , min(basePrice) FROM Rooms GROUP BY decor;", "question": "Find the average and minimum price of the rooms in different decor.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT decor , avg(basePrice) , min(basePrice) FROM Rooms GROUP BY decor;", "question": "What is the average minimum and price of the rooms for each different decor.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName FROM Rooms ORDER BY basePrice;", "question": "List the name of all rooms sorted by their prices.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName FROM Rooms ORDER BY basePrice;", "question": "Sort all the rooms according to the price. Just report the room names.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT decor , count(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor;", "question": "Find the number of rooms with price higher than 120 for different decor.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT decor , count(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor;", "question": "How many rooms cost more than 120, for each different decor?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT bedType , avg(basePrice) FROM Rooms GROUP BY bedType;", "question": "For each bed type, find the average room price.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT bedType , avg(basePrice) FROM Rooms GROUP BY bedType;", "question": "What is the average base price of rooms, for each bed type?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName FROM Rooms WHERE bedType = \"King\" OR bedType = \"Queen\";", "question": "List the name of rooms with king or queen bed.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName FROM Rooms WHERE bedType = \"King\" OR bedType = \"Queen\";", "question": "What are the names of rooms that have either king or queen bed?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT count(DISTINCT bedType) FROM Rooms;", "question": "How many different types of beds are there?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT count(DISTINCT bedType) FROM Rooms;", "question": "Find the number of distinct bed types available in this inn.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3;", "question": "Find the name and id of the top 3 expensive rooms.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3;", "question": "What are the name and id of the three highest priced rooms?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName FROM Rooms WHERE basePrice > ( SELECT avg(basePrice) FROM Rooms );", "question": "Find the name of rooms whose price is higher than the average price.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomName FROM Rooms WHERE basePrice > ( SELECT avg(basePrice) FROM Rooms );", "question": "What are the name of rooms that cost more than the average.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT count(*) FROM rooms WHERE roomid NOT IN (SELECT DISTINCT room FROM reservations)", "question": "Find the number of rooms that do not have any reservation.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT count(*) FROM rooms WHERE roomid NOT IN (SELECT DISTINCT room FROM reservations)", "question": "How many rooms have not had any reservation yet?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT T2.roomName , count(*) , T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room", "question": "Return the name and number of reservations made for each of the rooms.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT T2.roomName , count(*) , T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room", "question": "For each room, find its name and the number of times reservations were made for it.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING count(*) > 60", "question": "Find the names of rooms that have been reserved for more than 60 times.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING count(*) > 60", "question": "What are the names of rooms whose reservation frequency exceeds 60 times?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150", "question": "Find the name of rooms whose base price is between 120 and 150.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150", "question": "Which rooms cost between 120 and 150? Give me the room names.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%'", "question": "Find the name of rooms booked by some customers whose first name contains ROY.", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%'", "question": "What are the name of rooms booked by customers whose first name has \"ROY\" in part?", "schema": "Rooms: RoomId (TEXT), roomName (TEXT), beds (INTEGER), bedType (TEXT), maxOccupancy (INTEGER), basePrice (INTEGER), decor (TEXT)\nReservations: Code (INTEGER), Room (TEXT), CheckIn (TEXT), CheckOut (TEXT), Rate (REAL), LastName (TEXT), FirstName (TEXT), Adults (INTEGER), Kids (INTEGER)" }, { "query": "SELECT T1.cmi_details FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax'", "question": "what are the details of the cmi masters that have the cross reference code 'Tax'?", "schema": "Customer_Master_Index: master_customer_id (INTEGER), cmi_details (VARCHAR(255))\nCMI_Cross_References: cmi_cross_ref_id (INTEGER), master_customer_id (INTEGER), source_system_code (CHAR(15))\nCouncil_Tax: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBusiness_Rates: business_rates_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBenefits_Overpayments: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nParking_Fines: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nRent_Arrears: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nElectoral_Register: electoral_register_id (INTEGER), cmi_cross_ref_id (INTEGER)" }, { "query": "SELECT T1.cmi_cross_ref_id , T1.source_system_code FROM CMI_Cross_References AS T1 JOIN Council_Tax AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T1.cmi_cross_ref_id HAVING count(*) >= 1", "question": "What is the cmi cross reference id that is related to at least one council tax entry? List the cross reference id and source system code.", "schema": "Customer_Master_Index: master_customer_id (INTEGER), cmi_details (VARCHAR(255))\nCMI_Cross_References: cmi_cross_ref_id (INTEGER), master_customer_id (INTEGER), source_system_code (CHAR(15))\nCouncil_Tax: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBusiness_Rates: business_rates_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBenefits_Overpayments: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nParking_Fines: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nRent_Arrears: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nElectoral_Register: electoral_register_id (INTEGER), cmi_cross_ref_id (INTEGER)" }, { "query": "SELECT T2.cmi_cross_ref_id , T2.master_customer_id , count(*) FROM Business_Rates AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T2.cmi_cross_ref_id", "question": "How many business rates are related to each cmi cross reference? List cross reference id, master customer id and the n", "schema": "Customer_Master_Index: master_customer_id (INTEGER), cmi_details (VARCHAR(255))\nCMI_Cross_References: cmi_cross_ref_id (INTEGER), master_customer_id (INTEGER), source_system_code (CHAR(15))\nCouncil_Tax: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBusiness_Rates: business_rates_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBenefits_Overpayments: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nParking_Fines: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nRent_Arrears: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nElectoral_Register: electoral_register_id (INTEGER), cmi_cross_ref_id (INTEGER)" }, { "query": "SELECT T1.source_system_code , T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id ORDER BY T2.council_tax_id", "question": "What is the tax source system code related to the benefits and overpayments? List the code and the benifit id, order by benifit id.", "schema": "Customer_Master_Index: master_customer_id (INTEGER), cmi_details (VARCHAR(255))\nCMI_Cross_References: cmi_cross_ref_id (INTEGER), master_customer_id (INTEGER), source_system_code (CHAR(15))\nCouncil_Tax: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBusiness_Rates: business_rates_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBenefits_Overpayments: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nParking_Fines: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nRent_Arrears: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nElectoral_Register: electoral_register_id (INTEGER), cmi_cross_ref_id (INTEGER)" }, { "query": "SELECT T1.source_system_code , T1.master_customer_id , T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Parking_Fines AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id", "question": "Wat is the tax source system code and master customer id of the taxes related to each parking fine id?", "schema": "Customer_Master_Index: master_customer_id (INTEGER), cmi_details (VARCHAR(255))\nCMI_Cross_References: cmi_cross_ref_id (INTEGER), master_customer_id (INTEGER), source_system_code (CHAR(15))\nCouncil_Tax: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBusiness_Rates: business_rates_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBenefits_Overpayments: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nParking_Fines: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nRent_Arrears: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nElectoral_Register: electoral_register_id (INTEGER), cmi_cross_ref_id (INTEGER)" }, { "query": "SELECT T1.council_tax_id FROM Rent_Arrears AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id JOIN Customer_Master_Index AS T3 ON T3.master_customer_id = T2.master_customer_id WHERE T3.cmi_details != 'Schmidt , Kertzmann and Lubowitz'", "question": "What are the renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'?", "schema": "Customer_Master_Index: master_customer_id (INTEGER), cmi_details (VARCHAR(255))\nCMI_Cross_References: cmi_cross_ref_id (INTEGER), master_customer_id (INTEGER), source_system_code (CHAR(15))\nCouncil_Tax: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBusiness_Rates: business_rates_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBenefits_Overpayments: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nParking_Fines: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nRent_Arrears: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nElectoral_Register: electoral_register_id (INTEGER), cmi_cross_ref_id (INTEGER)" }, { "query": "SELECT T1.electoral_register_id FROM Electoral_Register AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id WHERE T2.source_system_code = 'Electoral' OR T2.source_system_code = 'Tax'", "question": "What are the register ids of electoral registries that have the cross reference source system code 'Electoral' or 'Tax'?", "schema": "Customer_Master_Index: master_customer_id (INTEGER), cmi_details (VARCHAR(255))\nCMI_Cross_References: cmi_cross_ref_id (INTEGER), master_customer_id (INTEGER), source_system_code (CHAR(15))\nCouncil_Tax: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBusiness_Rates: business_rates_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBenefits_Overpayments: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nParking_Fines: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nRent_Arrears: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nElectoral_Register: electoral_register_id (INTEGER), cmi_cross_ref_id (INTEGER)" }, { "query": "SELECT count(DISTINCT source_system_code) FROM CMI_cross_references", "question": "How many different source system code for the cmi cross references are there?", "schema": "Customer_Master_Index: master_customer_id (INTEGER), cmi_details (VARCHAR(255))\nCMI_Cross_References: cmi_cross_ref_id (INTEGER), master_customer_id (INTEGER), source_system_code (CHAR(15))\nCouncil_Tax: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBusiness_Rates: business_rates_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBenefits_Overpayments: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nParking_Fines: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nRent_Arrears: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nElectoral_Register: electoral_register_id (INTEGER), cmi_cross_ref_id (INTEGER)" }, { "query": "SELECT * FROM customer_master_index ORDER BY cmi_details DESC", "question": "List all information about customer master index, and sort them by details in descending order.", "schema": "Customer_Master_Index: master_customer_id (INTEGER), cmi_details (VARCHAR(255))\nCMI_Cross_References: cmi_cross_ref_id (INTEGER), master_customer_id (INTEGER), source_system_code (CHAR(15))\nCouncil_Tax: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBusiness_Rates: business_rates_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBenefits_Overpayments: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nParking_Fines: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nRent_Arrears: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nElectoral_Register: electoral_register_id (INTEGER), cmi_cross_ref_id (INTEGER)" }, { "query": "SELECT council_tax_id , cmi_cross_ref_id FROM parking_fines", "question": "List the council tax ids and their related cmi cross references of all the parking fines.", "schema": "Customer_Master_Index: master_customer_id (INTEGER), cmi_details (VARCHAR(255))\nCMI_Cross_References: cmi_cross_ref_id (INTEGER), master_customer_id (INTEGER), source_system_code (CHAR(15))\nCouncil_Tax: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBusiness_Rates: business_rates_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBenefits_Overpayments: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nParking_Fines: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nRent_Arrears: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nElectoral_Register: electoral_register_id (INTEGER), cmi_cross_ref_id (INTEGER)" }, { "query": "SELECT count(*) FROM rent_arrears", "question": "How many council taxes are collected for renting arrears ?", "schema": "Customer_Master_Index: master_customer_id (INTEGER), cmi_details (VARCHAR(255))\nCMI_Cross_References: cmi_cross_ref_id (INTEGER), master_customer_id (INTEGER), source_system_code (CHAR(15))\nCouncil_Tax: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBusiness_Rates: business_rates_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBenefits_Overpayments: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nParking_Fines: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nRent_Arrears: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nElectoral_Register: electoral_register_id (INTEGER), cmi_cross_ref_id (INTEGER)" }, { "query": "SELECT DISTINCT T2.source_system_code FROM customer_master_index AS T1 JOIN cmi_cross_references AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T1.cmi_details = 'Gottlieb , Becker and Wyman'", "question": "What are the distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'?", "schema": "Customer_Master_Index: master_customer_id (INTEGER), cmi_details (VARCHAR(255))\nCMI_Cross_References: cmi_cross_ref_id (INTEGER), master_customer_id (INTEGER), source_system_code (CHAR(15))\nCouncil_Tax: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBusiness_Rates: business_rates_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBenefits_Overpayments: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nParking_Fines: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nRent_Arrears: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nElectoral_Register: electoral_register_id (INTEGER), cmi_cross_ref_id (INTEGER)" }, { "query": "SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines", "question": "Which cmi cross reference id is not related to any parking taxes?", "schema": "Customer_Master_Index: master_customer_id (INTEGER), cmi_details (VARCHAR(255))\nCMI_Cross_References: cmi_cross_ref_id (INTEGER), master_customer_id (INTEGER), source_system_code (CHAR(15))\nCouncil_Tax: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBusiness_Rates: business_rates_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBenefits_Overpayments: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nParking_Fines: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nRent_Arrears: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nElectoral_Register: electoral_register_id (INTEGER), cmi_cross_ref_id (INTEGER)" }, { "query": "SELECT DISTINCT source_system_code FROM cmi_cross_references WHERE source_system_code LIKE '%en%'", "question": "Which distinct source system code includes the substring 'en'?", "schema": "Customer_Master_Index: master_customer_id (INTEGER), cmi_details (VARCHAR(255))\nCMI_Cross_References: cmi_cross_ref_id (INTEGER), master_customer_id (INTEGER), source_system_code (CHAR(15))\nCouncil_Tax: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBusiness_Rates: business_rates_id (INTEGER), cmi_cross_ref_id (INTEGER)\nBenefits_Overpayments: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nParking_Fines: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nRent_Arrears: council_tax_id (INTEGER), cmi_cross_ref_id (INTEGER)\nElectoral_Register: electoral_register_id (INTEGER), cmi_cross_ref_id (INTEGER)" }, { "query": "SELECT count(*) FROM party", "question": "How many parties are there?", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT count(*) FROM party", "question": "Count the number of parties.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT Party_Theme FROM party ORDER BY Number_of_hosts ASC", "question": "List the themes of parties in ascending order of number of hosts.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT Party_Theme FROM party ORDER BY Number_of_hosts ASC", "question": "What are the themes of parties ordered by the number of hosts in ascending manner?", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT Party_Theme , LOCATION FROM party", "question": "What are the themes and locations of parties?", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT Party_Theme , LOCATION FROM party", "question": "Give me the theme and location of each party.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT First_year , Last_year FROM party WHERE Party_Theme = \"Spring\" OR Party_Theme = \"Teqnology\"", "question": "Show the first year and last year of parties with theme \"Spring\" or \"Teqnology\".", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT First_year , Last_year FROM party WHERE Party_Theme = \"Spring\" OR Party_Theme = \"Teqnology\"", "question": "What are the first year and last year of the parties whose theme is \"Spring\" or \"Teqnology\"?", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT avg(Number_of_hosts) FROM party", "question": "What is the average number of hosts for parties?", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT avg(Number_of_hosts) FROM party", "question": "Compute the average number of hosts for parties.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1", "question": "What is the location of the party with the most hosts?", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1", "question": "Which party had the most hosts? Give me the party location.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT Nationality , COUNT(*) FROM HOST GROUP BY Nationality", "question": "Show different nationalities along with the number of hosts of each nationality.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT Nationality , COUNT(*) FROM HOST GROUP BY Nationality", "question": "How many hosts does each nationality have? List the nationality and the count.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the most common nationality of hosts.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1", "question": "Which nationality has the most hosts?", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35", "question": "Show the nations that have both hosts older than 45 and hosts younger than 35.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35", "question": "Which nations have both hosts of age above 45 and hosts of age below 35?", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT T3.Party_Theme , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID", "question": "Show the themes of parties and the names of the party hosts.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT T3.Party_Theme , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID", "question": "For each party, return its theme and the name of its host.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT T3.Location , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID ORDER BY T2.Age", "question": "Show the locations of parties and the names of the party hosts in ascending order of the age of the host.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT T3.Location , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID ORDER BY T2.Age", "question": "For each party, find its location and the name of its host. Sort the result in ascending order of the age of the host.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT T3.Location FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T2.Age > 50", "question": "Show the locations of parties with hosts older than 50.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT T3.Location FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T2.Age > 50", "question": "Which parties have hosts of age above 50? Give me the party locations.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T3.Number_of_hosts > 20", "question": "Show the host names for parties with number of hosts greater than 20.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T3.Number_of_hosts > 20", "question": "Which parties have more than 20 hosts? Give me the host names for these parties.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT Name , Nationality FROM HOST ORDER BY Age DESC LIMIT 1", "question": "Show the name and the nationality of the oldest host.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT Name , Nationality FROM HOST ORDER BY Age DESC LIMIT 1", "question": "What are the name and the nationality of the host of the highest age?", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT Name FROM HOST WHERE Host_ID NOT IN (SELECT Host_ID FROM party_host)", "question": "List the names of hosts who did not serve as a host of any party in our record.", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT Name FROM HOST WHERE Host_ID NOT IN (SELECT Host_ID FROM party_host)", "question": "What are the names of hosts who did not host any party in our record?", "schema": "party: Party_ID (INT), Party_Theme (TEXT), Location (TEXT), First_year (TEXT), Last_year (TEXT), Number_of_hosts (INT)\nhost: Host_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT)\nparty_host: Party_ID (INT), Host_ID (INT), Is_Main_in_Charge (BOOL)" }, { "query": "SELECT count(*) FROM region", "question": "How many regions do we have?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT count(*) FROM region", "question": "Count the number of regions.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT region_code , region_name FROM region ORDER BY region_code", "question": "Show all region code and region name sorted by the codes.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT region_code , region_name FROM region ORDER BY region_code", "question": "What are the codes and names for all regions, sorted by codes?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT region_name FROM region ORDER BY region_name", "question": "List all region names in alphabetical order.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT region_name FROM region ORDER BY region_name", "question": "What are the names of the regions in alphabetical order?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT region_name FROM region WHERE region_name != 'Denmark'", "question": "Show names for all regions except for Denmark.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT region_name FROM region WHERE region_name != 'Denmark'", "question": "Return the names of all regions other than Denmark.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT count(*) FROM storm WHERE Number_Deaths > 0", "question": "How many storms had death records?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT count(*) FROM storm WHERE Number_Deaths > 0", "question": "Count the number of storms in which at least 1 person died.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT name , dates_active , number_deaths FROM storm WHERE number_deaths >= 1", "question": "List name, dates active, and number of deaths for all storms with at least 1 death.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT name , dates_active , number_deaths FROM storm WHERE number_deaths >= 1", "question": "What are the names, dates active, and number of deaths for storms that had 1 or more death?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT avg(damage_millions_USD) , max(damage_millions_USD) FROM storm WHERE max_speed > 1000", "question": "Show the average and maximum damage for all storms with max speed higher than 1000.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT avg(damage_millions_USD) , max(damage_millions_USD) FROM storm WHERE max_speed > 1000", "question": "What is the average and maximum damage in millions for storms that had a max speed over 1000?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT sum(number_deaths) , sum(damage_millions_USD) FROM storm WHERE max_speed > (SELECT avg(max_speed) FROM storm)", "question": "What is the total number of deaths and damage for all storms with a max speed greater than the average?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT sum(number_deaths) , sum(damage_millions_USD) FROM storm WHERE max_speed > (SELECT avg(max_speed) FROM storm)", "question": "Return the total number of deaths and total damange in millions for storms that had a max speed greater than the average.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT name , damage_millions_USD FROM storm ORDER BY max_speed DESC", "question": "List name and damage for all storms in a descending order of max speed.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT name , damage_millions_USD FROM storm ORDER BY max_speed DESC", "question": "What are the names and damage in millions for storms, ordered by their max speeds descending?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT count(DISTINCT region_id) FROM affected_region", "question": "How many regions are affected?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT count(DISTINCT region_id) FROM affected_region", "question": "Count the number of different affected regions.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT region_name FROM region WHERE region_id NOT IN (SELECT region_id FROM affected_region)", "question": "Show the name for regions not affected.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT region_name FROM region WHERE region_id NOT IN (SELECT region_id FROM affected_region)", "question": "What are the names of regions that were not affected?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T1.region_name , count(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id", "question": "Show the name for regions and the number of storms for each region.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T1.region_name , count(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id", "question": "How many storms occured in each region?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T1.name , count(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id", "question": "List the name for storms and the number of affected regions for each storm.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T1.name , count(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id", "question": "How many regions were affected by each storm?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T1.name , T1.max_speed FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the storm name and max speed which affected the greatest number of regions?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T1.name , T1.max_speed FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id ORDER BY count(*) DESC LIMIT 1", "question": "Return the name and max speed of the storm that affected the most regions.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT name FROM storm WHERE storm_id NOT IN (SELECT storm_id FROM affected_region)", "question": "Show the name of storms which don't have affected region in record.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT name FROM storm WHERE storm_id NOT IN (SELECT storm_id FROM affected_region)", "question": "What are the names of storms that did not affect any regions?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING count(*) >= 2 INTERSECT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING sum(T2.number_city_affected) >= 10", "question": "Show storm name with at least two regions and 10 cities affected.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING count(*) >= 2 INTERSECT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING sum(T2.number_city_affected) >= 10", "question": "What are the names of storms that both affected two or more regions and affected a total of 10 or more cities?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING count(*) >= 2", "question": "Show all storm names except for those with at least two affected regions.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING count(*) >= 2", "question": "What are the names of storms that did not affect two or more regions?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T3.number_deaths >= 10", "question": "What are the region names affected by the storm with a number of deaths of least 10?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T3.number_deaths >= 10", "question": "Return the names of the regions affected by storms that had a death count of at least 10.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.region_name = 'Denmark'", "question": "Show all storm names affecting region \"Denmark\".", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.region_name = 'Denmark'", "question": "What are the names of the storms that affected Denmark?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T1.region_name FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id HAVING count(*) >= 2", "question": "Show the region name with at least two storms.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T1.region_name FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id HAVING count(*) >= 2", "question": "What are the names of regions with two or more storms?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id ORDER BY T3.Number_Deaths DESC LIMIT 1", "question": "Find the names of the regions which were affected by the storm that killed the greatest number of people.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id ORDER BY T3.Number_Deaths DESC LIMIT 1", "question": "What are the names of regions that were affected by the storm in which the most people died?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Afghanistan' INTERSECT SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Albania'", "question": "Find the name of the storm that affected both Afghanistan and Albania regions.", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Afghanistan' INTERSECT SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Albania'", "question": "What are the names of the storms that affected both the regions of Afghanistan and Albania?", "schema": "storm: Storm_ID (INT), Name (TEXT), Dates_active (TEXT), Max_speed (INT), Damage_millions_USD (REAL), Number_Deaths (INT)\nregion: Region_id (INT), Region_code (TEXT), Region_name (TEXT)\naffected_region: Region_id (INT), Storm_ID (INT), Number_city_affected (REAL)" }, { "query": "SELECT count(*) FROM county", "question": "How many counties are there in total?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT count(*) FROM county", "question": "Count the total number of counties.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT County_name , Population FROM county", "question": "Show the county name and population of all counties.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT County_name , Population FROM county", "question": "What are the name and population of each county?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT avg(Population) FROM county", "question": "Show the average population of all counties.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT avg(Population) FROM county", "question": "On average how large is the population of the counties?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT max(Population) , min(Population) FROM county", "question": "Return the maximum and minimum population among all counties.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT max(Population) , min(Population) FROM county", "question": "What are the maximum and minimum population of the counties?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT DISTINCT District FROM election", "question": "Show all the distinct districts for elections.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT DISTINCT District FROM election", "question": "What are the distinct districts for elections?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Zip_code FROM county WHERE County_name = \"Howard\"", "question": "Show the zip code of the county with name \"Howard\".", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Zip_code FROM county WHERE County_name = \"Howard\"", "question": "What is the zip code the county named \"Howard\" is located in?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Delegate FROM election WHERE District = 1", "question": "Show the delegate from district 1 in election.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Delegate FROM election WHERE District = 1", "question": "Who is the delegate of district 1 in the elections?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Delegate , Committee FROM election", "question": "Show the delegate and committee information of elections.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Delegate , Committee FROM election", "question": "What are the delegate and committee information for each election record?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT count(DISTINCT Governor) FROM party", "question": "How many distinct governors are there?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT count(DISTINCT Governor) FROM party", "question": "Count the number of distinct governors.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Lieutenant_Governor , Comptroller FROM party WHERE Party = \"Democratic\"", "question": "Show the lieutenant governor and comptroller from the democratic party.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Lieutenant_Governor , Comptroller FROM party WHERE Party = \"Democratic\"", "question": "Who are the lieutenant governor and comptroller from the democratic party?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT DISTINCT YEAR FROM party WHERE Governor = \"Eliot Spitzer\"", "question": "In which distinct years was the governor \"Eliot Spitzer\"?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT DISTINCT YEAR FROM party WHERE Governor = \"Eliot Spitzer\"", "question": "Find the distinct years when the governor was named \"Eliot Spitzer\".", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT * FROM election", "question": "Show all the information about election.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT * FROM election", "question": "Return all the information for each election record.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T2.Delegate , T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District", "question": "Show the delegates and the names of county they belong to.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T2.Delegate , T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District", "question": "What are the delegate and name of the county they belong to, for each county?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000", "question": "Which delegates are from counties with population smaller than 100000?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000", "question": "Find the delegates who are from counties with population below 100000.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT count(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000", "question": "How many distinct delegates are from counties with population larger than 50000?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT count(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000", "question": "Count the number of distinct delegates who are from counties with population above 50000.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = \"Appropriations\"", "question": "What are the names of the county that the delegates on \"Appropriations\" committee belong to?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = \"Appropriations\"", "question": "Which county do the delegates on \"Appropriations\" committee belong to? Give me the county names.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T1.Delegate , T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID", "question": "Show the delegates and the names of the party they belong to.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T1.Delegate , T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID", "question": "For each delegate, find the names of the party they are part of.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1", "question": "Who were the governors of the parties associated with delegates from district 1?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1", "question": "Find the parties associated with the delegates from district 1. Who served as governors of the parties?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2", "question": "Who were the comptrollers of the parties associated with the delegates from district 1 or district 2?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2", "question": "Find the parties associated with the delegates from district 1 or 2. Who served as comptrollers of the parties?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = \"Democratic\"", "question": "Return all the committees that have delegates from Democratic party.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = \"Democratic\"", "question": "Which committees have delegates from the Democratic party?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T1.County_name , COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id", "question": "Show the name of each county along with the corresponding number of delegates from that county.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T1.County_name , COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id", "question": "For each county, find the name of the county and the number of delegates from that county.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T2.Party , COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party", "question": "Show the name of each party and the corresponding number of delegates from that party.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T2.Party , COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party", "question": "For each party, return the name of the party and the number of delegates from that party.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT County_name FROM county ORDER BY Population ASC", "question": "Return the names of all counties sorted by population in ascending order.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT County_name FROM county ORDER BY Population ASC", "question": "Sort the names of all counties in ascending order of population.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT County_name FROM county ORDER BY County_name DESC", "question": "Return the names of all counties sorted by county name in descending alphabetical order.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT County_name FROM county ORDER BY County_name DESC", "question": "Sort the names of all counties in descending alphabetical order.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT County_name FROM county ORDER BY Population DESC LIMIT 1", "question": "Show the name of the county with the biggest population.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT County_name FROM county ORDER BY Population DESC LIMIT 1", "question": "Which county has the largest population? Give me the name of the county.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT County_name FROM county ORDER BY Population ASC LIMIT 3", "question": "Show the 3 counties with the smallest population.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT County_name FROM county ORDER BY Population ASC LIMIT 3", "question": "What are the 3 counties that have the smallest population? Give me the county names.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id HAVING COUNT(*) >= 2", "question": "Show the names of counties that have at least two delegates.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id HAVING COUNT(*) >= 2", "question": "Which counties have two or more delegates? Give me the county names.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Party FROM party GROUP BY Party HAVING COUNT(*) >= 2", "question": "Show the name of the party that has at least two records.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Party FROM party GROUP BY Party HAVING COUNT(*) >= 2", "question": "Which party has two or more records?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the name of the party that has the most delegates.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIMIT 1", "question": "Which party has the largest number of delegates?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the people that have been governor the most times.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1", "question": "Which people severed as governor most frequently?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Comptroller , COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the people that have been comptroller the most times and the corresponding number of times.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Comptroller , COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1", "question": "Which people severed as comptroller most frequently? Give me the name of the person and the frequency count.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Party FROM party WHERE Party_ID NOT IN (SELECT Party FROM election)", "question": "What are the names of parties that do not have delegates in election?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT Party FROM party WHERE Party_ID NOT IN (SELECT Party FROM election)", "question": "Which parties did not have any delegates in elections?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = \"Appropriations\" INTERSECT SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = \"Economic Matters\"", "question": "What are the names of parties that have both delegates on \"Appropriations\" committee and", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = \"Appropriations\" INTERSECT SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = \"Economic Matters\"", "question": "Which parties have delegates in both the \"Appropriations\" committee and the \"Economic Matters\" committee?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = \"Democratic\" INTERSECT SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = \"Liberal\"", "question": "Which committees have delegates from both democratic party and liberal party?", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = \"Democratic\" INTERSECT SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = \"Liberal\"", "question": "Find the committees that have delegates both from from the democratic party and the liberal party.", "schema": "county: County_Id (INT), County_name (TEXT), Population (REAL), Zip_code (TEXT)\nparty: Party_ID (INT), Year (REAL), Party (TEXT), Governor (TEXT), Lieutenant_Governor (TEXT), Comptroller (TEXT), Attorney_General (TEXT), US_Senate (TEXT)\nelection: Election_ID (INT), Counties_Represented (TEXT), District (INT), Delegate (TEXT), Party (INT), First_Elected (REAL), Committee (TEXT)" }, { "query": "SELECT count(*) FROM journalist", "question": "How many journalists are there?", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Name FROM journalist ORDER BY Years_working ASC", "question": "List the names of journalists in ascending order of years working.", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Nationality , Age FROM journalist", "question": "What are the nationalities and ages of journalists?", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Name FROM journalist WHERE Nationality = \"England\" OR Nationality = \"Wales\"", "question": "Show the names of journalists from \"England\" or \"Wales\".", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT avg(Years_working) FROM journalist", "question": "What is the average number of years spent working as a journalist?", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Nationality FROM journalist ORDER BY Years_working DESC LIMIT 1", "question": "What is the nationality of the journalist with the largest number of years working?", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Nationality , COUNT(*) FROM journalist GROUP BY Nationality", "question": "Show the different nationalities and the number of journalists of each nationality.", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Nationality FROM journalist GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the most common nationality for journalists.", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Nationality FROM journalist WHERE Years_working > 10 INTERSECT SELECT Nationality FROM journalist WHERE Years_working < 3", "question": "Show the nations that have both journalists with more than 10 years of working and journalists with less than 3 years of working.", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Date , Name , venue FROM event ORDER BY Event_Attendance DESC", "question": "Show the dates, places, and names of events in descending order of the attendance.", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT T3.Name , T2.Date FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID", "question": "Show the names of journalists and the dates of the events they reported.", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT T3.Name , T2.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID ORDER BY T2.Event_Attendance ASC", "question": "Show the names of journalists and the names of the events they reported in ascending order", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT T3.Name , COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name", "question": "Show the names of journalists and the number of events they reported.", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT T3.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name HAVING COUNT(*) > 1", "question": "Show the names of journalists that have reported more than one event.", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT Name FROM journalist WHERE journalist_ID NOT IN (SELECT journalist_ID FROM news_report)", "question": "List the names of journalists who have not reported any event.", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT avg(Event_Attendance) , max(Event_Attendance) FROM event", "question": "what are the average and maximum attendances of all events?", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT avg(t1.age) , avg(Years_working) , t2.work_type FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id GROUP BY t2.work_type", "question": "Find the average age and experience working length of journalists working on different role type.", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT venue , name FROM event ORDER BY Event_Attendance DESC LIMIT 2", "question": "List the event venues and names that have the top 2 most number of people attended.", "schema": "event: Event_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT), Event_Attendance (INT)\njournalist: journalist_ID (INT), Name (TEXT), Nationality (TEXT), Age (TEXT), Years_working (INT)\nnews_report: journalist_ID (INT), Event_ID (INT), Work_Type (TEXT)" }, { "query": "SELECT ResName FROM Restaurant;", "question": "Show me all the restaurants.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT Address FROM Restaurant WHERE ResName = \"Subway\";", "question": "What is the address of the restaurant Subway?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT Rating FROM Restaurant WHERE ResName = \"Subway\";", "question": "What is the rating of the restaurant Subway?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT ResTypeName FROM Restaurant_Type;", "question": "List all restaurant types.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT ResTypeDescription FROM Restaurant_Type WHERE ResTypeName = \"Sandwich\";", "question": "What is the description of the restaurant type Sandwich?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT ResName , Rating FROM Restaurant ORDER BY Rating DESC LIMIT 1;", "question": "Which restaurants have highest rating? List the restaurant name and its rating.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT Age FROM Student WHERE Fname = \"Linda\" AND Lname = \"Smith\";", "question": "What is the age of student Linda Smith?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT Sex FROM Student WHERE Fname = \"Linda\" AND Lname = \"Smith\";", "question": "What is the gender of the student Linda Smith?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT Fname , Lname FROM Student WHERE Major = 600;", "question": "List all students' first names and last names who majored in 600.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT city_code FROM Student WHERE Fname = \"Linda\" AND Lname = \"Smith\";", "question": "Which city does student Linda Smith live in?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT count(*) FROM Student WHERE Advisor = 1121;", "question": "Advisor 1121 has how many students?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT Advisor , count(*) FROM Student GROUP BY Advisor ORDER BY count(Advisor) DESC LIMIT 1;", "question": "Which Advisor has most of students? List advisor and the number of students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT Major , count(*) FROM Student GROUP BY Major ORDER BY count(Major) ASC LIMIT 1;", "question": "Which major has least number of students? List the major and the number of students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT Major , count(*) FROM Student GROUP BY Major HAVING count(Major) BETWEEN 2 AND 30;", "question": "Which major has between 2 and 30 number of students? List major and the number of students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT Fname , Lname FROM Student WHERE Age > 18 AND Major = 600;", "question": "Which student's age is older than 18 and is majoring in 600? List each student's first and last name.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT Fname , Lname FROM Student WHERE Age > 18 AND Major != 600 AND Sex = 'F';", "question": "List all female students age is older than 18 who is not majoring in 600. List students' first name and last name.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT count(*) FROM Restaurant JOIN Type_Of_Restaurant ON Restaurant.ResID = Type_Of_Restaurant.ResID JOIN Restaurant_Type ON Type_Of_Restaurant.ResTypeID = Restaurant_Type.ResTypeID GROUP BY Type_Of_Restaurant.ResTypeID HAVING Restaurant_Type.ResTypeName = 'Sandwich'", "question": "How many restaurant is the Sandwich type restaurant?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT sum(Spent) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = \"Linda\" AND Student.Lname = \"Smith\";", "question": "How long does student Linda Smith spend on the restaurant in total?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT count(*) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = \"Linda\" AND Student.Lname = \"Smith\" AND Restaurant.ResName = \"Subway\";", "question": "How many times has the student Linda Smith visited Subway?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT TIME FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = \"Linda\" AND Student.Lname = \"Smith\" AND Restaurant.ResName = \"Subway\";", "question": "When did Linda Smith visit Subway?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT Restaurant.ResName , sum(Visits_Restaurant.Spent) FROM Visits_Restaurant JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID GROUP BY Restaurant.ResID ORDER BY sum(Visits_Restaurant.Spent) ASC LIMIT 1;", "question": "At which restaurant did the students spend the least amount of time? List restaurant and the time students spent on in total.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT Student.Fname , Student.Lname FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID GROUP BY Student.StuID ORDER BY count(*) DESC LIMIT 1;", "question": "Which student visited restaurant most often? List student's first name and last name.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nRestaurant: ResID (INTEGER), ResName (VARCHAR(100)), Address (VARCHAR(100)), Rating (INTEGER)\nType_Of_Restaurant: ResID (INTEGER), ResTypeID (INTEGER)\nRestaurant_Type: ResTypeID (INTEGER), ResTypeName (VARCHAR(40)), ResTypeDescription (VARCHAR(100))\nVisits_Restaurant: StuID (INTEGER), ResID (INTEGER), Time (TIMESTAMP), Spent (FLOAT)" }, { "query": "SELECT actual_order_id FROM actual_orders WHERE order_status_code = 'Success'", "question": "Find the ids of orders whose status is 'Success'.", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT t1.product_name , t1.product_price FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id = t2.product_id GROUP BY t2.product_id ORDER BY count(*) DESC LIMIT 1", "question": "Find the name and price of the product that has been ordered the greatest number of times.", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT count(*) FROM customers", "question": "Find the number of customers in total.", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT count(DISTINCT payment_method) FROM customers", "question": "How many different payment methods are there?", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT truck_details FROM trucks ORDER BY truck_licence_number", "question": "Show the details of all trucks in the order of their license number.", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT product_name FROM products ORDER BY product_price DESC LIMIT 1", "question": "Find the name of the most expensive product.", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'", "question": "Find the names of customers who are not living in the state of California.", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT customer_email , customer_name FROM customers WHERE payment_method = 'Visa'", "question": "List the names and emails of customers who payed by Visa card.", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT t1.customer_name , t1.customer_phone FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'", "question": "Find the names and phone numbers of customers living in California state.", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT state_province_county FROM addresses WHERE address_id NOT IN (SELECT employee_address_id FROM Employees)", "question": "Find the states which do not have any employee in their record.", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT customer_name , customer_phone , customer_email FROM Customers ORDER BY date_became_customer", "question": "List the names, phone numbers, and emails of all customers sorted by their dates of becoming customers.", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT customer_name FROM Customers ORDER BY date_became_customer LIMIT 5", "question": "Find the name of the first 5 customers.", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT payment_method FROM Customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1", "question": "Find the payment method that is used most frequently.", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT route_name FROM Delivery_Routes ORDER BY route_name", "question": "List the names of all routes in alphabetic order.", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT t1.route_name FROM Delivery_Routes AS t1 JOIN Delivery_Route_Locations AS t2 ON t1.route_id = t2.route_id GROUP BY t1.route_id ORDER BY count(*) DESC LIMIT 1", "question": "Find the name of route that has the highest number of deliveries.", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT t2.state_province_county , count(*) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county", "question": "List the state names and the number of customers living in each state.", "schema": "Products: product_id (INTEGER), product_name (VARCHAR(20)), product_price (DECIMAL(194)), product_description (VARCHAR(255))\nAddresses: address_id (INTEGER), address_details (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(10)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), date_became_customer (DATETIME)\nRegular_Orders: regular_order_id (INTEGER), distributer_id (INTEGER)\nRegular_Order_Products: regular_order_id (INTEGER), product_id (INTEGER)\nActual_Orders: actual_order_id (INTEGER), order_status_code (VARCHAR(10)), regular_order_id (INTEGER), actual_order_date (DATETIME)\nActual_Order_Products: actual_order_id (INTEGER), product_id (INTEGER)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), address_type (VARCHAR(10)), date_to (DATETIME)\nDelivery_Routes: route_id (INTEGER), route_name (VARCHAR(50)), other_route_details (VARCHAR(255))\nDelivery_Route_Locations: location_code (VARCHAR(10)), route_id (INTEGER), location_address_id (INTEGER), location_name (VARCHAR(50))\nTrucks: truck_id (INTEGER), truck_licence_number (VARCHAR(20)), truck_details (VARCHAR(255))\nEmployees: employee_id (INTEGER), employee_address_id (INTEGER), employee_name (VARCHAR(80)), employee_phone (VARCHAR(80))\nOrder_Deliveries: location_code (VARCHAR(10)), actual_order_id (INTEGER), delivery_status_code (VARCHAR(10)), driver_employee_id (INTEGER), truck_id (INTEGER), delivery_date (DATETIME)" }, { "query": "SELECT count(DISTINCT last_name) FROM actor", "question": "How many different last names do the actors and actresses have?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(DISTINCT last_name) FROM actor", "question": "Count the number of different last names actors have.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT first_name FROM actor GROUP BY first_name ORDER BY count(*) DESC LIMIT 1", "question": "What is the most popular first name of the actors?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT first_name FROM actor GROUP BY first_name ORDER BY count(*) DESC LIMIT 1", "question": "Return the most common first name among all actors.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT first_name , last_name FROM actor GROUP BY first_name , last_name ORDER BY count(*) DESC LIMIT 1", "question": "What is the most popular full name of the actors?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT first_name , last_name FROM actor GROUP BY first_name , last_name ORDER BY count(*) DESC LIMIT 1", "question": "Return the most common full name among all actors.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT district FROM address GROUP BY district HAVING count(*) >= 2", "question": "Which districts have at least two addresses?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT district FROM address GROUP BY district HAVING count(*) >= 2", "question": "Give the districts which have two or more addresses.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT phone , postal_code FROM address WHERE address = '1031 Daugavpils Parkway'", "question": "What is the phone number and postal code of the address 1031 Daugavpils Parkway?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT phone , postal_code FROM address WHERE address = '1031 Daugavpils Parkway'", "question": "Give the phone and postal code corresponding to the address '1031 Daugavpils Parkway'.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.city , count(*) , T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY T1.city_id ORDER BY count(*) DESC LIMIT 1", "question": "Which city has the most addresses? List the city name, number of addresses, and city id.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.city , count(*) , T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY T1.city_id ORDER BY count(*) DESC LIMIT 1", "question": "What are the city name, id, and number of addresses corresponding to the city with the most addressed?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(*) FROM address WHERE district = 'California'", "question": "How many addresses are in the district of California?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(*) FROM address WHERE district = 'California'", "question": "Count the number of addressed in the California district.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT title , film_id FROM film WHERE rental_rate = 0.99 INTERSECT SELECT T1.title , T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id HAVING count(*) < 3", "question": "Which film is rented at a fee of 0.99 and has less than 3 in the inventory? List the film title and id.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT title , film_id FROM film WHERE rental_rate = 0.99 INTERSECT SELECT T1.title , T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id HAVING count(*) < 3", "question": "What are the title and id of the film which has a rental rate of 0.99 and an inventory of below 3?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(*) FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id WHERE T2.country = 'Australia'", "question": "How many cities are in Australia?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(*) FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id WHERE T2.country = 'Australia'", "question": "Count the number of cities in Australia.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id HAVING count(*) >= 3", "question": "Which countries have at least 3 cities?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id HAVING count(*) >= 3", "question": "What are the countries that contain 3 or more cities?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT payment_date FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa'", "question": "Find all the payment dates for the payments with an amount larger than 10 and the payments handled by a staff person with the first name Elsa.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT payment_date FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa'", "question": "What are the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(*) FROM customer WHERE active = '1'", "question": "How many customers have an active value of 1?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(*) FROM customer WHERE active = '1'", "question": "Count the number of customers who are active.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT title , rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1", "question": "Which film has the highest rental rate? And what is the rate?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT title , rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1", "question": "What are the title and rental rate of the film with the highest rental rate?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.title , T2.film_id , T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY count(*) DESC LIMIT 1", "question": "Which film has the most number of actors or actresses? List the film name, film id and description.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.title , T2.film_id , T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY count(*) DESC LIMIT 1", "question": "What are the title, id, and description of the movie with the greatest number of actors?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.first_name , T2.last_name , T2.actor_id FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY count(*) DESC LIMIT 1", "question": "Which film actor (actress) starred the most films? List his or her first name, last name and actor id.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.first_name , T2.last_name , T2.actor_id FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY count(*) DESC LIMIT 1", "question": "Return the full name and id of the actor or actress who starred in the greatest number of films.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.first_name , T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id HAVING count(*) > 30", "question": "Which film actors (actresses) played a role in more than 30 films? List his or her first name and last name.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.first_name , T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id HAVING count(*) > 30", "question": "What are the full names of actors who had roles in more than 30 films?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT store_id FROM inventory GROUP BY store_id ORDER BY count(*) DESC LIMIT 1", "question": "Which store owns most items?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT store_id FROM inventory GROUP BY store_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the id of the store that has the most items in inventory?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT sum(amount) FROM payment", "question": "What is the total amount of all payments?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT sum(amount) FROM payment", "question": "Return the sum of all payment amounts.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T1.first_name , T1.last_name , T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY sum(amount) ASC LIMIT 1", "question": "Which customer, who has made at least one payment, has spent the least money? List his or her first name, last name, and the id.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T1.first_name , T1.last_name , T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY sum(amount) ASC LIMIT 1", "question": "What is the full name and id of the customer who has the lowest total amount of payment?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF'", "question": "What is the genre name of the film HUNGER ROOF?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF'", "question": "Return the name of the category to which the film 'HUNGER ROOF' belongs.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.name , T1.category_id , count(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id", "question": "How many films are there in each category? List the genre name, genre id and the count.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.name , T1.category_id , count(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id", "question": "What are the names and ids of the different categories, and how many films are in each?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T1.title , T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id ORDER BY count(*) DESC LIMIT 1", "question": "Which film has the most copies in the inventory? List both title and id.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T1.title , T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the title and id of the film that has the greatest number of copies in inventory?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T1.title , T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T2.inventory_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the film title and inventory id of the item in the inventory which was rented most frequently?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T1.title , T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T2.inventory_id ORDER BY count(*) DESC LIMIT 1", "question": "Return the title and inventory id of the film that is rented most often.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(DISTINCT language_id) FROM film", "question": "How many languages are in these films?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(DISTINCT language_id) FROM film", "question": "Count the number of different languages in these films.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT title FROM film WHERE rating = 'R'", "question": "What are all the movies rated as R? List the titles.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT title FROM film WHERE rating = 'R'", "question": "Return the titles of any movies with an R rating.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE store_id = 1", "question": "Where is store 1 located?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE store_id = 1", "question": "Return the address of store 1.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T1.first_name , T1.last_name , T1.staff_id FROM staff AS T1 JOIN payment AS T2 ON T1.staff_id = T2.staff_id GROUP BY T1.staff_id ORDER BY count(*) ASC LIMIT 1", "question": "Which staff handled least number of payments? List the full name and the id.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T1.first_name , T1.last_name , T1.staff_id FROM staff AS T1 JOIN payment AS T2 ON T1.staff_id = T2.staff_id GROUP BY T1.staff_id ORDER BY count(*) ASC LIMIT 1", "question": "Give the full name and staff id of the staff who has handled the fewest payments.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK'", "question": "Which language does the film AIRPORT POLLOCK use? List the language name.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK'", "question": "What is the name of the language that the film 'AIRPORT POLLOCK' is in?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(*) FROM store", "question": "How many stores are there?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(*) FROM store", "question": "Count the number of stores.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(DISTINCT rating) FROM film", "question": "How many kinds of different ratings are listed?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(DISTINCT rating) FROM film", "question": "Count the number of different film ratings.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT title FROM film WHERE special_features LIKE '%Deleted Scenes%'", "question": "Which movies have 'Deleted Scenes' as a substring in the special feature?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT title FROM film WHERE special_features LIKE '%Deleted Scenes%'", "question": "Return the titles of films that include 'Deleted Scenes' in their special feature section.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(*) FROM inventory WHERE store_id = 1", "question": "How many items in inventory does store 1 have?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(*) FROM inventory WHERE store_id = 1", "question": "Count the number of items store 1 has in stock.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT payment_date FROM payment ORDER BY payment_date ASC LIMIT 1", "question": "When did the first payment happen?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT payment_date FROM payment ORDER BY payment_date ASC LIMIT 1", "question": "What was the date of the earliest payment?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.address , T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id = T1.address_id WHERE T1.first_name = 'LINDA'", "question": "Where does the customer with the first name Linda live? And what is her email?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.address , T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id = T1.address_id WHERE T1.first_name = 'LINDA'", "question": "Return the address and email of the customer with the first name Linda.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT title FROM film WHERE LENGTH > 100 OR rating = 'PG' EXCEPT SELECT title FROM film WHERE replacement_cost > 200", "question": "Find all the films longer than 100 minutes, or rated PG, except those who cost more than 200 for replacement. List the titles.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT title FROM film WHERE LENGTH > 100 OR rating = 'PG' EXCEPT SELECT title FROM film WHERE replacement_cost > 200", "question": "What are the titles of films that are either longer than 100 minutes or rated PG other than those that cost more than 200 to replace?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T1.first_name , T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.rental_date ASC LIMIT 1", "question": "What is the first name and the last name of the customer who made the earliest rental?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T1.first_name , T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.rental_date ASC LIMIT 1", "question": "Return the full name of the customer who made the first rental.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT DISTINCT T1.first_name , T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id = T2.staff_id JOIN customer AS T3 ON T2.customer_id = T3.customer_id WHERE T3.first_name = 'APRIL' AND T3.last_name = 'BURNS'", "question": "What is the full name of the staff member who has rented a film to a customer with the first name April and the last name Burns?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT DISTINCT T1.first_name , T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id = T2.staff_id JOIN customer AS T3 ON T2.customer_id = T3.customer_id WHERE T3.first_name = 'APRIL' AND T3.last_name = 'BURNS'", "question": "Return the full name of the staff who provided a customer with the first name April and the last name Burns with a film rental.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT store_id FROM customer GROUP BY store_id ORDER BY count(*) DESC LIMIT 1", "question": "Which store has most the customers?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT store_id FROM customer GROUP BY store_id ORDER BY count(*) DESC LIMIT 1", "question": "Return the id of the store with the most customers.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT amount FROM payment ORDER BY amount DESC LIMIT 1", "question": "What is the largest payment amount?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT amount FROM payment ORDER BY amount DESC LIMIT 1", "question": "Return the amount of the largest payment.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name = 'Elsa'", "question": "Where does the staff member with the first name Elsa live?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name = 'Elsa'", "question": "Give the address of the staff member who has the first name Elsa.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT first_name FROM customer WHERE customer_id NOT IN( SELECT customer_id FROM rental WHERE rental_date > '2005-08-23 02:06:01' )", "question": "What are the first names of customers who have not rented any films after '2005-08-23 02:06:01'?", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT first_name FROM customer WHERE customer_id NOT IN( SELECT customer_id FROM rental WHERE rental_date > '2005-08-23 02:06:01' )", "question": "Return the first names of customers who did not rented a film after the date '2005-08-23 02:06:01'.", "schema": "actor: actor_id (SMALLINT), first_name (VARCHAR(45)), last_name (VARCHAR(45))\naddress: address_id (SMALLINT), address (VARCHAR(50)), address2 (VARCHAR(50)), district (VARCHAR(20)), city_id (SMALLINT), postal_code (VARCHAR(10)), phone (VARCHAR(20))\ncategory: category_id (TINYINT), name (VARCHAR(25))\ncity: city_id (SMALLINT), city (VARCHAR(50)), country_id (SMALLINT)\ncountry: country_id (SMALLINT), country (VARCHAR(50))\ncustomer: customer_id (SMALLINT), store_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), email (VARCHAR(50)), address_id (SMALLINT), create_date (DATETIME), last_update (TIMESTAMP)\nfilm: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT), release_year (YEAR), language_id (TINYINT), original_language_id (TINYINT), length (SMALLINT), rating (DEFAULT), special_features (DEFAULT)\nfilm_actor: actor_id (SMALLINT), film_id (SMALLINT)\nfilm_category: film_id (SMALLINT), category_id (TINYINT)\nfilm_text: film_id (SMALLINT), title (VARCHAR(255)), description (TEXT)\ninventory: inventory_id (MEDIUMINT), film_id (SMALLINT), store_id (TINYINT)\nlanguage: language_id (TINYINT), name (CHAR(20))\npayment: payment_id (SMALLINT), customer_id (SMALLINT), staff_id (TINYINT), rental_id (INT), amount (DECIMAL(52)), payment_date (DATETIME), last_update (TIMESTAMP)\nrental: rental_id (INT), rental_date (DATETIME), inventory_id (MEDIUMINT), customer_id (SMALLINT), return_date (DATETIME), staff_id (TINYINT)\nstaff: staff_id (TINYINT), first_name (VARCHAR(45)), last_name (VARCHAR(45)), address_id (SMALLINT), picture (BLOB), email (VARCHAR(50)), store_id (TINYINT), username (VARCHAR(16)), password (VARCHAR(40))\nstore: store_id (TINYINT), manager_staff_id (TINYINT), address_id (SMALLINT)" }, { "query": "SELECT count(*) FROM bank", "question": "How many bank branches are there?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT count(*) FROM bank", "question": "Count the number of bank branches.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT sum(no_of_customers) FROM bank", "question": "How many customers are there?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT sum(no_of_customers) FROM bank", "question": "What is the total number of customers across banks?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT sum(no_of_customers) FROM bank WHERE city = 'New York City'", "question": "Find the number of customers in the banks at New York City.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT sum(no_of_customers) FROM bank WHERE city = 'New York City'", "question": "What is the total number of customers who use banks in New York City?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT avg(no_of_customers) FROM bank WHERE state = 'Utah'", "question": "Find the average number of customers in all banks of Utah state.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT avg(no_of_customers) FROM bank WHERE state = 'Utah'", "question": "What is the average number of customers across banks in the state of Utah?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT avg(no_of_customers) FROM bank", "question": "Find the average number of customers cross all banks.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT avg(no_of_customers) FROM bank", "question": "What is the average number of bank customers?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT city , state FROM bank WHERE bname = 'morningside'", "question": "Find the city and state of the bank branch named morningside.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT city , state FROM bank WHERE bname = 'morningside'", "question": "What city and state is the bank with the name morningside in?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT bname FROM bank WHERE state = 'New York'", "question": "Find the branch names of banks in the New York state.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT bname FROM bank WHERE state = 'New York'", "question": "What are the names of banks in the state of New York?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name FROM customer ORDER BY acc_bal", "question": "List the name of all customers sorted by their account balance in ascending order.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name FROM customer ORDER BY acc_bal", "question": "What are the names of all customers, ordered by account balance?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount)", "question": "List the name of all different customers who have some loan sorted by their total loan amount.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount)", "question": "What are the names of the different customers who have taken out a loan, ordered by the total amount that they have taken?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT state , acc_type , credit_score FROM customer WHERE no_of_loans = 0", "question": "Find the state, account type, and credit score of the customer whose number of loan is 0.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT state , acc_type , credit_score FROM customer WHERE no_of_loans = 0", "question": "What are the states, account types, and credit scores for customers who have 0 loans?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT count(DISTINCT city) FROM bank", "question": "Find the number of different cities which banks are located at.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT count(DISTINCT city) FROM bank", "question": "In how many different cities are banks located?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT count(DISTINCT state) FROM bank", "question": "Find the number of different states which banks are located at.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT count(DISTINCT state) FROM bank", "question": "In how many different states are banks located?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT count(DISTINCT acc_type) FROM customer", "question": "How many distinct types of accounts are there?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT count(DISTINCT acc_type) FROM customer", "question": "Count the number of different account types.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name , acc_bal FROM customer WHERE cust_name LIKE '%a%'", "question": "Find the name and account balance of the customer whose name includes the letter \u2018a\u2019.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name , acc_bal FROM customer WHERE cust_name LIKE '%a%'", "question": "What are the names and account balances of customers with the letter a in their names?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT sum(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas'", "question": "Find the total account balance of each customer from Utah or Texas.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT sum(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas'", "question": "What are the total account balances for each customer from Utah or Texas?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking'", "question": "Find the name of customers who have both saving and checking account types.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking'", "question": "What are the names of customers who have both savings and checking accounts?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving'", "question": "Find the name of customers who do not have an saving account.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving'", "question": "What are the names of customers who do not have saving accounts?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages'", "question": "Find the name of customers who do not have a loan with a type of Mortgages.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages'", "question": "What are the names of customers who have not taken a Mortage loan?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Auto'", "question": "Find the name of customers who have loans of both Mortgages and Auto.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Auto'", "question": "What are the names of customers who have taken both Mortgage and Auto loans?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name FROM customer WHERE credit_score < (SELECT avg(credit_score) FROM customer)", "question": "Find the name of customers whose credit score is below the average credit scores of all customers.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name FROM customer WHERE credit_score < (SELECT avg(credit_score) FROM customer)", "question": "What are the names of customers with credit score less than the average credit score across customers?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1", "question": "Find the branch name of the bank that has the most number of customers.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1", "question": "What is the name of the bank branch with the greatest number of customers?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1", "question": "Find the name of customer who has the lowest credit score.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1", "question": "What is the name of the customer with the worst credit score?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name , acc_type , acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1", "question": "Find the name, account type, and account balance of the customer who has the highest credit score.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT cust_name , acc_type , acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1", "question": "What is the name, account type, and account balance corresponding to the customer with the highest credit score?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount) DESC LIMIT 1", "question": "Find the name of customer who has the highest amount of loans.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount) DESC LIMIT 1", "question": "What is the name of the customer who has greatest total loan amount?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) DESC LIMIT 1", "question": "Find the state which has the most number of customers.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) DESC LIMIT 1", "question": "Which state has the greatest total number of bank customers?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT avg(acc_bal) , acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type", "question": "For each account type, find the average account balance of customers with credit score lower than 50.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT avg(acc_bal) , acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type", "question": "What is the average account balance of customers with credit score below 50 for the different account types?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT sum(acc_bal) , state FROM customer WHERE credit_score > 100 GROUP BY state", "question": "For each state, find the total account balance of customers whose credit score is above 100.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT sum(acc_bal) , state FROM customer WHERE credit_score > 100 GROUP BY state", "question": "What is the total account balance for customers with a credit score of above 100 for the different states?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT sum(amount) , T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname", "question": "Find the total amount of loans offered by each bank branch.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT sum(amount) , T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname", "question": "What are the names of the different bank branches, and what are their total loan amounts?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING count(*) > 1", "question": "Find the name of customers who have more than one loan.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING count(*) > 1", "question": "What are the names of customers who have taken out more than one loan?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.cust_name , T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING sum(T2.amount) > 5000", "question": "Find the name and account balance of the customers who have loans with a total amount of more than 5000.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.cust_name , T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING sum(T2.amount) > 5000", "question": "What are the names and account balances for customers who have taken a total amount of more than 5000 in loans?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname ORDER BY sum(T2.amount) DESC LIMIT 1", "question": "Find the name of bank branch that provided the greatest total amount of loans.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname ORDER BY sum(T2.amount) DESC LIMIT 1", "question": "What is the name of the bank branch that has lent the greatest amount?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 GROUP BY T2.bname ORDER BY sum(T1.amount) DESC LIMIT 1", "question": "Find the name of bank branch that provided the greatest total amount of loans to customers with credit score is less than 100.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 GROUP BY T2.bname ORDER BY sum(T1.amount) DESC LIMIT 1", "question": "What is the name of the bank branch that has lended the largest total amount in loans, specifically to customers with credit scores below 100?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id", "question": "Find the name of bank branches that provided some loans.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id", "question": "What are the names of the different banks that have provided loans?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT DISTINCT T1.cust_name , T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id", "question": "Find the name and credit score of the customers who have some loans.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT DISTINCT T1.cust_name , T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id", "question": "What are the different names and credit scores of customers who have taken a loan?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE amount > 3000", "question": "Find the the name of the customers who have a loan with amount more than 3000.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE amount > 3000", "question": "What are the names of customers who have a loan of more than 3000 in amount?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.bname , T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T2.loan_type = 'Business'", "question": "Find the city and name of bank branches that provide business loans.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T1.bname , T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T2.loan_type = 'Business'", "question": "What are the names and cities of bank branches that offer loans for business?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100", "question": "Find the names of bank branches that have provided a loan to any customer whose credit score is below 100.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100", "question": "What are the names of banks that have loaned money to customers with credit scores below 100?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT sum(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York'", "question": "Find the total amount of loans provided by bank branches in the state of New York.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT sum(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York'", "question": "What is the total amount of money loaned by banks in New York state?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan)", "question": "Find the average credit score of the customers who have some loan.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan)", "question": "What is the average credit score for customers who have taken a loan?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT avg(credit_score) FROM customer WHERE cust_id NOT IN (SELECT cust_id FROM loan)", "question": "Find the average credit score of the customers who do not have any loan.", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT avg(credit_score) FROM customer WHERE cust_id NOT IN (SELECT cust_id FROM loan)", "question": "What is the average credit score for customers who have never taken a loan?", "schema": "bank: branch_ID (INT), bname (VARCHAR(20)), no_of_customers (INT), city (VARCHAR(10)), state (VARCHAR(20))\ncustomer: cust_ID (VARCHAR(3)), cust_name (VARCHAR(20)), acc_type (CHAR(1)), acc_bal (INT), no_of_loans (INT), credit_score (INT), branch_ID (INT), state (VARCHAR(20))\nloan: loan_ID (VARCHAR(3)), loan_type (VARCHAR(15)), cust_ID (VARCHAR(3)), branch_ID (VARCHAR(3)), amount (INT)" }, { "query": "SELECT count(*) FROM ASSESSMENT_NOTES", "question": "How many assessment notes are there in total?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT date_of_notes FROM Assessment_Notes", "question": "What are the dates of the assessment notes?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT count(*) FROM ADDRESSES WHERE zip_postcode = \"197\"", "question": "How many addresses have zip code 197?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT count(DISTINCT incident_type_code) FROM Behavior_Incident", "question": "How many distinct incident type codes are there?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT DISTINCT detention_type_code FROM Detention", "question": "Return all distinct detention type codes.", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT date_incident_start , date_incident_end FROM Behavior_Incident WHERE incident_type_code = \"NOISE\"", "question": "What are the start and end dates for incidents with incident type code \"NOISE\"?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT detention_summary FROM Detention", "question": "Return all detention summaries.", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT cell_mobile_number , email_address FROM STUDENTS", "question": "Return the cell phone number and email address for all students.", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT email_address FROM Students WHERE first_name = \"Emma\" AND last_name = \"Rohan\"", "question": "What is the email of the student with first name \"Emma\" and last name \"Rohan\"?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT count(DISTINCT student_id) FROM Students_in_Detention", "question": "How many distinct students have been in detention?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT gender FROM TEACHERS WHERE last_name = \"Medhurst\"", "question": "What is the gender of the teacher with last name \"Medhurst\"?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT incident_type_description FROM Ref_Incident_Type WHERE incident_type_code = \"VIOLENCE\"", "question": "What is the incident type description for the incident type with code \"VIOLENCE\"?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT max(monthly_rental) , min(monthly_rental) FROM Student_Addresses", "question": "Find the maximum and minimum monthly rental for all student addresses.", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT first_name FROM Teachers WHERE email_address LIKE '%man%'", "question": "Find the first names of teachers whose email address contains the word \"man\".", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT * FROM Assessment_Notes ORDER BY date_of_notes ASC", "question": "List all information about the assessment notes sorted by date in ascending order.", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT city FROM Addresses ORDER BY city", "question": "List all cities of addresses in alphabetical order.", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT first_name , last_name FROM Teachers ORDER BY last_name", "question": "Find the first names and last names of teachers in alphabetical order of last name.", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT * FROM Student_Addresses ORDER BY monthly_rental DESC", "question": "Find all information about student addresses, and sort by monthly rental in descending order.", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T1.student_id , T2.first_name FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1", "question": "Find the id and first name of the student that has the most number of assessment notes?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T1.teacher_id , T2.first_name FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 3", "question": "Find the ids and first names of the 3 teachers that have the most number of assessment notes?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T1.student_id , T2.last_name FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1", "question": "Find the id and last name of the student that has the most behavior incidents?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T1.teacher_id , T2.last_name FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T1.detention_type_code = \"AFTER\" GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 1", "question": "Find the id and last name of the teacher that has the most detentions with detention type code \"AFTER\"?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T1.student_id , T2.first_name FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY AVG(monthly_rental) DESC LIMIT 1", "question": "What are the id and first name of the student whose addresses have the highest average monthly rental?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T2.address_id , T1.city FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id ORDER BY AVG(monthly_rental) DESC LIMIT 1", "question": "Find the id and city of the student address with the highest average monthly rental.", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T1.incident_type_code , T2.incident_type_description FROM Behavior_Incident AS T1 JOIN Ref_Incident_Type AS T2 ON T1.incident_type_code = T2.incident_type_code GROUP BY T1.incident_type_code ORDER BY count(*) DESC LIMIT 1", "question": "What are the code and description of the most frequent behavior incident type?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T1.detention_type_code , T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type AS T2 ON T1.detention_type_code = T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY count(*) ASC LIMIT 1", "question": "What are the code and description of the least frequent detention type ?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T1.date_of_notes FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = \"Fanny\"", "question": "Find the dates of assessment notes for students with first name \"Fanny\".", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T1.text_of_notes FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = \"Schuster\"", "question": "Find the texts of assessment notes for teachers with last name \"Schuster\".", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T1.date_incident_start , date_incident_end FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.last_name = \"Fahey\"", "question": "Find the start and end dates of behavior incidents of students with last name \"Fahey\".", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T1.datetime_detention_start , datetime_detention_end FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = \"Schultz\"", "question": "Find the start and end dates of detentions of teachers with last name \"Schultz\".", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T2.address_id , T1.zip_postcode FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id ORDER BY monthly_rental DESC LIMIT 1", "question": "What are the id and zip code of the address with the highest monthly rental?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T2.cell_mobile_number FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.monthly_rental ASC LIMIT 1", "question": "What is the cell phone number of the student whose address has the lowest monthly rental?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T2.monthly_rental FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = \"Texas\"", "question": "What are the monthly rentals of student addresses in Texas state?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = \"Wisconsin\"", "question": "What are the first names and last names of students with address in Wisconsin state?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T1.line_1 , avg(T2.monthly_rental) FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id", "question": "What are the line 1 and average monthly rentals of all student addresses?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = \"Lyla\"", "question": "What is the zip code of the address where the teacher with first name \"Lyla\" lives?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T2.email_address FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T1.zip_postcode = \"918\"", "question": "What are the email addresses of teachers whose address has zip code \"918\"?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT count(*) FROM STUDENTS WHERE student_id NOT IN ( SELECT student_id FROM Behavior_Incident )", "question": "How many students are not involved in any behavior incident?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT last_name FROM Teachers EXCEPT SELECT T1.last_name FROM Teachers AS T1 JOIN Detention AS T2 ON T1.teacher_id = T2.teacher_id", "question": "Find the last names of teachers who are not involved in any detention.", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T1.line_1 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id INTERSECT SELECT T1.line_1 FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id", "question": "What are the line 1 of addresses shared by some students and some teachers?", "schema": "Ref_Address_Types: address_type_code (VARCHAR(15)), address_type_description (VARCHAR(80))\nRef_Detention_Type: detention_type_code (VARCHAR(10)), detention_type_description (VARCHAR(80))\nRef_Incident_Type: incident_type_code (VARCHAR(10)), incident_type_description (VARCHAR(80))\nAddresses: address_id (INTEGER), line_1 (VARCHAR(120)), line_2 (VARCHAR(120)), line_3 (VARCHAR(120)), city (VARCHAR(80)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nStudents: student_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(40)), last_name (VARCHAR(40)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), date_first_rental (DATETIME), date_left_university (DATETIME), other_student_details (VARCHAR(255))\nTeachers: teacher_id (INTEGER), address_id (INTEGER), first_name (VARCHAR(80)), middle_name (VARCHAR(80)), last_name (VARCHAR(80)), gender (VARCHAR(1)), cell_mobile_number (VARCHAR(40)), email_address (VARCHAR(40)), other_details (VARCHAR(255))\nAssessment_Notes: notes_id (INTEGER), student_id (INTEGER), teacher_id (INTEGER), date_of_notes (DATETIME), text_of_notes (VARCHAR(255)), other_details (VARCHAR(255))\nBehavior_Incident: incident_id (INTEGER), incident_type_code (VARCHAR(10)), student_id (INTEGER), date_incident_start (DATETIME), date_incident_end (DATETIME), incident_summary (VARCHAR(255)), recommendations (VARCHAR(255)), other_details (VARCHAR(255))\nDetention: detention_id (INTEGER), detention_type_code (VARCHAR(10)), teacher_id (INTEGER), datetime_detention_start (DATETIME), datetime_detention_end (DATETIME), detention_summary (VARCHAR(255)), other_details (VARCHAR(255))\nStudent_Addresses: student_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), date_address_to (DATETIME), monthly_rental (DECIMAL(194)), other_details (VARCHAR(255))\nStudents_in_Detention: student_id (INTEGER), detention_id (INTEGER), incident_id (INTEGER)" }, { "query": "SELECT T1.asset_id , T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING count(*) = 2 INTERSECT SELECT T1.asset_id , T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING count(*) < 2", "question": "Which assets have 2 parts and have less than 2 fault logs? List the asset id and detail.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT count(*) , T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id = T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id", "question": "How many assets does each maintenance contract contain? List the number and the contract id.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT count(*) , T1.company_id FROM Third_Party_Companies AS T1 JOIN Assets AS T2 ON T1.company_id = T2.supplier_company_id GROUP BY T1.company_id", "question": "How many assets does each third party company supply? List the count and the company id.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.company_id , T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Engineers AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id HAVING count(*) >= 2 UNION SELECT T3.company_id , T3.company_name FROM Third_Party_Companies AS T3 JOIN Maintenance_Contracts AS T4 ON T3.company_id = T4.maintenance_contract_company_id GROUP BY T3.company_id HAVING count(*) >= 2", "question": "Which third party companies have at least 2 maintenance engineers or have at least 2 maintenance contracts? List the company id and name.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.staff_name , T1.staff_id FROM Staff AS T1 JOIN Fault_Log AS T2 ON T1.staff_id = T2.recorded_by_staff_id EXCEPT SELECT T3.staff_name , T3.staff_id FROM Staff AS T3 JOIN Engineer_Visits AS T4 ON T3.staff_id = T4.contact_staff_id", "question": "What is the name and id of the staff who recorded the fault log but has not contacted any visiting engineers?", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.engineer_id , T1.first_name , T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 GROUP BY T1.engineer_id ORDER BY count(*) DESC LIMIT 1", "question": "Which engineer has visited the most times? Show the engineer id, first name and last name.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.part_name , T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_id HAVING count(*) > 2", "question": "Which parts have more than 2 faults? Show the part name and id.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.first_name , T1.last_name , T1.other_details , T3.skill_description FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id", "question": "List all every engineer's first name, last name, details and coresponding skill description.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.fault_short_name , T3.skill_description FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id", "question": "For all the faults of different parts, what are all the decriptions of the skills required to fix them? List the name of the faults and the skill description.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.part_name , count(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name", "question": "How many assets can each parts be used in? List the part name and the number.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.fault_description , T2.fault_status FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id", "question": "What are all the fault descriptions and the fault status of all the faults recoreded in the logs?", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT count(*) , T1.fault_log_entry_id FROM Fault_Log AS T1 JOIN Engineer_Visits AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) DESC LIMIT 1", "question": "How many engineer visits are required at most for a single fault log? List the number and the log entry id.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT DISTINCT last_name FROM Maintenance_Engineers", "question": "What are all the distinct last names of all the engineers?", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT DISTINCT fault_status FROM Fault_Log_Parts", "question": "How many fault status codes are recorded in the fault log parts table?", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT first_name , last_name FROM Maintenance_Engineers WHERE engineer_id NOT IN (SELECT engineer_id FROM Engineer_Visits)", "question": "Which engineers have never visited to maintain the assets? List the engineer first name and last name.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT asset_id , asset_details , asset_make , asset_model FROM Assets", "question": "List the asset id, details, make and model for every asset.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT asset_acquired_date FROM Assets ORDER BY asset_acquired_date ASC LIMIT 1", "question": "When was the first asset acquired?", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.part_id , T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id JOIN Skills_Required_To_Fix AS T3 ON T2.part_fault_id = T3.part_fault_id GROUP BY T1.part_id ORDER BY count(*) DESC LIMIT 1", "question": "Which part fault requires the most number of skills to fix? List part id and name.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY count(*) ASC LIMIT 1", "question": "Which kind of part has the least number of faults? List the part name.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.engineer_id , T1.first_name , T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 ON T1.engineer_id = T2.engineer_id GROUP BY T1.engineer_id ORDER BY count(*) ASC LIMIT 1", "question": "Among those engineers who have visited, which engineer makes the least number of visits? List the engineer id, first name and last name.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.staff_name , T3.first_name , T3.last_name FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id", "question": "Which staff have contacted which engineers? List the staff name and the engineer first name and last name.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.fault_log_entry_id , T1.fault_description , T1.fault_log_entry_datetime FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) DESC LIMIT 1", "question": "Which fault log included the most number of faulty parts? List the fault log id, description and record time.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.skill_id , T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id = T2.skill_id GROUP BY T1.skill_id ORDER BY count(*) DESC LIMIT 1", "question": "Which skill is used in fixing the most number of faults? List the skill id and description.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT DISTINCT asset_model FROM Assets", "question": "What are all the distinct asset models?", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT asset_make , asset_model , asset_details FROM Assets ORDER BY asset_disposed_date ASC", "question": "List the all the assets make, model, details by the disposed date ascendingly.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT part_id , chargeable_amount FROM Parts ORDER BY chargeable_amount ASC LIMIT 1", "question": "Which part has the least chargeable amount? List the part id and amount.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id = T2.maintenance_contract_company_id ORDER BY T2.contract_start_date ASC LIMIT 1", "question": "Which company started the earliest the maintenance contract? Show the company name.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id = T2.maintenance_contract_company_id JOIN Ref_Company_Types AS T3 ON T1.company_type_code = T3.company_type_code ORDER BY T2.contract_end_date DESC LIMIT 1", "question": "What is the description of the type of the company who concluded its contracts most recently?", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT gender FROM staff GROUP BY gender ORDER BY count(*) DESC LIMIT 1", "question": "Which gender makes up the majority of the staff?", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT T1.staff_name , count(*) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id GROUP BY T1.staff_name", "question": "How many engineers did each staff contact? List both the contact staff name and number of engineers contacted.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT asset_model FROM Assets WHERE asset_id NOT IN (SELECT asset_id FROM Fault_Log)", "question": "Which assets did not incur any fault log? List the asset model.", "schema": "Third_Party_Companies: company_id (INTEGER), company_type (VARCHAR(5)), company_name (VARCHAR(255)), company_address (VARCHAR(255)), other_company_details (VARCHAR(255))\nMaintenance_Contracts: maintenance_contract_id (INTEGER), maintenance_contract_company_id (INTEGER), contract_start_date (DATETIME), contract_end_date (DATETIME), other_contract_details (VARCHAR(255))\nParts: part_id (INTEGER), part_name (VARCHAR(255)), chargeable_yn (VARCHAR(1)), chargeable_amount (VARCHAR(20)), other_part_details (VARCHAR(255))\nSkills: skill_id (INTEGER), skill_code (VARCHAR(20)), skill_description (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_name (VARCHAR(255)), gender (VARCHAR(1)), other_staff_details (VARCHAR(255))\nAssets: asset_id (INTEGER), maintenance_contract_id (INTEGER), supplier_company_id (INTEGER), asset_details (VARCHAR(255)), asset_make (VARCHAR(20)), asset_model (VARCHAR(20)), asset_acquired_date (DATETIME), asset_disposed_date (DATETIME), other_asset_details (VARCHAR(255)), REFERENCES (`MAINTENANCE_CONTRACTS`(`MAINTENANCE_CONTRACT_ID`)\nAsset_Parts: asset_id (INTEGER), part_id (INTEGER)\nMaintenance_Engineers: engineer_id (INTEGER), company_id (INTEGER), first_name (VARCHAR(50)), last_name (VARCHAR(50)), other_details (VARCHAR(255))\nEngineer_Skills: engineer_id (INTEGER), skill_id (INTEGER)\nFault_Log: fault_log_entry_id (INTEGER), asset_id (INTEGER), recorded_by_staff_id (INTEGER), fault_log_entry_datetime (DATETIME), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nEngineer_Visits: engineer_visit_id (INTEGER), contact_staff_id (INTEGER), engineer_id (INTEGER), fault_log_entry_id (INTEGER), fault_status (VARCHAR(10)), visit_start_datetime (DATETIME), visit_end_datetime (DATETIME), other_visit_details (VARCHAR(255))\nPart_Faults: part_fault_id (INTEGER), part_id (INTEGER), fault_short_name (VARCHAR(20)), fault_description (VARCHAR(255)), other_fault_details (VARCHAR(255))\nFault_Log_Parts: fault_log_entry_id (INTEGER), part_fault_id (INTEGER), fault_status (VARCHAR(10))\nSkills_Required_To_Fix: part_fault_id (INTEGER), skill_id (INTEGER)" }, { "query": "SELECT local_authority , services FROM station", "question": "list the local authorities and services provided by all stations.", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT train_number , name FROM train ORDER BY TIME", "question": "show all train numbers and names ordered by their time from early to late.", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT TIME , train_number FROM train WHERE destination = 'Chennai' ORDER BY TIME", "question": "Give me the times and numbers of all trains that go to Chennai, ordered by time.", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT count(*) FROM train WHERE name LIKE \"%Express%\"", "question": "How many trains have 'Express' in their names?", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT train_number , TIME FROM train WHERE origin = 'Chennai' AND destination = 'Guruvayur'", "question": "Find the number and time of the train that goes from Chennai to Guruvayur.", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT origin , count(*) FROM train GROUP BY origin", "question": "Find the number of trains starting from each origin.", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT t1.name FROM train AS t1 JOIN route AS t2 ON t1.id = t2.train_id GROUP BY t2.train_id ORDER BY count(*) DESC LIMIT 1", "question": "Find the name of the train whose route runs through greatest number of stations.", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT count(*) , t1.network_name , t1.services FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id GROUP BY t2.station_id", "question": "Find the number of trains for each station, as well as the station network name and services.", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT avg(high_temperature) , day_of_week FROM weekly_weather GROUP BY day_of_week", "question": "What is the average high temperature for each day of week?", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT max(t1.low_temperature) , avg(t1.precipitation) FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id WHERE t2.network_name = \"Amersham\"", "question": "Give me the maximum low temperature and average precipitation at the Amersham station.", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT t3.name , t3.time FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = \"Chiltern\"", "question": "Find names and times of trains that run through stations for the local authority Chiltern.", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT count(DISTINCT services) FROM station", "question": "How many different services are provided by all stations?", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT t2.id , t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id ORDER BY avg(high_temperature) DESC LIMIT 1", "question": "Find the id and local authority of the station with has the highest average high temperature.", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT t2.id , t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id HAVING max(t1.precipitation) > 50", "question": "Find the id and local authority of the station whose maximum precipitation is higher than 50.", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT min(low_temperature) , max(wind_speed_mph) FROM weekly_weather", "question": "show the lowest low temperature and highest wind speed in miles per hour.", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT origin FROM train GROUP BY origin HAVING count(*) > 1", "question": "Find the origins from which more than 1 train starts.", "schema": "train: id (INT), train_number (INT), name (TEXT), origin (TEXT), destination (TEXT), time (TEXT), interval (TEXT)\nstation: id (INT), network_name (TEXT), services (TEXT), local_authority (TEXT)\nroute: train_id (INT), station_id (INT)\nweekly_weather: station_id (INT), day_of_week (TEXT), high_temperature (INT), low_temperature (INT), precipitation (REAL), wind_speed_mph (INT)" }, { "query": "SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE DEPT_NAME = \"Accounting\"", "question": "Find the number of professors in accounting department.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE DEPT_NAME = \"Accounting\"", "question": "How many professors are in the accounting dept?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE = \"ACCT-211\"", "question": "How many professors are teaching class with code ACCT-211?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE = \"ACCT-211\"", "question": "How many professors teach a class with the code ACCT-211?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T3.EMP_FNAME , T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM = T3.EMP_NUM WHERE DEPT_NAME = \"Biology\"", "question": "What is the first and last name of the professor in biology department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T3.EMP_FNAME , T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM = T3.EMP_NUM WHERE DEPT_NAME = \"Biology\"", "question": "What are the first and last name of all biology professors?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT DISTINCT T1.EMP_FNAME , T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = \"ACCT-211\"", "question": "What are the first names and date of birth of professors teaching course ACCT-211?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT DISTINCT T1.EMP_FNAME , T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = \"ACCT-211\"", "question": "What are the first names and birthdates of the professors in charge of ACCT-211?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE T1.EMP_LNAME = 'Graztevski'", "question": "How many classes are professor whose last name is Graztevski has?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE T1.EMP_LNAME = 'Graztevski'", "question": "How many classes does the professor whose last name is Graztevski teach?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT school_code FROM department WHERE dept_name = \"Accounting\"", "question": "What is the code of the school where the accounting department belongs to?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT school_code FROM department WHERE dept_name = \"Accounting\"", "question": "What is the school code of the accounting department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT crs_credit , crs_description FROM course WHERE crs_code = 'CIS-220'", "question": "How many credits does course CIS-220 have, and what its description?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT crs_credit , crs_description FROM course WHERE crs_code = 'CIS-220'", "question": "What is the description for the CIS-220 and how many credits does it have?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT dept_address FROM department WHERE dept_name = 'History'", "question": "what is the address of history department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT dept_address FROM department WHERE dept_name = 'History'", "question": "Where is the history department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT dept_address) FROM department WHERE school_code = 'BUS'", "question": "How many different locations does the school with code BUS has?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT dept_address) FROM department WHERE school_code = 'BUS'", "question": "What are the different locations of the school with the code BUS?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT dept_address) , school_code FROM department GROUP BY school_code", "question": "How many different locations does each school have?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT dept_address) , school_code FROM department GROUP BY school_code", "question": "Count different addresses of each school.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT crs_credit , crs_description FROM course WHERE crs_code = 'QM-261'", "question": "Find the description and credit for the course QM-261?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT crs_credit , crs_description FROM course WHERE crs_code = 'QM-261'", "question": "What is the course description and number of credits for QM-261?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT dept_name) , school_code FROM department GROUP BY school_code", "question": "Find the number of departments in each school.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT dept_name) , school_code FROM department GROUP BY school_code", "question": "How many departments are in each school?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT dept_name) , school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name) < 5", "question": "Find the number of different departments in each school whose number of different departments is less than 5.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT dept_name) , school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name) < 5", "question": "How many different departments are there in each school that has less than 5 apartments?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) , crs_code FROM CLASS GROUP BY crs_code", "question": "How many sections does each course has?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) , crs_code FROM CLASS GROUP BY crs_code", "question": "How many sections does each course have?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT sum(crs_credit) , dept_code FROM course GROUP BY dept_code", "question": "What is the total credit does each department offer?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT sum(crs_credit) , dept_code FROM course GROUP BY dept_code", "question": "How many credits does the department offer?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) , class_room FROM CLASS GROUP BY class_room HAVING count(*) >= 2", "question": "Find the number of classes offered for all class rooms that held at least 2 classes.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) , class_room FROM CLASS GROUP BY class_room HAVING count(*) >= 2", "question": "For each classroom with at least 2 classes, how many classes are offered?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) , dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code", "question": "Find the number of classes in each department.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) , dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code", "question": "How many classes are held in each department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) , T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T2.dept_code = T3.dept_code GROUP BY T3.school_code", "question": "Find the number of classes in each school.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) , T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T2.dept_code = T3.dept_code GROUP BY T3.school_code", "question": "How many classes exist for each school?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) , T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code", "question": "What is the number of professors for different school?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) , T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code", "question": "How many different professors are there for the different schools?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT emp_jobcode , count(*) FROM employee GROUP BY emp_jobcode ORDER BY count(*) DESC LIMIT 1", "question": "Find the count and code of the job has most employees.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT emp_jobcode , count(*) FROM employee GROUP BY emp_jobcode ORDER BY count(*) DESC LIMIT 1", "question": "What is the count and code of the job with the most employee?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code ORDER BY count(*) LIMIT 1", "question": "Which school has the smallest amount of professors?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code ORDER BY count(*) LIMIT 1", "question": "Which school has the fewest professors?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) , dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code", "question": "Find the number of professors with a Ph.D. degree in each department.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) , dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code", "question": "How many professors have a Ph.D. in each department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) , dept_code FROM student GROUP BY dept_code", "question": "Find the number of students for each department.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) , dept_code FROM student GROUP BY dept_code", "question": "How many students are in each department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT sum(stu_hrs) , dept_code FROM student GROUP BY dept_code", "question": "Find the total number of hours have done for all students in each department.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT sum(stu_hrs) , dept_code FROM student GROUP BY dept_code", "question": "How many hours do the students spend studying in each department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT max(stu_gpa) , avg(stu_gpa) , min(stu_gpa) , dept_code FROM student GROUP BY dept_code", "question": "Find the max, average, and minimum gpa of all students in each department.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT max(stu_gpa) , avg(stu_gpa) , min(stu_gpa) , dept_code FROM student GROUP BY dept_code", "question": "What is the highest, lowest, and average student GPA for every department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.dept_name , avg(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY avg(T1.stu_gpa) DESC LIMIT 1", "question": "What is the name and the average gpa of department whose students have the highest average gpa?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.dept_name , avg(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY avg(T1.stu_gpa) DESC LIMIT 1", "question": "Which department has the highest average student GPA, and what is the average gpa?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT school_code) FROM department", "question": "how many schools exist in total?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT school_code) FROM department", "question": "How many schools are there in the department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT class_code) FROM CLASS", "question": "How many different classes are there?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT class_code) FROM CLASS", "question": "How many unique classes are offered?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT crs_code) FROM CLASS", "question": "How many courses are offered?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT crs_code) FROM CLASS", "question": "What are the number of different course codes?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT dept_name) FROM department", "question": "How many departments does the college has?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT dept_name) FROM department", "question": "How many different departments are there?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = \"Computer Info. Systems\"", "question": "How many courses are offered by the Computer Info. Systems department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = \"Computer Info. Systems\"", "question": "How many courses does the department of Computer Information Systmes offer?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211'", "question": "How many sections does course ACCT-211 has?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211'", "question": "What is the number of different class sections offered in the course ACCT-211?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT sum(T1.crs_credit) , T1.dept_code FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code GROUP BY T1.dept_code", "question": "Find the total credits of all classes offered by each department.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT sum(T1.crs_credit) , T1.dept_code FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code GROUP BY T1.dept_code", "question": "What are the total number of credits offered by each department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T3.dept_name FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T1.dept_code = T3.dept_code GROUP BY T1.dept_code ORDER BY sum(T1.crs_credit) DESC LIMIT 1", "question": "Find the name of the department that offers the largest number of credits of all classes.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T3.dept_name FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T1.dept_code = T3.dept_code GROUP BY T1.dept_code ORDER BY sum(T1.crs_credit) DESC LIMIT 1", "question": "Which department offers the most credits all together?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211'", "question": "How many students enrolled in class ACCT-211?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211'", "question": "What are the total number of students enrolled in ACCT-211?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211'", "question": "What is the first name of each student enrolled in class ACCT-211?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211'", "question": "What are the first names of all students in course ACCT-211?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211' AND T2.enroll_grade = 'C'", "question": "What is the first name of students enrolled in class ACCT-211 and got grade C?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211' AND T2.enroll_grade = 'C'", "question": "What are the first names of all students who took ACCT-211 and received a C?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM employee", "question": "Find the total number of employees.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM employee", "question": "How many employees are there all together?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM professor WHERE prof_high_degree = 'Ph.D.'", "question": "How many professors do have a Ph.D. degree?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM professor WHERE prof_high_degree = 'Ph.D.'", "question": "What is the total number of professors with a Ph.D. ?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting'", "question": "How many students are enrolled in the class taught by some professor from the accounting department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting'", "question": "How many students are enrolled in some classes that are taught by an accounting professor?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of the department that has the largest number of students enrolled?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of the department with the most students enrolled?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT dept_name FROM department ORDER BY dept_name", "question": "list names of all departments ordered by their names.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT dept_name FROM department ORDER BY dept_name", "question": "What are the names of all departments in alphabetical order?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT class_code FROM CLASS WHERE class_room = 'KLR209'", "question": "List the codes of all courses that take place in room KLR209.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT class_code FROM CLASS WHERE class_room = 'KLR209'", "question": "What are the codes of all the courses that are located in room KLR209?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob", "question": "List the first name of all employees with job code PROF ordered by their date of birth.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob", "question": "What are the first names of all employees that are professors ordered by date of birth?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname , T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num ORDER BY T2.emp_fname", "question": "Find the first names and offices of all professors sorted by alphabetical order of their first name.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname , T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num ORDER BY T2.emp_fname", "question": "What are the first names and office locations for all professors sorted alphabetically by first name?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT emp_fname , emp_lname FROM employee ORDER BY emp_dob LIMIT 1", "question": "What is the first and last name of the oldest employee?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT emp_fname , emp_lname FROM employee ORDER BY emp_dob LIMIT 1", "question": "What are the first and last names of the employee with the earliest date of birth?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT stu_fname , stu_lname , stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob DESC LIMIT 1", "question": "What is the first, last name, gpa of the youngest one among students whose GPA is above 3?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT stu_fname , stu_lname , stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob DESC LIMIT 1", "question": "What is the first and last name of the youngest student with a GPA above 3, and what is their GPA?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C'", "question": "What is the first name of students who got grade C in any class?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C'", "question": "What are the first names of all students who got a grade C in a class?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) LIMIT 1", "question": "What is the name of department where has the smallest number of professors?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) LIMIT 1", "question": "What is the name of the department with the fewest professors?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.dept_name , T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.prof_high_degree = 'Ph.D.' GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of department where has the largest number of professors with a Ph.D. degree?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.dept_name , T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.prof_high_degree = 'Ph.D.' GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1", "question": "Which department has the most professors with a Ph.D.?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num", "question": "What are the first names of the professors who do not teach a class.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num", "question": "What are the first names of all professors not teaching any classes?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num = T5.prof_num", "question": "What is the first names of the professors from the history department who do not teach a class.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num = T5.prof_num", "question": "What are the first names of all history professors who do not teach?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.emp_lname , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History'", "question": "What is the last name and office of the professor from the history department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.emp_lname , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History'", "question": "What are the last name and office of all history professors?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T3.dept_name , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T1.emp_lname = 'Heffington'", "question": "What is department name and office for the professor whose last name is Heffington?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T3.dept_name , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T1.emp_lname = 'Heffington'", "question": "What is the name of the department and office location for the professor with the last name of Heffington?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.emp_lname , T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num WHERE T2.prof_office = 'DRE 102'", "question": "Find the last name and hire date of the professor who is in office DRE 102.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.emp_lname , T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num WHERE T2.prof_office = 'DRE 102'", "question": "What is the last name of the professor whose office is located in DRE 102, and when were they hired?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num WHERE T3.stu_lname = 'Smithson'", "question": "What is the code of the course which the student whose last name is Smithson took?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num WHERE T3.stu_lname = 'Smithson'", "question": "What are the course codes for every class that the student with the last name Smithson took?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T4.crs_description , T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'", "question": "What are the description and credit of the course which the student whose last name is Smithson took?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T4.crs_description , T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'", "question": "How many credits is the course that the student with the last name Smithson took, and what is its description?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA'", "question": "How many professors who has a either Ph.D. or MA degree?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA'", "question": "How many professors attained either Ph.D. or Masters degrees?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology'", "question": "How many professors who are from either Accounting or Biology department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology'", "question": "What is the number of professors who are in the Accounting or Biology departments?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'CIS-220' INTERSECT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'QM-261'", "question": "Find the first name of the professor who is teaching two courses with code CIS-220 and QM-261.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'CIS-220' INTERSECT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'QM-261'", "question": "What is the first name of the professor who is teaching CIS-220 and QM-261?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems'", "question": "Find the first name of student who is taking classes from accounting and Computer Info. Systems departments", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems'", "question": "What are the first names of all students taking accoutning and Computer Information Systems classes?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT avg(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T1.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211'", "question": "What is the average gpa of the students enrolled in the course with code ACCT-211?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT avg(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T1.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211'", "question": "What is the average GPA of students taking ACCT-211?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT stu_gpa , stu_phone , stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5", "question": "What is the first name, gpa and phone number of the top 5 students with highest gpa?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT stu_gpa , stu_phone , stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5", "question": "What is the first name, GPA, and phone number of the students with the top 5 GPAs?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa LIMIT 1", "question": "What is the department name of the students with lowest gpa belongs to?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa LIMIT 1", "question": "What is the name of the department with the student that has the lowest GPA?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT stu_fname , stu_gpa FROM student WHERE stu_gpa < (SELECT avg(stu_gpa) FROM student)", "question": "Find the first name and gpa of the students whose gpa is lower than the average gpa of all students.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT stu_fname , stu_gpa FROM student WHERE stu_gpa < (SELECT avg(stu_gpa) FROM student)", "question": "What is the first name and GPA of every student that has a GPA lower than average?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.dept_name , T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1", "question": "Find the name and address of the department that has the highest number of students.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.dept_name , T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1", "question": "What is the name and address of the department with the most students?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.dept_name , T2.dept_address , count(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 3", "question": "Find the name, address, number of students in the departments that have the top 3 highest number of students.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.dept_name , T2.dept_address , count(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 3", "question": "What is the name, address, and number of students in the departments that have the 3 most students?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.emp_fname , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.'", "question": "Find the first name and office of the professor who is in the history department and has a Ph.D. degree.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.emp_fname , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.'", "question": "What are the first names and office of the professors who are in the history department and have a Ph.D?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname , T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num", "question": "Find the first names of all instructors who have taught some course and the course code.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname , T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num", "question": "What are the first names of all teachers who have taught a course and the corresponding course codes?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code", "question": "Find the first names of all instructors who have taught some course and the course description.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code", "question": "What are the first names of all teachers who have taught a course and the corresponding descriptions?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname , T4.prof_office , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num", "question": "Find the first names and offices of all instructors who have taught some course and also find the course description.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname , T4.prof_office , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num", "question": "What are the first names, office locations of all lecturers who have taught some course?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname , T4.prof_office , T3.crs_description , T5.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code", "question": "Find the first names and offices of all instructors who have taught some course and the course description and the department name.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname , T4.prof_office , T3.crs_description , T5.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code", "question": "What are the first names, office locations, and departments of all instructors, and also what are the descriptions of the courses they teach?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.stu_fname , T1.stu_lname , T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code", "question": "Find names of all students who took some course and the course description.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.stu_fname , T1.stu_lname , T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code", "question": "What are the names of all students who took a class and the corresponding course descriptions?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.stu_fname , T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A'", "question": "Find names of all students who took some course and got A or C.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.stu_fname , T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A'", "question": "What are the names of all students taking a course who received an A or C?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname , T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting'", "question": "Find the first names of all professors in the Accounting department who is teaching some course and the class room.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname , T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting'", "question": "What are the first names of all Accounting professors who teach and what are the classrooms of the courses they teach?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT DISTINCT T2.emp_fname , T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems'", "question": "Find the first names and degree of all professors who are teaching some class in Computer Info. Systems department.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT DISTINCT T2.emp_fname , T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems'", "question": "What are the different first names and highest degree attained for professors teaching in the Computer Information Systems department?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018", "question": "What is the last name of the student who got a grade A in the class with code 10018.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018", "question": "What is the last name of the student who received an A in the class with the code 10018?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname , T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree != 'Ph.D.'", "question": "Find the first name and office of history professor who did not get a Ph.D. degree.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname , T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree != 'Ph.D.'", "question": "What are the first names and offices of history professors who don't have Ph.D.s?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num GROUP BY T1.prof_num HAVING count(*) > 1", "question": "Find the first names of professors who are teaching more than one class.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num GROUP BY T1.prof_num HAVING count(*) > 1", "question": "What are the first names of all professors who teach more than one class?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING count(*) = 1", "question": "Find the first names of students who took exactly one class.", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING count(*) = 1", "question": "What are the first names of student who only took one course?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.crs_description LIKE '%Statistics%'", "question": "Find the name of department that offers the class whose description has the word \"Statistics\".", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.crs_description LIKE '%Statistics%'", "question": "What is the name of the department that offers a course that has a description including the word \"Statistics\"?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%'", "question": "What is the first name of the student whose last name starting with the letter S and is taking ACCT-211 class?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%'", "question": "What is the first name of the student whose last name starts with the letter S and is taking ACCT-211?", "schema": "CLASS: CLASS_CODE (VARCHAR(5)), CRS_CODE (VARCHAR(10)), CLASS_SECTION (VARCHAR(2)), CLASS_TIME (VARCHAR(20)), CLASS_ROOM (VARCHAR(8)), PROF_NUM (INT)\nCOURSE: CRS_CODE (VARCHAR(10)), DEPT_CODE (VARCHAR(10)), CRS_DESCRIPTION (VARCHAR(35)), CRS_CREDIT (FLOAT(8))\nDEPARTMENT: DEPT_CODE (VARCHAR(10)), DEPT_NAME (VARCHAR(30)), SCHOOL_CODE (VARCHAR(8)), EMP_NUM (INT), DEPT_ADDRESS (VARCHAR(20)), DEPT_EXTENSION (VARCHAR(4))\nEMPLOYEE: EMP_NUM (INT), EMP_LNAME (VARCHAR(15)), EMP_FNAME (VARCHAR(12)), EMP_INITIAL (VARCHAR(1)), EMP_JOBCODE (VARCHAR(5)), EMP_HIREDATE (DATETIME), EMP_DOB (DATETIME)\nENROLL: CLASS_CODE (VARCHAR(5)), STU_NUM (INT), ENROLL_GRADE (VARCHAR(50))\nPROFESSOR: EMP_NUM (INT), DEPT_CODE (VARCHAR(10)), PROF_OFFICE (VARCHAR(50)), PROF_EXTENSION (VARCHAR(4)), PROF_HIGH_DEGREE (VARCHAR(5))\nSTUDENT: STU_NUM (INT), STU_LNAME (VARCHAR(15)), STU_FNAME (VARCHAR(15)), STU_INIT (VARCHAR(1)), STU_DOB (DATETIME), STU_HRS (INT), STU_CLASS (VARCHAR(2)), STU_GPA (FLOAT(8)), STU_TRANSFER (NUMERIC), DEPT_CODE (VARCHAR(18)), STU_PHONE (VARCHAR(4)), PROF_NUM (INT)" }, { "query": "SELECT count(*) FROM club", "question": "How many clubs are there?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT count(*) FROM club", "question": "What is the total number of clubs?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT DISTINCT Region FROM club ORDER BY Region ASC", "question": "List the distinct region of clubs in ascending alphabetical order.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT DISTINCT Region FROM club ORDER BY Region ASC", "question": "What are the different regions of clubs in ascending alphabetical order?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT avg(Gold) FROM club_rank", "question": "What is the average number of gold medals for clubs?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT avg(Gold) FROM club_rank", "question": "What is the average number of gold medals for a club?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT Competition_type , Country FROM competition", "question": "What are the types and countries of competitions?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT Competition_type , Country FROM competition", "question": "What are the types of every competition and in which countries are they located?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT DISTINCT YEAR FROM competition WHERE Competition_type != \"Tournament\"", "question": "What are the distinct years in which the competitions type is not \"Tournament\"?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT DISTINCT YEAR FROM competition WHERE Competition_type != \"Tournament\"", "question": "What are the different years for all competitions that are not of type equal to tournament?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT max(Silver) , min(Silver) FROM club_rank", "question": "What are the maximum and minimum number of silver medals for clubs.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT max(Silver) , min(Silver) FROM club_rank", "question": "What are the maximum and minimum number of silver medals for all the clubs?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT count(*) FROM club_rank WHERE Total < 10", "question": "How many clubs have total medals less than 10?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT count(*) FROM club_rank WHERE Total < 10", "question": "What is the total number of clubs that have less than 10 medals in total?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT name FROM club ORDER BY Start_year ASC", "question": "List all club names in ascending order of start year.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT name FROM club ORDER BY Start_year ASC", "question": "What are the names of all the clubs starting with the oldest?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT name FROM club ORDER BY name DESC", "question": "List all club names in descending alphabetical order.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT name FROM club ORDER BY name DESC", "question": "What are the names of all the clubs ordered in descending alphabetical order?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT T1.name , T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID", "question": "Please show the names and the players of clubs.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT T1.name , T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID", "question": "What are the names and players of all the clubs?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = \"Right Wing\"", "question": "Show the names of clubs that have players with position \"Right Wing\".", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = \"Right Wing\"", "question": "What are the names of the clubs that have players in the position of \"Right Wing\"?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = \"AIB\"", "question": "What is the average points of players from club with name \"AIB\".", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = \"AIB\"", "question": "What is the average number of points for players from the \"AIB\" club?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT POSITION , avg(Points) FROM player GROUP BY POSITION", "question": "List the position of players and the average number of points of players of each position.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT POSITION , avg(Points) FROM player GROUP BY POSITION", "question": "For each position, what is the average number of points for players in that position?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT POSITION FROM player GROUP BY name HAVING avg(Points) >= 20", "question": "List the position of players with average number of points scored by players of that position bigger than 20.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT POSITION FROM player GROUP BY name HAVING avg(Points) >= 20", "question": "What are the positions of players whose average number of points scored by that position is larger than 20?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT Competition_type , COUNT(*) FROM competition GROUP BY Competition_type", "question": "List the types of competition and the number of competitions of each type.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT Competition_type , COUNT(*) FROM competition GROUP BY Competition_type", "question": "What are the types of competition and number of competitions for that type?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1", "question": "List the most common type of competition.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the most common competition type?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5", "question": "List the types of competition that have at most five competitions of that type.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5", "question": "What are the types of competition that have most 5 competitions for that type?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player)", "question": "List the names of clubs that do not have any players.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player)", "question": "What are the names of all clubs that do not have any players?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10", "question": "What are the positions with both players having more than 20 points and less than 10 points.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10", "question": "What are the positions of both players that have more than 20 20 points and less than 10 points?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT sum(Points) FROM player", "question": "Show total points of all players.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT sum(Points) FROM player", "question": "What is the total number of points for all players?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT count(DISTINCT POSITION) FROM player", "question": "how many different positions are there?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT count(DISTINCT POSITION) FROM player", "question": "How many different position for players are listed?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT name FROM player WHERE points > (SELECT avg(points) FROM player)", "question": "what are the name of players who get more than the average points.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT name FROM player WHERE points > (SELECT avg(points) FROM player)", "question": "What are the names of all players that got more than the average number of points?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT count(*) , POSITION FROM player WHERE points < 30 GROUP BY POSITION", "question": "find the number of players whose points are lower than 30 in each position.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT count(*) , POSITION FROM player WHERE points < 30 GROUP BY POSITION", "question": "What is the number of players who have points less than 30 for each position?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1", "question": "which country did participated in the most number of Tournament competitions?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1", "question": "what is the name of the country that participated in the most tournament competitions?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament'", "question": "which countries did participated in both Friendly and Tournament type competitions.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament'", "question": "What are the countries that participated in both friendly and tournament type competitions?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly'", "question": "Find the countries that have never participated in any competition with Friendly type.", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type = 'Friendly'", "question": "What are the countries that have never participated in any friendly-type competitions?", "schema": "club: Club_ID (INT), name (TEXT), Region (TEXT), Start_year (TEXT)\nclub_rank: Rank (REAL), Club_ID (INT), Gold (REAL), Silver (REAL), Bronze (REAL), Total (REAL)\nplayer: Player_ID (INT), name (TEXT), Position (TEXT), Club_ID (INT), Apps (REAL), Tries (REAL), Goals (TEXT), Points (REAL)\ncompetition: Competition_ID (INT), Year (REAL), Competition_type (TEXT), Country (TEXT)\ncompetition_result: Competition_ID (INT), Club_ID_1 (INT), Club_ID_2 (INT), Score (TEXT)" }, { "query": "SELECT sum(num_of_component) FROM furniture", "question": "How many furniture components are there in total?", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT name , furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1", "question": "Return the name and id of the furniture with the highest market rate.", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT sum(market_rate) FROM furniture ORDER BY market_rate DESC LIMIT 2", "question": "find the total market rate of the furnitures that have the top 2 market shares.", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT Num_of_Component , name FROM furniture WHERE Num_of_Component > 10", "question": "Find the component amounts and names of all furnitures that have more than 10 components.", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT name , Num_of_Component FROM furniture ORDER BY market_rate LIMIT 1", "question": "Find the name and component amount of the least popular furniture.", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT t1.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID WHERE t2.Price_in_Dollar < (SELECT max(Price_in_Dollar) FROM furniture_manufacte)", "question": "Find the names of furnitures whose prices are lower than the highest price.", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT open_year , name FROM manufacturer ORDER BY num_of_shops DESC LIMIT 1", "question": "Which manufacturer has the most number of shops? List its name and year of opening.", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT avg(Num_of_Factories) FROM manufacturer WHERE num_of_shops > 20", "question": "Find the average number of factories for the manufacturers that have more than 20 shops.", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT name , manufacturer_id FROM manufacturer ORDER BY open_year", "question": "List all manufacturer names and ids ordered by their opening year.", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT name , open_year FROM manufacturer WHERE num_of_shops > 10 OR Num_of_Factories < 10", "question": "Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops.", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT max(num_of_shops) , avg(Num_of_Factories) FROM manufacturer WHERE open_year < 1990", "question": "what is the average number of factories and maximum number of shops for manufacturers that opened before 1990.", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT t1.manufacturer_id , t1.num_of_shops FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id ORDER BY t2.Price_in_Dollar DESC LIMIT 1", "question": "Find the id and number of shops for the company that produces the most expensive furniture.", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT count(*) , t1.name FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id GROUP BY t1.manufacturer_id", "question": "Find the number of funiture types produced by each manufacturer as well as the company names.", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT t1.name , t2.price_in_dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID", "question": "Give me the names and prices of furnitures which some companies are manufacturing.", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT Market_Rate , name FROM furniture WHERE Furniture_ID NOT IN (SELECT Furniture_ID FROM furniture_manufacte)", "question": "Find the market shares and names of furnitures which no any company is producing in our records.", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component < 6 INTERSECT SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component > 10", "question": "Find the name of the company that produces both furnitures with less than 6 components and furnitures with more than 10 components.", "schema": "manufacturer: Manufacturer_ID (INT), Open_Year (REAL), Name (TEXT), Num_of_Factories (INT), Num_of_Shops (INT)\nfurniture: Furniture_ID (INT), Name (TEXT), Num_of_Component (INT), Market_Rate (REAL)\nfurniture_manufacte: Manufacturer_ID (INT), Furniture_ID (INT), Price_in_Dollar (REAL)" }, { "query": "SELECT T1.first_name , T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id", "question": "Display the first name and department name for each employee.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T1.first_name , T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id", "question": "What are the first name and department name of all employees?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , salary FROM employees WHERE salary < 6000", "question": "List the full name (first and last name), and salary for those employees who earn below 6000.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , salary FROM employees WHERE salary < 6000", "question": "What are the full names and salaries for any employees earning less than 6000?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , department_id FROM employees WHERE last_name = 'McEwen'", "question": "Display the first name, and department number for all employees whose last name is \"McEwen\".", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , department_id FROM employees WHERE last_name = 'McEwen'", "question": "What are the first names and department numbers for employees with last name McEwen?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE department_id = \"null\"", "question": "Return all the information for all employees without any department number.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE department_id = \"null\"", "question": "What are all the employees without a department number?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM departments WHERE department_name = 'Marketing'", "question": "Display all the information about the department Marketing.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM departments WHERE department_name = 'Marketing'", "question": "What is all the information about the Marketing department?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT hire_date FROM employees WHERE first_name NOT LIKE '%M%'", "question": "when is the hire date for those employees whose first name does not containing the letter M?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT hire_date FROM employees WHERE first_name NOT LIKE '%M%'", "question": "On what dates were employees without the letter M in their first names hired?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%'", "question": "display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%'", "question": "What are the full name, hire date, salary, and department id for employees without the letter M in their first name?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%' ORDER BY department_id", "question": "display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M and make the result set in ascending order by department number.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%' ORDER BY department_id", "question": "What are the full name, hire data, salary and department id for employees without the letter M in their first name, ordered by ascending department id?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000", "question": "what is the phone number of employees whose salary is in the range of 8000 and 12000?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000", "question": "Return the phone numbers of employees with salaries between 8000 and 12000.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct != \"null\" OR department_id != 40", "question": "display all the information of employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct != \"null\" OR department_id != 40", "question": "Return all information about employees with salaries between 8000 and 12000 for which commission is not null or where their department id is not 40.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , salary FROM employees WHERE commission_pct = \"null\"", "question": "What are the full name (first and last name) and salary for all employees who does not have any value for commission?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , salary FROM employees WHERE commission_pct = \"null\"", "question": "Return the full names and salaries of employees with null commissions.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , salary FROM employees WHERE first_name LIKE '%m'", "question": "Display the first and last name, and salary for those employees whose first name is ending with the letter m.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , salary FROM employees WHERE first_name LIKE '%m'", "question": "Return the full names and salaries for employees with first names that end with the letter m.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT job_id , hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05'", "question": "Find job id and date of hire for those employees who was hired between November 5th, 2007 and July 5th, 2009.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT job_id , hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05'", "question": "What are the job ids and dates of hire for employees hired after November 5th, 2007 and before July 5th, 2009?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name FROM employees WHERE department_id = 70 OR department_id = 90", "question": "What are the first and last name for those employees who works either in department 70 or 90?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name FROM employees WHERE department_id = 70 OR department_id = 90", "question": "What are the full names of employees who with in department 70 or 90?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT salary , manager_id FROM employees WHERE manager_id != \"null\"", "question": "Find the salary and manager number for those employees who is working under a manager.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT salary , manager_id FROM employees WHERE manager_id != \"null\"", "question": "What are the salaries and manager ids for employees who have managers?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE hire_date < '2002-06-21'", "question": "display all the details from Employees table for those employees who was hired before 2002-06-21.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE hire_date < '2002-06-21'", "question": "What is all the information about employees hired before June 21, 2002?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC", "question": "display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by salary.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC", "question": "What is all the information about employees with D or S in their first name, ordered by salary descending?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE hire_date > '1987-09-07'", "question": "display those employees who joined after 7th September, 1987.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE hire_date > '1987-09-07'", "question": "Which employees were hired after September 7th, 1987?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT job_title FROM jobs WHERE min_salary > 9000", "question": "display the job title of jobs which minimum salary is greater than 9000.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT job_title FROM jobs WHERE min_salary > 9000", "question": "Which job titles correspond to jobs with salaries over 9000?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT job_title , max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000", "question": "display job Title, the difference between minimum and maximum salaries for those jobs which max salary within the range 12000 to 18000.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT job_title , max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000", "question": "What are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT email FROM employees WHERE commission_pct = \"null\" AND salary BETWEEN 7000 AND 12000 AND department_id = 50", "question": "display the emails of the employees who have no commission percentage and salary within the range 7000 to 12000 and works in that department which number is 50.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT email FROM employees WHERE commission_pct = \"null\" AND salary BETWEEN 7000 AND 12000 AND department_id = 50", "question": "What are the emails of employees with null commission, salary between 7000 and 12000, and who work in department 50?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id , MAX(end_date) FROM job_history GROUP BY employee_id", "question": "display the employee ID for each employee and the date on which he ended his previous job.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id , MAX(end_date) FROM job_history GROUP BY employee_id", "question": "What are the employee ids for each employee and final dates of employment at their last job?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10", "question": "display those departments where more than ten employees work who got a commission percentage.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10", "question": "What are the department ids for which more than 10 employees had a commission?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4", "question": "Find the ids of the departments where any manager is managing 4 or more employees.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4", "question": "What are department ids for departments with managers managing more than 3 employees?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT department_id , AVG(salary) FROM employees WHERE commission_pct != \"null\" GROUP BY department_id", "question": "display the average salary of employees for each department who gets a commission percentage.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT department_id , AVG(salary) FROM employees WHERE commission_pct != \"null\" GROUP BY department_id", "question": "What is the average salary of employees who have a commission percentage that is not null?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT country_id , COUNT(*) FROM locations GROUP BY country_id", "question": "display the country ID and number of cities for each country.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT country_id , COUNT(*) FROM locations GROUP BY country_id", "question": "Give the country id and corresponding count of cities in each country.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2", "question": "display job ID for those jobs that were done by two or more for more than 300 days.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2", "question": "What are the job ids for jobs done more than once for a period of more than 300 days?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2", "question": "display the ID for those employees who did two or more jobs in the past.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2", "question": "What are the employee ids for employees who have held two or more jobs?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T1.employee_id , T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id", "question": "Find employee with ID and name of the country presently where (s)he is working.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T1.employee_id , T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id", "question": "What are all the employee ids and the names of the countries in which they work?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T2.department_name , COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name", "question": "display the department name and number of employees in each of the department.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T2.department_name , COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name", "question": "Give the name of each department and the number of employees in each.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000", "question": "Can you return all detailed info of jobs which was done by any of the employees who is presently earning a salary on and above 12000?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000", "question": "What is all the job history info done by employees earning a salary greater than or equal to 12000?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT job_title , AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title", "question": "display job title and average salary of employees.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT job_title , AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title", "question": "What is the average salary for each job title?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163 )", "question": "What is the full name ( first name and last name ) for those employees who gets more salary than the employee whose id is 163?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163 )", "question": "Provide the full names of employees earning more than the employee with id 163.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT MIN(salary) , department_id FROM employees GROUP BY department_id", "question": "return the smallest salary for every departments.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT MIN(salary) , department_id FROM employees GROUP BY department_id", "question": "What is the minimum salary in each department?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id)", "question": "Find the first name and last name and department id for those employees who earn such amount of salary which is the smallest salary of any of the departments.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id)", "question": "What are the full names and department ids for the lowest paid employees across all departments.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees)", "question": "Find the employee id for all employees who earn more than the average salary.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees)", "question": "What are the employee ids for employees who make more than the average?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id , salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam' )", "question": "display the employee id and salary of all employees who report to Payam (first name).", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id , salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam' )", "question": "What are the employee ids of employees who report to Payam, and what are their salaries?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id", "question": "find the name of all departments that do actually have one or more employees assigned to them.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id", "question": "What are the names of departments that have at least one employee.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id", "question": "get the details of employees who manage a department.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id", "question": "What is all the information regarding employees who are managers?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM departments WHERE department_name = 'Marketing'", "question": "display all the information about the department Marketing.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM departments WHERE department_name = 'Marketing'", "question": "What is all the information about the Marketing department?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2", "question": "display the ID for those employees who did two or more jobs in the past.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2", "question": "What are the employee ids for those who had two or more jobs.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4", "question": "What are the unique ids of those departments where any manager is managing 4 or more employees.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4", "question": "Give the distinct department ids of departments in which a manager is in charge of 4 or more employees?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000", "question": "Find the job ID for those jobs which average salary is above 8000.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000", "question": "What are the job ids corresponding to jobs with average salary above 8000?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T1.employee_id , T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.department_id = 80", "question": "display the employee ID and job name for all those jobs in department 80.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T1.employee_id , T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.department_id = 80", "question": "what are the employee ids and job titles for employees in department 80?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T1.first_name , T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance'", "question": "What is the first name and job id for all employees in the Finance department?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T1.first_name , T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance'", "question": "Give the first name and job id for all employees in the Finance department.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500", "question": "display all the information of the employees whose salary if within the range of smallest salary and 2500.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500", "question": "What is all the information regarding employees with salaries above the minimum and under 2500?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE department_id NOT IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200)", "question": "Find the ids of the employees who does not work in those departments where some employees works whose manager id within the range 100 and 200.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE department_id NOT IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200)", "question": "What are the ids for employees who do not work in departments with managers that have ids between 100 and 200?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = \"Clara\")", "question": "display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = \"Clara\")", "question": "What are the full names and hire dates for employees in the same department as someone with the first name Clara?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , hire_date FROM employees WHERE department_id = ( SELECT department_id FROM employees WHERE first_name = \"Clara\") AND first_name != \"Clara\"", "question": "display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara excluding Clara.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , hire_date FROM employees WHERE department_id = ( SELECT department_id FROM employees WHERE first_name = \"Clara\") AND first_name != \"Clara\"", "question": "What are the full names and hire dates for employees in the same department as someone with the first name Clara, not including Clara?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id , first_name , last_name FROM employees WHERE department_id IN ( SELECT department_id FROM employees WHERE first_name LIKE '%T%' )", "question": "display the employee number and name( first name and last name ) for all employees who work in a department with any employee whose name contains a \u2019T\u2019.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id , first_name , last_name FROM employees WHERE department_id IN ( SELECT department_id FROM employees WHERE first_name LIKE '%T%' )", "question": "What are the ids and full names for employees who work in a department that has someone with a first name that contains the letter T?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id , first_name , last_name , salary FROM employees WHERE salary > ( SELECT AVG (salary) FROM employees ) AND department_id IN ( SELECT department_id FROM employees WHERE first_name LIKE '%J%')", "question": "display the employee number, name( first name and last name ), and salary for all employees who earn more than the average salary and who work in a department with any employee with a 'J' in their first name.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id , first_name , last_name , salary FROM employees WHERE salary > ( SELECT AVG (salary) FROM employees ) AND department_id IN ( SELECT department_id FROM employees WHERE first_name LIKE '%J%')", "question": "What are the ids, full names, and salaries for employees making more than average and who work in a department with employees who have the letter J in their first name?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id , job_id FROM employees WHERE salary < ( SELECT min(salary) FROM employees WHERE job_id = 'MK_MAN' )", "question": "display the employee number and job id for all employees whose salary is smaller than any salary of those employees whose job title is MK_MAN.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id , job_id FROM employees WHERE salary < ( SELECT min(salary) FROM employees WHERE job_id = 'MK_MAN' )", "question": "What are the employee ids and job ids for employees who make less than the lowest earning employee with title MK_MAN?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id , first_name , last_name , job_id FROM employees WHERE salary > ( SELECT max(salary) FROM employees WHERE job_id = 'PU_MAN' )", "question": "display the employee number, name( first name and last name ) and job title for all employees whose salary is more than any salary of those employees whose job title is PU_MAN.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT employee_id , first_name , last_name , job_id FROM employees WHERE salary > ( SELECT max(salary) FROM employees WHERE job_id = 'PU_MAN' )", "question": "What are the employee ids, full names, and job ids for employees who make more than the highest earning employee with title PU_MAN?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT department_id , SUM(salary) FROM employees GROUP BY department_id HAVING count(*) >= 2", "question": "display the department id and the total salary for those departments which contains at least two employees.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT department_id , SUM(salary) FROM employees GROUP BY department_id HAVING count(*) >= 2", "question": "What are total salaries and department id for each department that has more than 2 employees?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE employee_id NOT IN (SELECT employee_id FROM job_history)", "question": "display all the information of those employees who did not have any job in the past.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT * FROM employees WHERE employee_id NOT IN (SELECT employee_id FROM job_history)", "question": "What is all the information about employees who have never had a job in the past?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , salary , department_id , MAX(salary) FROM employees GROUP BY department_id", "question": "display the department ID, full name (first and last name), salary for those employees who is highest salary in every department.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , salary , department_id , MAX(salary) FROM employees GROUP BY department_id", "question": "What are the department ids, full names, and salaries for employees who make the most in their departments?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T1.first_name , T1.last_name , T2.department_name , T3.city , T3.state_province FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id", "question": "display the first and last name, department, city, and state province for each employee.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T1.first_name , T1.last_name , T2.department_name , T3.city , T3.state_province FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id", "question": "What are the full names, departments, cities, and state provinces for each employee?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T1.first_name , T1.last_name , T3.city FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T1.first_name LIKE '%z%'", "question": "display those employees who contain a letter z to their first name and also display their last name, city.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T1.first_name , T1.last_name , T3.city FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T1.first_name LIKE '%z%'", "question": "What are the full names and cities of employees who have the letter Z in their first names?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T1.department_name , T2.city , T2.state_province FROM departments AS T1 JOIN locations AS T2 ON T2.location_id = T1.location_id", "question": "display the department name, city, and state province for each department.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T1.department_name , T2.city , T2.state_province FROM departments AS T1 JOIN locations AS T2 ON T2.location_id = T1.location_id", "question": "What are the department names, cities, and state provinces for each department?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T1.first_name , T1.last_name , T1.employee_id , T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id", "question": "display the full name (first and last name ) of employee with ID and name of the country presently where (s)he is working.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT T1.first_name , T1.last_name , T1.employee_id , T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id", "question": "What the full names, ids of each employee and the name of the country they are in?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT department_name , COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY department_name", "question": "display the department name and number of employees in each of the department.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT department_name , COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY department_name", "question": "What are the department names and how many employees work in each of them?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , salary FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T3.city = 'London'", "question": "display the full name (first and last name), and salary of those employees who working in any department located in London.", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT first_name , last_name , salary FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T3.city = 'London'", "question": "What are full names and salaries of employees working in the city of London?", "schema": "regions: REGION_ID (DECIMAL(50)), REGION_NAME (VARCHAR(25))\ncountries: COUNTRY_ID (VARCHAR(2)), COUNTRY_NAME (VARCHAR(40)), REGION_ID (DECIMAL(100))\ndepartments: DEPARTMENT_NAME (VARCHAR(30)), MANAGER_ID (DECIMAL(60)), LOCATION_ID (DECIMAL(40))\njobs: JOB_TITLE (VARCHAR(35)), MIN_SALARY (DECIMAL(60)), MAX_SALARY (DECIMAL(60))\nemployees: FIRST_NAME (VARCHAR(20)), LAST_NAME (VARCHAR(25)), EMAIL (VARCHAR(25)), PHONE_NUMBER (VARCHAR(20)), HIRE_DATE (DATE), JOB_ID (VARCHAR(10)), SALARY (DECIMAL(82)), COMMISSION_PCT (DECIMAL(22)), MANAGER_ID (DECIMAL(60)), DEPARTMENT_ID (DECIMAL(40))\njob_history: EMPLOYEE_ID (DECIMAL(60)), START_DATE (DATE), END_DATE (DATE), JOB_ID (VARCHAR(10)), DEPARTMENT_ID (DECIMAL(40))\nlocations: STREET_ADDRESS (VARCHAR(40)), POSTAL_CODE (VARCHAR(12)), CITY (VARCHAR(30)), STATE_PROVINCE (VARCHAR(25)), COUNTRY_ID (VARCHAR(2))" }, { "query": "SELECT song_name , releasedate FROM song ORDER BY releasedate DESC LIMIT 1", "question": "What is the name of the song that was released in the most recent year?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT song_name , releasedate FROM song ORDER BY releasedate DESC LIMIT 1", "question": "What is the name of the song that was released most recently?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT f_id FROM files ORDER BY duration DESC LIMIT 1", "question": "What is the id of the longest song?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT f_id FROM files ORDER BY duration DESC LIMIT 1", "question": "Find the id of the song that lasts the longest.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT song_name FROM song WHERE languages = \"english\"", "question": "Find the names of all English songs.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT song_name FROM song WHERE languages = \"english\"", "question": "What are the names of all songs in English?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT f_id FROM files WHERE formats = \"mp3\"", "question": "What are the id of songs whose format is mp3.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT f_id FROM files WHERE formats = \"mp3\"", "question": "What are the id of all the files in mp3 format?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT DISTINCT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.rating > 9", "question": "List the name and country of origin for all singers who have produced songs with rating above 9.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT DISTINCT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.rating > 9", "question": "What are the different names and countries of origins for all artists whose song ratings are above 9?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT DISTINCT T1.file_size , T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution < 800", "question": "List the file size and format for all songs that have resolution lower than 800.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT DISTINCT T1.file_size , T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution < 800", "question": "What are the file sizes and formats for all songs with a resolution lower than 800?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id = T2.f_id ORDER BY T2.duration LIMIT 1", "question": "What is the name of the artist who produced the shortest song?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id = T2.f_id ORDER BY T2.duration LIMIT 1", "question": "What are the names of the artists who sang the shortest song?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating DESC LIMIT 3", "question": "What are the names and countries of origin for the artists who produced the top three highly rated songs.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating DESC LIMIT 3", "question": "What are the names of the singers who sang the top 3 most highly rated songs and what countries do they hail from?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT count(*) FROM files WHERE duration LIKE \"4:%\"", "question": "How many songs have 4 minute duration?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT count(*) FROM files WHERE duration LIKE \"4:%\"", "question": "What is the count of the songs that last approximately 4 minutes?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT count(*) FROM artist WHERE country = \"Bangladesh\"", "question": "How many artists are from Bangladesh?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT count(*) FROM artist WHERE country = \"Bangladesh\"", "question": "How many Bangladeshi artists are listed?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT avg(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = \"Female\"", "question": "What is the average rating of songs produced by female artists?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT avg(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = \"Female\"", "question": "How many songs, on average, are sung by a female artist?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT formats FROM files GROUP BY formats ORDER BY COUNT (*) DESC LIMIT 1", "question": "What is the most popular file format?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT formats FROM files GROUP BY formats ORDER BY COUNT (*) DESC LIMIT 1", "question": "Find the file format that is used by the most files.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT artist_name FROM artist WHERE country = \"UK\" INTERSECT SELECT artist_name FROM song WHERE languages = \"english\"", "question": "Find the names of the artists who are from UK and have produced English songs.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT artist_name FROM artist WHERE country = \"UK\" INTERSECT SELECT artist_name FROM song WHERE languages = \"english\"", "question": "What are the names of the artists that are from the UK and sang songs in English?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT f_id FROM files WHERE formats = \"mp4\" INTERSECT SELECT f_id FROM song WHERE resolution < 1000", "question": "Find the id of songs that are available in mp4 format and have resolution lower than 1000.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT f_id FROM files WHERE formats = \"mp4\" INTERSECT SELECT f_id FROM song WHERE resolution < 1000", "question": "What is the id of the files that are available in the format of mp4 and a resolution smaller than 1000?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = \"Female\" AND T2.languages = \"bangla\"", "question": "What is the country of origin of the artist who is female and produced a song in Bangla?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = \"Female\" AND T2.languages = \"bangla\"", "question": "What countries are the female artists who sung in the language Bangla from?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT avg(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = \"mp3\" AND T2.resolution < 800", "question": "What is the average duration of songs that have mp3 format and resolution below 800?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT avg(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = \"mp3\" AND T2.resolution < 800", "question": "What is the average song duration for the songs that are in mp3 format and whose resolution below 800?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT count(*) , gender FROM artist GROUP BY gender", "question": "What is the number of artists for each gender?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT count(*) , gender FROM artist GROUP BY gender", "question": "How many artists are male and how many are female?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT avg(rating) , languages FROM song GROUP BY languages", "question": "What is the average rating of songs for each language?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT avg(rating) , languages FROM song GROUP BY languages", "question": "What is the average song rating for each language?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.gender , T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.resolution LIMIT 1", "question": "Return the gender and name of artist who produced the song with the lowest resolution.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.gender , T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.resolution LIMIT 1", "question": "What is the gender and name of the artist who sang the song with the smallest resolution?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT count(*) , formats FROM files GROUP BY formats", "question": "For each file format, return the number of artists who released songs in that format.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT count(*) , formats FROM files GROUP BY formats", "question": "How many songs were released for each format?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT DISTINCT song_name FROM song WHERE resolution > (SELECT min(resolution) FROM song WHERE languages = \"english\")", "question": "Find the distinct names of all songs that have a higher resolution than some songs in English.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT DISTINCT song_name FROM song WHERE resolution > (SELECT min(resolution) FROM song WHERE languages = \"english\")", "question": "What are the different names for all songs that have a higher resolution than English songs?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT song_name FROM song WHERE rating < (SELECT max(rating) FROM song WHERE genre_is = \"blues\")", "question": "What are the names of all songs that have a lower rating than some song of blues genre?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT song_name FROM song WHERE rating < (SELECT max(rating) FROM song WHERE genre_is = \"blues\")", "question": "What are the names of the songs that have a lower rating than at least one blues song?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE \"%love%\"", "question": "What is the name and country of origin of the artist who released a song that has \"love\" in its title?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE \"%love%\"", "question": "What are the names of the artists who released a song that has the word love in its title, and where are the artists from?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name , T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.releasedate LIKE \"%Mar%\"", "question": "List the name and gender for all artists who released songs in March.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name , T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.releasedate LIKE \"%Mar%\"", "question": "What are the names and genders of all artists who released songs in the month of March?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT g_name , rating FROM genre ORDER BY g_name", "question": "List the names of all genres in alphabetical oder, together with its ratings.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT g_name , rating FROM genre ORDER BY g_name", "question": "What are the names of all genres in alphabetical order, combined with its ratings?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT song_name FROM song ORDER BY resolution", "question": "Give me a list of the names of all songs ordered by their resolution.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT song_name FROM song ORDER BY resolution", "question": "What are the names of all songs that are ordered by their resolution numbers?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT f_id FROM files WHERE formats = \"mp4\" UNION SELECT f_id FROM song WHERE resolution > 720", "question": "What are the ids of songs that are available in either mp4 format or have resolution above 720?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT f_id FROM files WHERE formats = \"mp4\" UNION SELECT f_id FROM song WHERE resolution > 720", "question": "What are the ids of all songs that are available on mp4 or have a higher resolution than 720?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE \"4:%\" UNION SELECT song_name FROM song WHERE languages = \"english\"", "question": "List the names of all songs that have 4 minute duration or are in English.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE \"4:%\" UNION SELECT song_name FROM song WHERE languages = \"english\"", "question": "What are the names of all songs that are approximately 4 minutes long or are in English?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT languages FROM song GROUP BY languages ORDER BY count(*) DESC LIMIT 1", "question": "What is the language used most often in the songs?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT languages FROM song GROUP BY languages ORDER BY count(*) DESC LIMIT 1", "question": "What are the languages that are used most often in songs?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT artist_name FROM song WHERE resolution > 500 GROUP BY languages ORDER BY count(*) DESC LIMIT 1", "question": "What is the language that was used most often in songs with resolution above 500?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT artist_name FROM song WHERE resolution > 500 GROUP BY languages ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of the artist, for each language, that has the most songs with a higher resolution than 500?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT artist_name FROM artist WHERE country = \"UK\" AND gender = \"Male\"", "question": "What are the names of artists who are Male and are from UK?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT artist_name FROM artist WHERE country = \"UK\" AND gender = \"Male\"", "question": "What are the names of all male British artists?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT song_name FROM song WHERE genre_is = \"modern\" OR languages = \"english\"", "question": "Find the names of songs whose genre is modern or language is English.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT song_name FROM song WHERE genre_is = \"modern\" OR languages = \"english\"", "question": "What are the names of the songs that are modern or sung in English?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = \"mp3\" INTERSECT SELECT song_name FROM song WHERE resolution < 1000", "question": "Return the names of songs for which format is mp3 and resolution is below 1000.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = \"mp3\" INTERSECT SELECT song_name FROM song WHERE resolution < 1000", "question": "What are the names of all songs that are in mp3 format and have a resolution lower than 1000?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT artist_name FROM artist WHERE country = \"UK\" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = \"english\"", "question": "Return the names of singers who are from UK and released an English song.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT artist_name FROM artist WHERE country = \"UK\" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = \"english\"", "question": "What are the names of all singers that are from the UK and released a song in English?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT avg(rating) , avg(resolution) FROM song WHERE languages = \"bangla\"", "question": "What are the average rating and resolution of songs that are in Bangla?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT avg(rating) , avg(resolution) FROM song WHERE languages = \"bangla\"", "question": "What is the average rating and resolution of all bangla songs?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT max(T2.resolution) , min(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE \"3:%\"", "question": "What are the maximum and minimum resolution of songs whose duration is 3 minutes?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT max(T2.resolution) , min(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE \"3:%\"", "question": "What is the maximum and minimum resolution of all songs that are approximately 3 minutes long?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT max(T1.duration) , max(T2.resolution) , T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.languages ORDER BY T2.languages", "question": "What are the maximum duration and resolution of songs grouped and ordered by languages?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT max(T1.duration) , max(T2.resolution) , T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.languages ORDER BY T2.languages", "question": "What are the maximum duration and resolution of all songs, for each language, ordered alphabetically by language?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT min(T1.duration) , min(T2.rating) , T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is", "question": "What are the shortest duration and lowest rating of songs grouped by genre and ordered by genre?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT min(T1.duration) , min(T2.rating) , T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is", "question": "What is the shortest and most poorly rated song for each genre, ordered alphabetically by genre?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name , count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = \"english\" GROUP BY T2.artist_name HAVING count(*) >= 1", "question": "Find the names and number of works of all artists who have at least one English songs.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name , count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = \"english\" GROUP BY T2.artist_name HAVING count(*) >= 1", "question": "What are the names and number of works for all artists who have sung at least one song in English?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.resolution > 900 GROUP BY T2.artist_name HAVING count(*) >= 1", "question": "Find the name and country of origin for all artists who have release at least one song of resolution above 900.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.resolution > 900 GROUP BY T2.artist_name HAVING count(*) >= 1", "question": "What is the name and country of origin for each artist who has released a song with a resolution higher than 900?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name , count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3", "question": "Find the names and number of works of the three artists who have produced the most songs.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name , count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3", "question": "What are the names of the three artists who have produced the most songs, and how many works did they produce?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) LIMIT 1", "question": "Find the country of origin for the artist who made the least number of songs?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) LIMIT 1", "question": "What country is the artist who made the fewest songs from?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT song_name FROM song WHERE rating < (SELECT min(rating) FROM song WHERE languages = 'english')", "question": "What are the names of the songs whose rating is below the rating of all songs in English?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT song_name FROM song WHERE rating < (SELECT min(rating) FROM song WHERE languages = 'english')", "question": "What are the song names for every song whose rating is less than the minimum rating for English songs?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT f_id FROM song WHERE resolution > (SELECT max(resolution) FROM song WHERE rating < 8)", "question": "What is ids of the songs whose resolution is higher than the resolution of any songs with rating lower than 8?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT f_id FROM song WHERE resolution > (SELECT max(resolution) FROM song WHERE rating < 8)", "question": "What is the id of every song that has a resolution higher than that of a song with a rating below 8?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT f_id FROM song WHERE resolution > (SELECT avg(resolution) FROM song WHERE genre_is = \"modern\")", "question": "What is ids of the songs whose resolution is higher than the average resolution of songs in modern genre?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT f_id FROM song WHERE resolution > (SELECT avg(resolution) FROM song WHERE genre_is = \"modern\")", "question": "What are the ids of all songs that have higher resolution of the average resolution in the modern genre?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = \"bangla\" GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3", "question": "Find the top 3 artists who have the largest number of songs works whose language is Bangla.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = \"bangla\" GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3", "question": "What are the top 3 artists with the largest number of songs in the language Bangla?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT f_id , genre_is , artist_name FROM song WHERE languages = \"english\" ORDER BY rating", "question": "List the id, genre and artist name of English songs ordered by rating.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT f_id , genre_is , artist_name FROM song WHERE languages = \"english\" ORDER BY rating", "question": "What is the id, genre, and name of the artist for every English song ordered by ascending rating?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.duration , T1.file_size , T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.genre_is = \"pop\" ORDER BY T2.song_name", "question": "List the duration, file size and format of songs whose genre is pop, ordered by title?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.duration , T1.file_size , T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.genre_is = \"pop\" ORDER BY T2.song_name", "question": "What is the duration, file size, and song format for every pop song, ordered by title alphabetically?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT DISTINCT artist_name FROM song WHERE languages = \"english\" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 8", "question": "Find the names of the artists who have produced English songs but have never received rating higher than 8.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT DISTINCT artist_name FROM song WHERE languages = \"english\" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 8", "question": "What are the names of the different artists that have produced a song in English but have never receieved a rating higher than 8?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT DISTINCT artist_name FROM artist WHERE country = \"Bangladesh\" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7", "question": "Find the names of the artists who are from Bangladesh and have never received rating higher than 7.", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT DISTINCT artist_name FROM artist WHERE country = \"Bangladesh\" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7", "question": "What are the names of the different artists from Bangladesh who never received a rating higher than a 7?", "schema": "genre(: g_name (VARCHAR2(20)), rating (VARCHAR2(10)), most_popular_in (VARCHAR2(50))\nartist(: artist_name (VARCHAR2(50)), country (VARCHAR2(20)), gender (VARCHAR2(20)), preferred_genre (VARCHAR2(50)), constraint (A_NAME)\nfiles(: f_id (NUMBER(10)), artist_name (VARCHAR2(50)), file_size (VARCHAR2(20)), duration (VARCHAR2(20)), formats (VARCHAR2(20))\nsong(: song_name (VARCHAR2(50)), artist_name (VARCHAR2(50)), country (VARCHAR2(20)), f_id (NUMBER(10)), genre_is (VARCHAR2(20)), rating (NUMBER(10)), languages (VARCHAR2(20)), releasedate (DATE), resolution (NUMBER(10)), constraint (S_NAME)" }, { "query": "SELECT T1.name_full , T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.college_id = T2.college_id GROUP BY T1.college_id ORDER BY count(*) DESC LIMIT 1;", "question": "what is the full name and id of the college with the largest number of baseball players?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T1.name_full , T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.college_id = T2.college_id GROUP BY T1.college_id ORDER BY count(*) DESC LIMIT 1;", "question": "Find the full name and id of the college that has the most baseball players.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT avg(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'", "question": "What is average salary of the players in the team named 'Boston Red Stockings' ?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT avg(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'", "question": "Compute the average salary of the players in the team called 'Boston Red Stockings'.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT name_first , name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id WHERE YEAR = 1998", "question": "What are first and last names of players participating in all star game in 1998?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT name_first , name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id WHERE YEAR = 1998", "question": "List the first and last name for players who participated in all star game in 1998.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T1.name_first , T1.name_last , T1.player_id , count(*) FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY count(*) DESC LIMIT 1;", "question": "What are the first name, last name and id of the player with the most all star game experiences? Also list the count.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T1.name_first , T1.name_last , T1.player_id , count(*) FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY count(*) DESC LIMIT 1;", "question": "Which player has the most all star game experiences? Give me the first name, last name and id of the player, as well as the number of times the player participated in all star game.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT yearid , count(*) FROM hall_of_fame GROUP BY yearid;", "question": "How many players enter hall of fame each year?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT yearid , count(*) FROM hall_of_fame GROUP BY yearid;", "question": "Count the number of players who enter hall of fame for each year.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT YEAR , avg(attendance) FROM home_game GROUP BY YEAR;", "question": "What is the average number of attendance at home games for each year?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT YEAR , avg(attendance) FROM home_game GROUP BY YEAR;", "question": "For each year, return the year and the average number of attendance at home games.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T2.team_id , T2.rank FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id WHERE T1.year = 2014 GROUP BY T1.team_id ORDER BY avg(T1.attendance) DESC LIMIT 1;", "question": "In 2014, what are the id and rank of the team that has the largest average number of attendance?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T2.team_id , T2.rank FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id WHERE T1.year = 2014 GROUP BY T1.team_id ORDER BY avg(T1.attendance) DESC LIMIT 1;", "question": "Find the id and rank of the team that has the highest average attendance rate in 2014.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T1.name_first , T1.name_last , T2.player_id FROM player AS T1 JOIN manager_award AS T2 ON T1.player_id = T2.player_id GROUP BY T2.player_id ORDER BY count(*) DESC LIMIT 1;", "question": "What are the manager's first name, last name and id who won the most manager award?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T1.name_first , T1.name_last , T2.player_id FROM player AS T1 JOIN manager_award AS T2 ON T1.player_id = T2.player_id GROUP BY T2.player_id ORDER BY count(*) DESC LIMIT 1;", "question": "Which manager won the most manager award? Give me the manager's first name, last name and id.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM park WHERE state = 'NY';", "question": "How many parks are there in the state of NY?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM park WHERE state = 'NY';", "question": "Show me the number of parks the state of NY has.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T1.name_first , T1.name_last , T1.player_id FROM player AS T1 JOIN player_award AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY count(*) DESC LIMIT 3;", "question": "Which 3 players won the most player awards? List their full name and id.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T1.name_first , T1.name_last , T1.player_id FROM player AS T1 JOIN player_award AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY count(*) DESC LIMIT 3;", "question": "Find the first name, last name and id for the top three players won the most player awards.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT birth_country FROM player GROUP BY birth_country ORDER BY count(*) ASC LIMIT 3;", "question": "List three countries which are the origins of the least players.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT birth_country FROM player GROUP BY birth_country ORDER BY count(*) ASC LIMIT 3;", "question": "What are the three countries that the least players are from?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT name_first , name_last FROM player WHERE death_year = '';", "question": "Find all the players' first name and last name who have empty death record.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT name_first , name_last FROM player WHERE death_year = '';", "question": "What are the first name and last name of the players whose death record is empty?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM player WHERE birth_country = 'USA' AND bats = 'R';", "question": "How many players born in USA are right-handed batters? That is, have the batter value 'R'.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM player WHERE birth_country = 'USA' AND bats = 'R';", "question": "Count the number of players who were born in USA and have bats information 'R'.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT avg(T1.height) FROM player AS T1 JOIN player_college AS T2 ON T1.player_id = T2.player_id JOIN college AS T3 ON T3.college_id = T2.college_id WHERE T3.name_full = 'Yale University';", "question": "What is the average height of the players from the college named 'Yale University'?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT avg(T1.height) FROM player AS T1 JOIN player_college AS T2 ON T1.player_id = T2.player_id JOIN college AS T3 ON T3.college_id = T2.college_id WHERE T3.name_full = 'Yale University';", "question": "Find the average height of the players who belong to the college called 'Yale University'.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T1.name , T1.team_id , max(T2.salary) FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id;", "question": "What is the highest salary among each team? List the team name, id and maximum salary.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T1.name , T1.team_id , max(T2.salary) FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id;", "question": "For each team, return the team name, id and the maximum salary among the team.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T1.name , T1.team_id FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id ORDER BY avg(T2.salary) ASC LIMIT 1;", "question": "What are the name and id of the team offering the lowest average salary?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T1.name , T1.team_id FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id ORDER BY avg(T2.salary) ASC LIMIT 1;", "question": "Which team offers the lowest average salary? Give me the name and id of the team.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T1.name_first , T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1960 INTERSECT SELECT T1.name_first , T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1961", "question": "Find the players' first name and last name who won award both in 1960 and in 1961.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T1.name_first , T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1960 INTERSECT SELECT T1.name_first , T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1961", "question": "Which players won awards in both 1960 and 1961? Return their first names and last names.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT name_first , name_last FROM player WHERE weight > 220 OR height < 75", "question": "List players' first name and last name who have weight greater than 220 or height shorter than 75.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT name_first , name_last FROM player WHERE weight > 220 OR height < 75", "question": "What are the first name and last name of the players who have weight above 220 or height below 75?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT max(T1.wins) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings';", "question": "List the maximum scores of the team Boston Red Stockings when the team won in postseason?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT max(T1.wins) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings';", "question": "What are the maximum scores the team Boston Red Stockings got when the team won in postseason?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2009;", "question": "How many times did Boston Red Stockings lose in 2009 postseason?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2009;", "question": "Count the number of times the team \"Boston Red Stockings\" lost in 2009 postseason.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T2.name , T1.team_id_winner FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T1.year = 2008 GROUP BY T1.team_id_winner ORDER BY count(*) DESC LIMIT 1;", "question": "What are the name and id of the team with the most victories in 2008 postseason?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T2.name , T1.team_id_winner FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T1.year = 2008 GROUP BY T1.team_id_winner ORDER BY count(*) DESC LIMIT 1;", "question": "Find the name and id of the team that won the most times in 2008 postseason.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) , T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year", "question": "What is the number of wins the team Boston Red Stockings got in the postseasons each year in history?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) , T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year", "question": "For each year, return the year and the number of times the team Boston Red Stockings won in the postseasons.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM ( SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' UNION SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' );", "question": "What is the total number of postseason games that team Boston Red Stockings participated in?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM ( SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' UNION SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' );", "question": "How many times in total did the team Boston Red Stockings participate in postseason games?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM postseason WHERE YEAR = 1885 AND ties = 1;", "question": "How many games in 1885 postseason resulted in ties (that is, the value of \"ties\" is '1')?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM postseason WHERE YEAR = 1885 AND ties = 1;", "question": "Find the number of tied games (the value of \"ties\" is '1') in 1885 postseason.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT sum(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2010", "question": "What is the total salary paid by team Boston Red Stockings in 2010?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT sum(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2010", "question": "What is the total salary expenses of team Boston Red Stockings in 2010?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2000", "question": "How many players were in the team Boston Red Stockings in 2000?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2000", "question": "How many players did Boston Red Stockings have in 2000?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT salary FROM salary WHERE YEAR = 2001 ORDER BY salary DESC LIMIT 3;", "question": "List the 3 highest salaries of the players in 2001?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT salary FROM salary WHERE YEAR = 2001 ORDER BY salary DESC LIMIT 3;", "question": "How much salary did the top 3 well-paid players get in 2001?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT salary FROM salary WHERE YEAR = 2010 UNION SELECT salary FROM salary WHERE YEAR = 2001", "question": "What were all the salary values of players in 2010 and 2001?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT salary FROM salary WHERE YEAR = 2010 UNION SELECT salary FROM salary WHERE YEAR = 2001", "question": "List all the salary values players received in 2010 and 2001.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY count(*) ASC LIMIT 1;", "question": "In which year did the least people enter hall of fame?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY count(*) ASC LIMIT 1;", "question": "Find the year in which the least people enter hall of fame.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM park WHERE city = 'Atlanta';", "question": "How many parks are there in Atlanta city?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM park WHERE city = 'Atlanta';", "question": "How many parks does Atlanta city have?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 1907 AND T2.park_name = 'Columbia Park';", "question": "How many games were played in park \"Columbia Park\" in 1907?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 1907 AND T2.park_name = 'Columbia Park';", "question": "Count the number of games taken place in park \"Columbia Park\" in 1907.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2000 AND T2.city = 'Atlanta';", "question": "How many games were played in city Atlanta in 2000?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2000 AND T2.city = 'Atlanta';", "question": "Find the number of games taken place in city Atlanta in 2000.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT sum(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 2000 AND 2010;", "question": "What is the total home game attendance of team Boston Red Stockings from 2000 to 2010?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT sum(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 2000 AND 2010;", "question": "How many games in total did team Boston Red Stockings attend from 2000 to 2010?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT sum(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first = 'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990;", "question": "How much did the the player with first name Len and last name Barker earn between 1985 to 1990 in total?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT sum(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first = 'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990;", "question": "Compute the total salary that the player with first name Len and last name Barker received between 1985 to 1990.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T2.name_first , T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first , T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'", "question": "List players' first name and last name who received salary from team Washington Nationals in both 2005 and 2007.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T2.name_first , T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first , T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'", "question": "What are the first name and last name of the players who were paid salary by team Washington Nationals in both 2005 and 2007?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT sum(T1.games) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 1990 AND 2000;", "question": "How many home games did the team Boston Red Stockings play from 1990 to 2000 in total?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT sum(T1.games) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 1990 AND 2000;", "question": "Count the total number of games the team Boston Red Stockings attended from 1990 to 2000.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T1.year = 1980 ORDER BY T1.attendance ASC LIMIT 1;", "question": "Which team had the least number of attendances in home games in 1980?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T1.year = 1980 ORDER BY T1.attendance ASC LIMIT 1;", "question": "Find the team that attended the least number of home games in 1980.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT state FROM park GROUP BY state HAVING count(*) > 2;", "question": "List the names of states that have more than 2 parks.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT state FROM park GROUP BY state HAVING count(*) > 2;", "question": "Which states have more than 2 parks?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM team_franchise WHERE active = 'Y';", "question": "How many team franchises are active, with active value 'Y'?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM team_franchise WHERE active = 'Y';", "question": "Find the number of team franchises that are active (have 'Y' as \"active\" information).", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT city FROM park GROUP BY city HAVING count(*) BETWEEN 2 AND 4;", "question": "Which cities have 2 to 4 parks?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT city FROM park GROUP BY city HAVING count(*) BETWEEN 2 AND 4;", "question": "Find all the cities that have 2 to 4 parks.", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T2.park_name FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2008 ORDER BY T1.attendance DESC LIMIT 1;", "question": "Which park had most attendances in 2008?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT T2.park_name FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2008 ORDER BY T1.attendance DESC LIMIT 1;", "question": "Which park did the most people attend in 2008?", "schema": "all_star: player_id (TEXT), year (INTEGER), game_num (INTEGER), game_id (TEXT), team_id (TEXT), league_id (TEXT), gp (NUMERIC), starting_pos (NUMERIC)\nappearances: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), g_all (NUMERIC), gs (NUMERIC), g_batting (INTEGER), g_defense (NUMERIC), g_p (INTEGER), g_c (INTEGER), g_1b (INTEGER), g_2b (INTEGER), g_3b (INTEGER), g_ss (INTEGER), g_lf (INTEGER), g_cf (INTEGER), g_rf (INTEGER), g_of (INTEGER), g_dh (NUMERIC), g_ph (NUMERIC), g_pr (NUMERIC)\nmanager_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (NUMERIC)\nplayer_award: player_id (TEXT), award_id (TEXT), year (INTEGER), league_id (TEXT), tie (TEXT), notes (TEXT)\nmanager_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (INTEGER), points_max (INTEGER), votes_first (INTEGER)\nplayer_award_vote: award_id (TEXT), year (INTEGER), league_id (TEXT), player_id (TEXT), points_won (NUMERIC), points_max (INTEGER), votes_first (NUMERIC)\nbatting: r (NUMERIC), h (NUMERIC), double (NUMERIC), triple (NUMERIC), hr (NUMERIC), rbi (NUMERIC), sb (NUMERIC), cs (NUMERIC), bb (NUMERIC), so (NUMERIC), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nbatting_postseason: year (INTEGER), round (TEXT), player_id (TEXT), team_id (TEXT), league_id (TEXT), g (INTEGER), ab (INTEGER), r (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), rbi (INTEGER), sb (INTEGER), cs (NUMERIC), bb (INTEGER), so (INTEGER), ibb (NUMERIC), hbp (NUMERIC), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nplayer_college: college_id (TEXT), year (INTEGER)\nfielding: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (NUMERIC), a (NUMERIC), e (NUMERIC), dp (NUMERIC), pb (NUMERIC), wp (NUMERIC), sb (NUMERIC), cs (NUMERIC), zr (NUMERIC)\nfielding_outfield: player_id (TEXT), year (INTEGER), stint (INTEGER), glf (NUMERIC), gcf (NUMERIC), grf (NUMERIC)\nfielding_postseason: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), round (TEXT), pos (TEXT), g (INTEGER), gs (NUMERIC), inn_outs (NUMERIC), po (INTEGER), a (INTEGER), e (INTEGER), dp (INTEGER), tp (INTEGER), pb (NUMERIC), sb (NUMERIC), cs (NUMERIC)\nhall_of_fame: player_id (TEXT), yearid (INTEGER), votedby (TEXT), ballots (NUMERIC), needed (NUMERIC), votes (NUMERIC), inducted (TEXT), category (TEXT), needed_note (TEXT)\nhome_game: year (INTEGER), league_id (TEXT), team_id (TEXT), park_id (TEXT), span_first (TEXT), span_last (TEXT), games (INTEGER), openings (INTEGER), attendance (INTEGER)\nmanager: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (NUMERIC), plyr_mgr (TEXT)\nmanager_half: player_id (TEXT), year (INTEGER), team_id (TEXT), league_id (TEXT), inseason (INTEGER), half (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER), rank (INTEGER)\nplayer: player_id (TEXT), birth_year (NUMERIC), birth_month (NUMERIC), birth_day (NUMERIC), birth_country (TEXT), birth_state (TEXT), birth_city (TEXT), death_year (NUMERIC), death_month (NUMERIC), death_day (NUMERIC), death_country (TEXT), death_state (TEXT), death_city (TEXT), name_first (TEXT), name_last (TEXT), name_given (TEXT), weight (NUMERIC), height (NUMERIC), bats (TEXT), throws (TEXT), debut (TEXT), final_game (TEXT), retro_id (TEXT), bbref_id (TEXT)\npark: park_id (TEXT), park_name (TEXT), park_alias (TEXT), city (TEXT), state (TEXT), country (TEXT)\npitching: player_id (TEXT), year (INTEGER), stint (INTEGER), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (NUMERIC), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (NUMERIC), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (INTEGER), bfp (NUMERIC), gf (NUMERIC), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\npitching_postseason: player_id (TEXT), year (INTEGER), round (TEXT), team_id (TEXT), league_id (TEXT), w (INTEGER), l (INTEGER), g (INTEGER), gs (INTEGER), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), h (INTEGER), er (INTEGER), hr (INTEGER), bb (INTEGER), so (INTEGER), baopp (TEXT), era (NUMERIC), ibb (NUMERIC), wp (NUMERIC), hbp (NUMERIC), bk (NUMERIC), bfp (NUMERIC), gf (INTEGER), r (INTEGER), sh (NUMERIC), sf (NUMERIC), g_idp (NUMERIC)\nsalary: year (INTEGER), team_id (TEXT), league_id (TEXT), player_id (TEXT), salary (INTEGER)\ncollege: college_id (TEXT), name_full (TEXT), city (TEXT), state (TEXT), country (TEXT)\npostseason: year (INTEGER), round (TEXT), team_id_winner (TEXT), league_id_winner (TEXT), team_id_loser (TEXT), league_id_loser (TEXT), wins (INTEGER), losses (INTEGER), ties (INTEGER)\nteam: year (INTEGER), league_id (TEXT), team_id (TEXT), franchise_id (TEXT), div_id (TEXT), rank (INTEGER), g (INTEGER), ghome (NUMERIC), w (INTEGER), l (INTEGER), div_win (TEXT), wc_win (TEXT), lg_win (TEXT), ws_win (TEXT), r (INTEGER), ab (INTEGER), h (INTEGER), double (INTEGER), triple (INTEGER), hr (INTEGER), bb (INTEGER), so (NUMERIC), sb (NUMERIC), cs (NUMERIC), hbp (NUMERIC), sf (NUMERIC), ra (INTEGER), er (INTEGER), era (NUMERIC), cg (INTEGER), sho (INTEGER), sv (INTEGER), ipouts (INTEGER), ha (INTEGER), hra (INTEGER), bba (INTEGER), soa (INTEGER), e (INTEGER), dp (NUMERIC), fp (NUMERIC), name (TEXT), park (TEXT), attendance (NUMERIC), bpf (INTEGER), ppf (INTEGER), team_id_br (TEXT), team_id_lahman45 (TEXT), team_id_retro (TEXT)\nteam_franchise: franchise_id (TEXT), franchise_name (TEXT), active (TEXT), na_assoc (TEXT)\nteam_half: year (INTEGER), league_id (TEXT), team_id (TEXT), half (INTEGER), div_id (TEXT), div_win (TEXT), rank (INTEGER), g (INTEGER), w (INTEGER), l (INTEGER)" }, { "query": "SELECT count(*) FROM camera_lens WHERE focal_length_mm > 15", "question": "How many camera lenses have a focal length longer than 15 mm?", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT brand , name FROM camera_lens ORDER BY max_aperture DESC", "question": "Find the brand and name for each camera lens, and sort in descending order of maximum aperture.", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT id , color , name FROM photos", "question": "List the id, color scheme, and name for all the photos.", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT max(height) , avg(height) FROM mountain", "question": "What are the maximum and average height of the mountains?", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT avg(prominence) FROM mountain WHERE country = 'Morocco'", "question": "What are the average prominence of the mountains in country 'Morocco'?", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT name , height , prominence FROM mountain WHERE range != 'Aberdare Range'", "question": "What are the name, height and prominence of mountains which do not belong to the range 'Aberdare Range'?", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT T1.id , T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.height > 4000", "question": "What are the id and name of the photos for mountains?", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT T1.id , T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id GROUP BY T1.id HAVING count(*) >= 2", "question": "What are the id and name of the mountains that have at least 2 photos?", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT T2.name FROM photos AS T1 JOIN camera_lens AS T2 ON T1.camera_lens_id = T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1", "question": "What are the names of the cameras that have taken picture of the most mountains?", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT T1.name FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus'", "question": "What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'?", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT count(DISTINCT brand) FROM camera_lens", "question": "How many different kinds of lens brands are there?", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT count(*) FROM camera_lens WHERE id NOT IN ( SELECT camera_lens_id FROM photos )", "question": "How many camera lenses are not used in taking any photos?", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT count(DISTINCT T2.camera_lens_id) FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.country = 'Ethiopia'", "question": "How many distinct kinds of camera lenses are used to take photos of mountains in the country 'Ethiopia'?", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Toubkal Atlas' INTERSECT SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Lasta Massif'", "question": "List the brands of lenses that took both a picture of mountains with range 'Toubkal Atlas' and a picture of mountains with range 'Lasta Massif'", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT name , prominence FROM mountain EXCEPT SELECT T1.name , T1.prominence FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T3.brand = 'Sigma'", "question": "Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'.", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT name FROM camera_lens WHERE name LIKE \"%Digital%\"", "question": "List the camera lens names containing substring \"Digital\".", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT T1.name , count(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id = T2.camera_lens_id GROUP BY T1.id ORDER BY count(*)", "question": "What is the name of each camera lens and the number of photos taken by it? Order the result by the count of photos.", "schema": "mountain: id (INT), name (TEXT), Height (REAL), Prominence (REAL), Range (TEXT), Country (TEXT)\ncamera_lens: id (INT), brand (TEXT), name (TEXT), focal_length_mm (REAL), max_aperture (REAL)\nphotos: id (INT), camera_lens_id (INT), mountain_id (INT), color (TEXT), name (TEXT)" }, { "query": "SELECT name FROM channel WHERE OWNER != 'CCTV'", "question": "Find the names of channels that are not owned by CCTV.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT name FROM channel WHERE OWNER != 'CCTV'", "question": "Which channels are not owned by CCTV? Give me the channel names.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT name FROM channel ORDER BY rating_in_percent DESC", "question": "List all channel names ordered by their rating in percent from big to small.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT name FROM channel ORDER BY rating_in_percent DESC", "question": "Give me a list of all the channel names sorted by the channel rating in descending order.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1", "question": "What is the owner of the channel that has the highest rating ratio?", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1", "question": "Show me the owner of the channel with the highest rating.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT count(*) FROM program", "question": "how many programs are there?", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT count(*) FROM program", "question": "Count the number of programs.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT name FROM program ORDER BY launch", "question": "list all the names of programs, ordering by launch time.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT name FROM program ORDER BY launch", "question": "What is the list of program names, sorted by the order of launch date?", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT name , origin , OWNER FROM program", "question": "List the name, origin and owner of each program.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT name , origin , OWNER FROM program", "question": "What are the name, origin and owner of each program?", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT name FROM program ORDER BY launch DESC LIMIT 1", "question": "find the name of the program that was launched most recently.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT name FROM program ORDER BY launch DESC LIMIT 1", "question": "Which program was launched most recently? Return the program name.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT sum(Share_in_percent) FROM channel WHERE OWNER = 'CCTV'", "question": "find the total percentage share of all channels owned by CCTV.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT sum(Share_in_percent) FROM channel WHERE OWNER = 'CCTV'", "question": "What is the total share (in percent) of all the channels owned by CCTV?", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning'", "question": "Find the names of the channels that are broadcast in the morning.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning'", "question": "Which channels are broadcast in the morning? Give me the channel names.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning' INTERSECT SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Night'", "question": "what are the names of the channels that broadcast in both morning and night?", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning' INTERSECT SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Night'", "question": "Which channels broadcast both in the morning and at night? Give me the channel names.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT count(*) , time_of_day FROM broadcast GROUP BY time_of_day", "question": "how many programs are broadcast in each time section of the day?", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT count(*) , time_of_day FROM broadcast GROUP BY time_of_day", "question": "Count the number of programs broadcast for each time section of a day.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT count(DISTINCT program_id) FROM broadcast WHERE time_of_day = 'Night'", "question": "find the number of different programs that are broadcast during night time.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT count(DISTINCT program_id) FROM broadcast WHERE time_of_day = 'Night'", "question": "How many distinct programs are broadcast at \"Night\" time?", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT name FROM program EXCEPT SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = \"Morning\"", "question": "Find the names of programs that are never broadcasted in the morning.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT name FROM program EXCEPT SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = \"Morning\"", "question": "Which programs are never broadcasted in the morning? Give me the names of the programs.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = \"Morning\" INTERSECT SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = \"Night\"", "question": "find the program owners that have some programs in both morning and night time.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = \"Morning\" INTERSECT SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = \"Night\"", "question": "Who are the owners of the programs that broadcast both in the morning and at night?", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT origin FROM program ORDER BY origin", "question": "List all program origins in the alphabetical order.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT origin FROM program ORDER BY origin", "question": "What is the list of program origins ordered alphabetically?", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT count(DISTINCT OWNER) FROM channel", "question": "what is the number of different channel owners?", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT count(DISTINCT OWNER) FROM channel", "question": "Count the number of distinct channel owners.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT name FROM program WHERE origin != 'Beijing'", "question": "find the names of programs whose origin is not in Beijing.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT name FROM program WHERE origin != 'Beijing'", "question": "Which programs' origins are not \"Beijing\"? Give me the program names.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT name FROM channel WHERE OWNER = 'CCTV' OR OWNER = 'HBS'", "question": "What are the names of the channels owned by CCTV or HBS?", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT name FROM channel WHERE OWNER = 'CCTV' OR OWNER = 'HBS'", "question": "List the names of all the channels owned by either CCTV or HBS", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT sum(Rating_in_percent) , OWNER FROM channel GROUP BY OWNER", "question": "Find the total rating ratio for each channel owner.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT sum(Rating_in_percent) , OWNER FROM channel GROUP BY OWNER", "question": "What is the total rating of channel for each channel owner?", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id GROUP BY t2.program_id ORDER BY count(*) DESC LIMIT 1", "question": "Find the name of the program that is broadcast most frequently.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id GROUP BY t2.program_id ORDER BY count(*) DESC LIMIT 1", "question": "Which program is broadcast most frequently? Give me the program name.", "schema": "program: Program_ID (INT), Name (TEXT), Origin (TEXT), Launch (REAL), Owner (TEXT)\nchannel: Channel_ID (INT), Name (TEXT), Owner (TEXT), Share_in_percent (REAL), Rating_in_percent (REAL)\nbroadcast: Channel_ID (INT), Program_ID (INT), Time_of_day (TEXT)\nbroadcast_share: Channel_ID (INT), Program_ID (INT), Date (TEXT), Share_in_percent (REAL)" }, { "query": "SELECT count(*) FROM COURSES", "question": "How many courses are there in total?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT count(*) FROM COURSES", "question": "Find the total number of courses offered.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT course_description FROM COURSES WHERE course_name = \"database\"", "question": "What are the descriptions of the courses with name \"database\"?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT course_description FROM COURSES WHERE course_name = \"database\"", "question": "Return the description for the courses named \"database\".", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name\t = \"Cathrine\"", "question": "What are the addresses of the course authors or tutors with personal name \"Cathrine\"", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name\t = \"Cathrine\"", "question": "Return the addresses of the course authors or tutors whose personal name is \"Cathrine\".", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT address_line_1 FROM Course_Authors_and_Tutors", "question": "List the addresses of all the course authors or tutors.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT address_line_1 FROM Course_Authors_and_Tutors", "question": "What is the address of each course author or tutor?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT login_name , family_name FROM Course_Authors_and_Tutors", "question": "List all the login names and family names of course author and tutors.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT login_name , family_name FROM Course_Authors_and_Tutors", "question": "What are the login names and family names of course author and tutors?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT date_of_enrolment , date_of_completion FROM Student_Course_Enrolment", "question": "List all the dates of enrollment and completion of students.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT date_of_enrolment , date_of_completion FROM Student_Course_Enrolment", "question": "What are all the dates of enrollment and completion in record?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT count(DISTINCT student_id) FROM Student_Course_Enrolment", "question": "How many distinct students are enrolled in courses?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT count(DISTINCT student_id) FROM Student_Course_Enrolment", "question": "Find the number of distinct students enrolled in courses.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT count(course_id) FROM Student_Course_Enrolment", "question": "How many distinct courses are enrolled in by students?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT count(course_id) FROM Student_Course_Enrolment", "question": "Find the number of distinct courses that have enrolled students.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT date_test_taken FROM Student_Tests_Taken WHERE test_result = \"Pass\"", "question": "Find the dates of the tests taken with result \"Pass\".", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT date_test_taken FROM Student_Tests_Taken WHERE test_result = \"Pass\"", "question": "Which tests have \"Pass\" results? Return the dates when the tests were taken.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Student_Tests_Taken WHERE test_result = \"Fail\"", "question": "How many tests have result \"Fail\"?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Student_Tests_Taken WHERE test_result = \"Fail\"", "question": "Count the number of tests with \"Fail\" result.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT login_name FROM Students WHERE family_name = \"Ward\"", "question": "What are the login names of the students with family name \"Ward\"?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT login_name FROM Students WHERE family_name = \"Ward\"", "question": "Return the login names of the students whose family name is \"Ward\".", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT date_of_latest_logon FROM Students WHERE family_name = \"Jaskolski\" OR family_name = \"Langosh\"", "question": "What are the dates of the latest logon of the students with family name \"Jaskolski\" or \"Langosh\"?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT date_of_latest_logon FROM Students WHERE family_name = \"Jaskolski\" OR family_name = \"Langosh\"", "question": "Find the latest logon date of the students whose family name is \"Jaskolski\" or \"Langosh\".", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT COUNT(*) FROM Students WHERE personal_name LIKE \"%son%\"", "question": "How many students have personal names that contain the word \"son\"?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT COUNT(*) FROM Students WHERE personal_name LIKE \"%son%\"", "question": "Find the number of students who have the word \"son\" in their personal names.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT subject_name FROM SUBJECTS", "question": "List all the subject names.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT subject_name FROM SUBJECTS", "question": "What are the names of all the subjects.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_name", "question": "List all the information about course authors and tutors in alphabetical order of the personal name.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_name", "question": "Sort the information about course authors and tutors in alphabetical order of the personal name.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT personal_name , family_name FROM Students ORDER BY family_name", "question": "List the personal names and family names of all the students in alphabetical order of family name.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT personal_name , family_name FROM Students ORDER BY family_name", "question": "What are the personal names and family names of the students? Sort the result in alphabetical order of the family name.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT test_result , COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC", "question": "List each test result and its count in descending order of count.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT test_result , COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC", "question": "For each distinct test result, find the number of students who got the result.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = \"advanced database\"", "question": "Find the login name of the course author that teaches the course with name \"advanced database\".", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = \"advanced database\"", "question": "Which course author teaches the \"advanced database\" course? Give me his or her login name.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = \"operating system\" OR T2.course_name = \"data structure\"", "question": "Find the addresses of the course authors who teach the course with name \"operating system\" or \"data structure\".", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = \"operating system\" OR T2.course_name = \"data structure\"", "question": "What are the addresses of the course authors who teach either \"operating system\" or \"data structure\" course.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.personal_name , T1.family_name , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1", "question": "Find the personal name, family name, and author ID of the course author that teaches the most courses.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.personal_name , T1.family_name , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1", "question": "What are the personal name, family name, and author ID of the course author who teaches the most courses?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.address_line_1 , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING Count(*) >= 2", "question": "Find the addresses and author IDs of the course authors that teach at least two courses.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.address_line_1 , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING Count(*) >= 2", "question": "Which course authors teach two or more courses? Give me their addresses and author IDs.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = \"Julio\"", "question": "Find the names of courses taught by the tutor who has personal name \"Julio\".", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = \"Julio\"", "question": "What are the names of the courses taught by the tutor whose personal name is \"Julio\"?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.course_name , T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id WHERE T2.subject_name = \"Computer Science\"", "question": "Find the names and descriptions of courses that belong to the subject named \"Computer Science\".", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.course_name , T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id WHERE T2.subject_name = \"Computer Science\"", "question": "What are the names and descriptions of the all courses under the \"Computer Science\" subject?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.subject_id , T2.subject_name , COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id", "question": "Find the subject ID, subject name, and the corresponding number of available courses for each subject.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.subject_id , T2.subject_name , COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id", "question": "What are the subject ID, subject name, and the number of available courses for each subject?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.subject_id , T2.subject_name , COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) ASC", "question": "Find the subject ID, name of subject and the corresponding number of courses for each subject, and sort by the course count in ascending order.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.subject_id , T2.subject_name , COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) ASC", "question": "List the subject ID, name of subject and the number of courses available for each subject in ascending order of the course counts.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = \"Spanish\"", "question": "What is the date of enrollment of the course named \"Spanish\"?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = \"Spanish\"", "question": "Find the the date of enrollment of the \"Spanish\" course.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the name of the course that has the most student enrollment?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1", "question": "Which course is enrolled in by the most students? Give me the course name.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) = 1", "question": "What are the names of the courses that have exactly 1 student enrollment?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) = 1", "question": "Find the names of the courses that have just one student enrollment.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.course_description , T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 2", "question": "What are the descriptions and names of the courses that have student enrollment bigger than 2?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.course_description , T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 2", "question": "Return the descriptions and names of the courses that have more than two students enrolled in.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.course_name , COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name", "question": "What is the name of each course and the corresponding number of student enrollment?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.course_name , COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name", "question": "List the name and the number of enrolled student for each course.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = \"Pass\"", "question": "What are the enrollment dates of all the tests that have result \"Pass\"?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = \"Pass\"", "question": "Find the enrollment date for all the tests that have \"Pass\" result.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = \"Fail\"", "question": "What are the completion dates of all the tests that have result \"Fail\"?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = \"Fail\"", "question": "Return the completion date for all the tests that have \"Fail\" result.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.personal_name = \"Karson\"", "question": "List the dates of enrollment and completion of the student with personal name \"Karson\".", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.personal_name = \"Karson\"", "question": "On what dates did the student whose personal name is \"Karson\" enroll in and complete the courses?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = \"Zieme\" AND T2.personal_name = \"Bernie\"", "question": "List the dates of enrollment and completion of the student with family name \"Zieme\" and personal name \"Bernie\".", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = \"Zieme\" AND T2.personal_name = \"Bernie\"", "question": "On what dates did the student with family name \"Zieme\" and personal name \"Bernie\" enroll in and complete the courses?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.student_id , T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1", "question": "Find the student ID and login name of the student with the most course enrollments", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.student_id , T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1", "question": "What are the student ID and login name of the student who are enrolled in the most courses?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.student_id , T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2", "question": "Find the student ID and personal name of the student with at least two enrollments.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.student_id , T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2", "question": "Which student are enrolled in at least two courses? Give me the student ID and personal name.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.student_id , T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) <= 2", "question": "Find the student ID and middle name for all the students with at most two enrollments.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.student_id , T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) <= 2", "question": "What are the student IDs and middle names of the students enrolled in at most two courses?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id", "question": "Find the personal names of students not enrolled in any course.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id", "question": "Which students not enrolled in any course? Find their personal names.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Students WHERE student_id NOT IN (SELECT student_id FROM Student_Course_Enrolment)", "question": "How many students did not have any course enrollment?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Students WHERE student_id NOT IN (SELECT student_id FROM Student_Course_Enrolment)", "question": "Count the number of students who did not enroll in any course.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students", "question": "Find the common login name of course authors and students.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students", "question": "What are the login names used both by some course authors and some students?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT personal_name FROM Course_Authors_and_Tutors INTERSECT SELECT personal_name FROM Students", "question": "Find the common personal name of course authors and students.", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT personal_name FROM Course_Authors_and_Tutors INTERSECT SELECT personal_name FROM Students", "question": "What are the personal names used both by some course authors and some students?", "schema": "Course_Authors_and_Tutors: author_id (INTEGER), author_tutor_ATB (VARCHAR(3)), login_name (VARCHAR(40)), password (VARCHAR(40)), personal_name (VARCHAR(80)), middle_name (VARCHAR(80)), family_name (VARCHAR(80)), gender_mf (VARCHAR(1)), address_line_1 (VARCHAR(80))\nStudents: student_id (INTEGER), date_of_registration (DATETIME), date_of_latest_logon (DATETIME), login_name (VARCHAR(40)), password (VARCHAR(10)), personal_name (VARCHAR(40)), middle_name (VARCHAR(40)), family_name (VARCHAR(40))\nSubjects: subject_id (INTEGER), subject_name (VARCHAR(120))\nCourses: course_id (INTEGER), author_id (INTEGER), subject_id (INTEGER), course_name (VARCHAR(120)), course_description (VARCHAR(255))\nStudent_Course_Enrolment: registration_id (INTEGER), student_id (INTEGER), course_id (INTEGER), date_of_enrolment (DATETIME), date_of_completion (DATETIME)\nStudent_Tests_Taken: registration_id (INTEGER), date_test_taken (DATETIME), test_result (VARCHAR(255))" }, { "query": "SELECT T1.Date_Claim_Made , T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.Claim_id HAVING count(*) > 2 UNION SELECT T1.Date_Claim_Made , T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id WHERE T1.Amount_Claimed = ( SELECT max(Amount_Claimed) FROM Claims )", "question": "Which claims caused more than 2 settlements or have the maximum claim value? List the date the claim was made and the claim id.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT T1.Date_Claim_Made , T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.Claim_id HAVING count(*) > 2 UNION SELECT T1.Date_Claim_Made , T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id WHERE T1.Amount_Claimed = ( SELECT max(Amount_Claimed) FROM Claims )", "question": "Find the claims that led to more than two settlements or have the maximum claim value. For each of them, return the date the claim was made and the id of the claim.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 2 EXCEPT SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id JOIN Claims AS T3 ON T2.policy_id = T3.policy_id", "question": "Which customer had at least 2 policies but did not file any claims? List the customer details and id.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 2 EXCEPT SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id JOIN Claims AS T3 ON T2.policy_id = T3.policy_id", "question": "Give me the the customer details and id for the customers who had two or more policies but did not file any claims.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Payment_Method_Code , Date_Payment_Made , Amount_Payment FROM Payments ORDER BY Date_Payment_Made ASC", "question": "List the method, date and amount of all the payments, in ascending order of date.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Payment_Method_Code , Date_Payment_Made , Amount_Payment FROM Payments ORDER BY Date_Payment_Made ASC", "question": "What are the method, date and amount of each payment? Sort the list in ascending order of date.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Amount_Settled , Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1", "question": "Among all the claims, what is the settlement amount of the claim with the largest claim amount? List both the settlement amount and claim amount.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Amount_Settled , Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1", "question": "Find the settlement amount of the claim with the largest claim amount. Show both the settlement amount and claim amount.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Amount_Settled , Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC LIMIT 1", "question": "Among all the claims, what is the amount claimed in the claim with the least amount settled? List both the settlement amount and claim amount.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Amount_Settled , Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC LIMIT 1", "question": "Find the claimed amount in the claim with the least amount settled. Show both the settlement amount and claim amount.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Date_Claim_Made , Date_Claim_Settled FROM Claims WHERE Amount_Claimed > ( SELECT avg(Amount_Claimed) FROM Claims )", "question": "Among all the claims, which claims have a claimed amount larger than the average? List the date the claim was made and the date it was settled.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Date_Claim_Made , Date_Claim_Settled FROM Claims WHERE Amount_Claimed > ( SELECT avg(Amount_Claimed) FROM Claims )", "question": "Give me the claim date, settlement date for all the claims whose claimed amount is larger than the average.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled <= ( SELECT avg(Amount_Settled) FROM Claims )", "question": "Among all the claims, which settlements have a claimed amount that is no more than the average? List the claim start date.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled <= ( SELECT avg(Amount_Settled) FROM Claims )", "question": "Return the claim start date for the claims whose claimed amount is no more than the average", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT T1.Claim_id , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id", "question": "How many settlements does each claim correspond to? List the claim id and the number of settlements.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT T1.Claim_id , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id", "question": "Find the number of settlements each claim corresponds to. Show the number together with the claim id.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT T1.claim_id , T1.date_claim_made , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY count(*) DESC LIMIT 1", "question": "Which claim incurred the most number of settlements? List the claim id, the date the claim was made, and the number.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT T1.claim_id , T1.date_claim_made , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY count(*) DESC LIMIT 1", "question": "Find the claim id and claim date of the claim that incurred the most settlement count. Also tell me the count.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT count(*) , T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1", "question": "How many settlements were made on the claim with the most recent claim settlement date? List the number and the claim id.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT count(*) , T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1", "question": "Find the claim id and the number of settlements made for the claim with the most recent settlement date.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made ASC LIMIT 1", "question": "Of all the claims, what was the earliest date when any claim was made?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made ASC LIMIT 1", "question": "Tell me the the date when the first claim was made.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT sum(Amount_Settled) FROM Settlements", "question": "What is the total amount of settlement made for all the settlements?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT sum(Amount_Settled) FROM Settlements", "question": "Compute the total amount of settlement across all the settlements.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.Customer_id GROUP BY T1.customer_id HAVING count(*) > 1", "question": "Who are the customers that had more than 1 policy? List the customer details and id.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.Customer_id GROUP BY T1.customer_id HAVING count(*) > 1", "question": "Find the the customer details and id for the customers who had more than one policy.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Date_Claim_Made , Date_Claim_Settled FROM Settlements", "question": "What are the claim dates and settlement dates of all the settlements?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Date_Claim_Made , Date_Claim_Settled FROM Settlements", "question": "Tell me the the claim date and settlement date for each settlement case.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) DESC LIMIT 1", "question": "What is the most popular payment method?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) DESC LIMIT 1", "question": "Which payment method is used the most often?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) ASC LIMIT 1", "question": "With which kind of payment method were the least number of payments processed?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) ASC LIMIT 1", "question": "What is the payment method that were used the least often?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT sum(Amount_Payment) FROM Payments", "question": "What is the total amount of payment?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT sum(Amount_Payment) FROM Payments", "question": "Compute the total amount of payment processed.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT DISTINCT customer_details FROM Customers", "question": "What are all the distinct details of the customers?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT DISTINCT customer_details FROM Customers", "question": "Return the distinct customer details.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY count(*) DESC LIMIT 1", "question": "Which kind of policy type was chosen by the most customers?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY count(*) DESC LIMIT 1", "question": "Find the policy type the most customers choose.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT count(*) FROM Settlements", "question": "How many settlements are there in total?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT count(*) FROM Settlements", "question": "Count the total number of settlements made.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Payment_ID , Date_Payment_Made , Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa'", "question": "Which Payments were processed with Visa? List the payment Id, the date and the amount.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT Payment_ID , Date_Payment_Made , Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa'", "question": "Give me the payment Id, the date and the amount for all the payments processed with Visa.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id", "question": "List the details of the customers who do not have any policies.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id", "question": "Which customers do not have any policies? Find the details of these customers.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT T1.claim_id , T1.date_claim_made , T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.claim_id HAVING count(*) = 1", "question": "List the date the claim was made, the date it was settled and the amount settled for all the claims which had exactly one settlement.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT T1.claim_id , T1.date_claim_made , T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.claim_id HAVING count(*) = 1", "question": "Which claims had exactly one settlement? For each, tell me the the date the claim was made, the date it was settled and the amount settled.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT sum(Amount_Claimed) FROM Claims", "question": "Find the total claimed amount of all the claims.", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT sum(Amount_Claimed) FROM Claims", "question": "What is total amount claimed summed across all the claims?", "schema": "Customers: Customer_ID (INTEGER), Customer_Details (VARCHAR(255))\nCustomer_Policies: Policy_ID (INTEGER), Customer_ID (INTEGER), Policy_Type_Code (CHAR(15)), Start_Date (DATE), End_Date (DATE)\nClaims: Claim_ID (INTEGER), Policy_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER)\nSettlements: Settlement_ID (INTEGER), Claim_ID (INTEGER), Date_Claim_Made (DATE), Date_Claim_Settled (DATE), Amount_Claimed (INTEGER), Amount_Settled (INTEGER), Customer_Policy_ID (INTEGER)\nPayments: Payment_ID (INTEGER), Settlement_ID (INTEGER), Payment_Method_Code (VARCHAR(255)), Date_Payment_Made (DATE), Amount_Payment (INTEGER)" }, { "query": "SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1;", "question": "Which department has the largest number of employees?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1;", "question": "Find the department with the most employees.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT head FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;", "question": "What is the employee id of the head whose department has the least number of employees?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT head FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;", "question": "Tell me the employee id of the head of the department with the least employees.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T2.name , T2.position FROM department AS T1 JOIN physician AS T2 ON T1.head = T2.EmployeeID GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;", "question": "what is the name and position of the head whose department has least number of employees?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T2.name , T2.position FROM department AS T1 JOIN physician AS T2 ON T1.head = T2.EmployeeID GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;", "question": "Find the name and position of the head of the department with the least employees.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn", "question": "What are names of patients who made an appointment?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn", "question": "List the names of patients who have made appointments.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name , phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.patient HAVING count(*) > 1", "question": "what are name and phone number of patients who had more than one appointment?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name , phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.patient HAVING count(*) > 1", "question": "Which patients made more than one appointment? Tell me the name and phone number of these patients.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1", "question": "Find the id of the appointment with the most recent start date?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1", "question": "What is the id of the appointment that started most recently?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID", "question": "List the name of physicians who took some appointment.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID", "question": "What are the names of all the physicians who took appointments.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID", "question": "List the name of physicians who never took any appointment.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID", "question": "Which physicians have never taken any appointment? Find their names.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name , T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1", "question": "Find the names of all physicians and their primary affiliated departments' names.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name , T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1", "question": "What are the name and primarily affiliated department name of each physician?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1", "question": "What is the name of the patient who made the most recent appointment?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1", "question": "Find the name of the patient who made the appointment with the most recent start date.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(patient) FROM stay WHERE room = 112", "question": "How many patients stay in room 112?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(patient) FROM stay WHERE room = 112", "question": "Count the number of patients who stayed in room 112.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN = T2.patient JOIN physician AS T3 ON T2.physician = T3.employeeid WHERE T3.name = \"John Dorian\"", "question": "How many patients' prescriptions are made by physician John Dorian?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN = T2.patient JOIN physician AS T3 ON T2.physician = T3.employeeid WHERE T3.name = \"John Dorian\"", "question": "Find the number of patients' prescriptions physician John Dorian made.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient = T2.SSN JOIN Prescribes AS T3 ON T3.Patient = T2.SSN JOIN Medication AS T4 ON T3.Medication = T4.Code WHERE room = 111", "question": "Find the name of medication used on the patient who stays in room 111?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient = T2.SSN JOIN Prescribes AS T3 ON T3.Patient = T2.SSN JOIN Medication AS T4 ON T3.Medication = T4.Code WHERE room = 111", "question": "What is the name of the medication used for the patient staying in room 111?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT patient FROM stay WHERE room = 111 ORDER BY staystart DESC LIMIT 1", "question": "Find the patient who most recently stayed in room 111.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT patient FROM stay WHERE room = 111 ORDER BY staystart DESC LIMIT 1", "question": "What is the id of the patient who stayed in room 111 most recently?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid = T2.prepnurse GROUP BY T1.employeeid ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of the nurse has the most appointments?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid = T2.prepnurse GROUP BY T1.employeeid ORDER BY count(*) DESC LIMIT 1", "question": "Find the name of the nurse who has the largest number of appointments.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name , count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid", "question": "How many patients do each physician take care of? List their names and number of patients they take care of.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name , count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid", "question": "Return the name of each physician and the number of patients he or she treats.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid HAVING count(*) > 1", "question": "Find the name of physicians who are in charge of more than one patient.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid HAVING count(*) > 1", "question": "Which physicians are in charge of more than one patient? Give me their names.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(*) , T1.blockfloor FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockfloor", "question": "Find the number of rooms located on each block floor.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(*) , T1.blockfloor FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockfloor", "question": "How many rooms does each block floor have?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(*) , T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockcode", "question": "Find the number of rooms for different block code?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(*) , T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockcode", "question": "How many rooms are located for each block code?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT blockcode FROM room WHERE unavailable = 0", "question": "What are the unique block codes that have available rooms?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT blockcode FROM room WHERE unavailable = 0", "question": "Tell me the distinct block codes where some rooms are available.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(DISTINCT roomtype) FROM room", "question": "How many different types of rooms are there?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(DISTINCT roomtype) FROM room", "question": "Find the number of distinct room types available.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name = \"Thesisin\"", "question": "What is the names of the physicians who prescribe medication Thesisin?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name = \"Thesisin\"", "question": "List the names of all the physicians who prescribe Thesisin as medication.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT T1.name , T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand = \"X\"", "question": "Find the name and position of physicians who prescribe some medication whose brand is X?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT T1.name , T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand = \"X\"", "question": "Which physicians prescribe a medication of brand X? Tell me the name and position of those physicians.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(*) , T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand", "question": "Find the number of medications prescribed for each brand.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(*) , T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand", "question": "How many medications are prescribed for each brand?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM physician WHERE POSITION LIKE '%senior%'", "question": "Find the name of physicians whose position title contains the word 'senior'.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM physician WHERE POSITION LIKE '%senior%'", "question": "What are the names of the physicians who have 'senior' in their titles.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1", "question": "Find the patient who has the most recent undergoing treatment?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1", "question": "Which patient is undergoing the most recent treatment?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay = T3.StayID WHERE T3.room = 111", "question": "Find the names of all patients who have an undergoing treatment and are staying in room 111.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay = T3.StayID WHERE T3.room = 111", "question": "What are the names of patients who are staying in room 111 and have an undergoing treatment?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT name FROM nurse ORDER BY name", "question": "List the names of all distinct nurses ordered by alphabetical order?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT name FROM nurse ORDER BY name", "question": "What is the alphabetically ordered list of all the distinct names of nurses?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse = T2.EmployeeID", "question": "Find the names of nurses who are nursing an undergoing treatment.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse = T2.EmployeeID", "question": "Which nurses are in charge of patients undergoing treatments?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT name FROM medication ORDER BY name", "question": "List the names of all distinct medications, ordered in an alphabetical order.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT name FROM medication ORDER BY name", "question": "What is the alphabetically ordered list of all distinct medications?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1", "question": "What are the names of the physician who prescribed the highest dose?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1", "question": "Find the physician who prescribed the highest dose. What is his or her name?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT physician , department FROM affiliated_with WHERE primaryaffiliation = 1", "question": "List the physicians' employee ids together with their primary affiliation departments' ids.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT physician , department FROM affiliated_with WHERE primaryaffiliation = 1", "question": "What are each physician's employee id and department id primarily affiliated.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation = 1", "question": "List the names of departments where some physicians are primarily affiliated with.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation = 1", "question": "What are the names of departments that have primarily affiliated physicians.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1", "question": "What nurses are on call with block floor 1 and block code 1? Tell me their names.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1", "question": "Find the ids of the nurses who are on call in block floor 1 and block code 1.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT MAX(cost) , MIN(cost) , AVG(cost) FROM procedures", "question": "What are the highest cost, lowest cost and average cost of procedures?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT MAX(cost) , MIN(cost) , AVG(cost) FROM procedures", "question": "Tell me the highest, lowest, and average cost of procedures.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name , cost FROM procedures ORDER BY cost DESC", "question": "List the name and cost of all procedures sorted by the cost from the highest to the lowest.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name , cost FROM procedures ORDER BY cost DESC", "question": "Sort the list of names and costs of all procedures in the descending order of cost.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM procedures ORDER BY cost LIMIT 3", "question": "Find the three most expensive procedures.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM procedures ORDER BY cost LIMIT 3", "question": "What are the three most costly procedures?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T3.cost > 5000", "question": "Find the physicians who are trained in a procedure that costs more than 5000.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T3.cost > 5000", "question": "Which physicians are trained in procedures that are more expensive than 5000?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment ORDER BY T3.cost DESC LIMIT 1", "question": "Find the physician who was trained in the most expensive procedure?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment ORDER BY T3.cost DESC LIMIT 1", "question": "Which physician was trained in the procedure that costs the most.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT avg(T3.cost) FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = \"John Wen\"", "question": "What is the average cost of procedures that physician John Wen was trained in?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT avg(T3.cost) FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = \"John Wen\"", "question": "Compute the mean price of procedures physician John Wen was trained in.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = \"John Wen\"", "question": "Find the names of procedures which physician John Wen was trained in.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = \"John Wen\"", "question": "What are the names of procedures physician John Wen was trained in?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM procedures WHERE cost > 1000 UNION SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = \"John Wen\"", "question": "Find all procedures which cost more than 1000 or which physician John Wen was trained in.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM procedures WHERE cost > 1000 UNION SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = \"John Wen\"", "question": "What are the procedures that cost more than 1000 or are specialized in by physician John Wen?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM procedures WHERE cost > 1000 EXCEPT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = \"John Wen\"", "question": "Find the names of all procedures which cost more than 1000 but which physician John Wen was not trained in?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM procedures WHERE cost > 1000 EXCEPT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = \"John Wen\"", "question": "Among the procedures that cost more than 1000, which were not specialized in by physician John Wen?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM procedures WHERE cost < 5000 INTERSECT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = \"John Wen\"", "question": "Find the names of all procedures such that the cost is less than 5000 and physician John Wen was trained in.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM procedures WHERE cost < 5000 INTERSECT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = \"John Wen\"", "question": "What procedures cost less than 5000 and have John Wen as a trained physician?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Surgery' INTERSECT SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Psychiatry'", "question": "Find the name of physicians who are affiliated with both Surgery and Psychiatry departments.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Surgery' INTERSECT SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Psychiatry'", "question": "Which physicians are affiliated with both Surgery and Psychiatry departments? Tell me their names.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Surgery' OR T3.name = 'Psychiatry'", "question": "Find the name of physicians who are affiliated with Surgery or Psychiatry department.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T3.name = 'Surgery' OR T3.name = 'Psychiatry'", "question": "Which physicians are affiliated with either Surgery or Psychiatry department? Give me their names.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM patient EXCEPT SELECT T1.name FROM patient AS T1 JOIN Prescribes AS T2 ON T2.Patient = T1.SSN JOIN Medication AS T3 ON T2.Medication = T3.Code WHERE T3.name = 'Procrastin-X'", "question": "Find the names of patients who are not using the medication of Procrastin-X.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT name FROM patient EXCEPT SELECT T1.name FROM patient AS T1 JOIN Prescribes AS T2 ON T2.Patient = T1.SSN JOIN Medication AS T3 ON T2.Medication = T3.Code WHERE T3.name = 'Procrastin-X'", "question": "What are the names of patients who are not taking the medication of Procrastin-X.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(*) FROM patient WHERE SSN NOT IN ( SELECT T1.patient FROM Prescribes AS T1 JOIN Medication AS T2 ON T1.Medication = T2.Code WHERE T2.name = 'Procrastin-X' )", "question": "Find the number of patients who are not using the medication of Procrastin-X.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(*) FROM patient WHERE SSN NOT IN ( SELECT T1.patient FROM Prescribes AS T1 JOIN Medication AS T2 ON T1.Medication = T2.Code WHERE T2.name = 'Procrastin-X' )", "question": "How many patients are not using Procrastin-X as medication?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(*) FROM appointment", "question": "How many appointments are there?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(*) FROM appointment", "question": "Count how many appointments have been made in total.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID = T2.nurse", "question": "Find the names of nurses who are on call.", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID = T2.nurse", "question": "What are the distinct names of nurses on call?", "schema": "Physician: EmployeeID (INTEGER), Name (VARCHAR(30)), Position (VARCHAR(30)), SSN (INTEGER), CONSTRAINT (PK_PHYSICIAN)\nDepartment: DepartmentID (INTEGER), Name (VARCHAR(30)), Head (INTEGER), CONSTRAINT (PK_DEPARTMENT)\nAffiliated_With: Physician (INTEGER), Department (INTEGER), PrimaryAffiliation (BOOLEAN)\nProcedures: Name (VARCHAR(30)), Cost (REAL)\nTrained_In: Physician (INTEGER), Treatment (INTEGER), CertificationDate (DATETIME), CertificationExpires (DATETIME)\nPatient: Name (VARCHAR(30)), Address (VARCHAR(30)), Phone (VARCHAR(30)), InsuranceID (INTEGER), PCP (INTEGER)\nNurse: Name (VARCHAR(30)), Position (VARCHAR(30)), Registered (BOOLEAN), SSN (INTEGER)\nAppointment: Patient (INTEGER), PrepNurse (INTEGER), Physician (INTEGER), Start (DATETIME), End (DATETIME), ExaminationRoom (TEXT)\nMedication: Name (VARCHAR(30)), Brand (VARCHAR(30)), Description (VARCHAR(30))\nPrescribes: Physician (INTEGER), Patient (INTEGER), Medication (INTEGER), Date (DATETIME), Appointment (INTEGER), Dose (VARCHAR(30))\nBlock: BlockFloor (INTEGER), BlockCode (INTEGER)\nRoom: RoomType (VARCHAR(30)), BlockFloor (INTEGER), BlockCode (INTEGER), Unavailable (BOOLEAN)\nOn_Call: Nurse (INTEGER), BlockFloor (INTEGER), BlockCode (INTEGER), OnCallStart (DATETIME), OnCallEnd (DATETIME)\nStay: Patient (INTEGER), Room (INTEGER), StayStart (DATETIME), StayEnd (DATETIME)\nUndergoes: Patient (INTEGER), Procedures (INTEGER), Stay (INTEGER), DateUndergoes (DATETIME), Physician (INTEGER), AssistingNurse (INTEGER)" }, { "query": "SELECT count(*) FROM ship", "question": "How many ships are there?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT count(*) FROM ship", "question": "What is the number of ships?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT Name FROM ship ORDER BY Tonnage ASC", "question": "List the name of ships in ascending order of tonnage.", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT Name FROM ship ORDER BY Tonnage ASC", "question": "what are the names of the ships ordered by ascending tonnage?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT TYPE , Nationality FROM ship", "question": "What are the type and nationality of ships?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT TYPE , Nationality FROM ship", "question": "What are the types and nationalities of every ship?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT Name FROM ship WHERE Nationality != \"United States\"", "question": "List the name of ships whose nationality is not \"United States\".", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT Name FROM ship WHERE Nationality != \"United States\"", "question": "What are the names of the ships that are not from the United States?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT Name FROM ship WHERE Nationality = \"United States\" OR Nationality = \"United Kingdom\"", "question": "Show the name of ships whose nationality is either United States or United Kingdom.", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT Name FROM ship WHERE Nationality = \"United States\" OR Nationality = \"United Kingdom\"", "question": "What are the names of the ships that are from either the US or the UK?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1", "question": "What is the name of the ship with the largest tonnage?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1", "question": "What is the ship with the largest amount of tonnage called?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT TYPE , COUNT(*) FROM ship GROUP BY TYPE", "question": "Show different types of ships and the number of ships of each type.", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT TYPE , COUNT(*) FROM ship GROUP BY TYPE", "question": "For each type, how many ships are there?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1", "question": "Please show the most common type of ships.", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the most common type of ships?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2", "question": "List the nations that have more than two ships.", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2", "question": "What are the nations that have more than two ships?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT TYPE , avg(Tonnage) FROM ship GROUP BY TYPE", "question": "Show different types of ships and the average tonnage of ships of each type.", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT TYPE , avg(Tonnage) FROM ship GROUP BY TYPE", "question": "For each type, what is the average tonnage?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT T1.Code , T1.Fate , T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID", "question": "Show codes and fates of missions, and names of ships involved.", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT T1.Code , T1.Fate , T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID", "question": "What are the mission codes, fates, and names of the ships involved?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928", "question": "Show names of ships involved in a mission launched after 1928.", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928", "question": "What are the names of ships that were involved in a mission launched after 1928?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Nationality = \"United States\"", "question": "Show the distinct fate of missions that involve ships with nationality \"United States\"", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Nationality = \"United States\"", "question": "What are the different fates of the mission that involved ships from the United States?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT Name FROM ship WHERE Ship_ID NOT IN (SELECT Ship_ID FROM mission)", "question": "List the name of ships that are not involved in any mission", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT Name FROM ship WHERE Ship_ID NOT IN (SELECT Ship_ID FROM mission)", "question": "What are the names of the ships that are not involved in any missions?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000", "question": "Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000.", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000", "question": "What are the types of the ships that have both shiips with tonnage more than 6000 and those with tonnage less than 4000?", "schema": "mission: Mission_ID (INT), Ship_ID (INT), Code (TEXT), Launched_Year (INT), Location (TEXT), Speed_knots (INT), Fate (TEXT)\nship: Ship_ID (INT), Name (TEXT), Type (TEXT), Nationality (TEXT), Tonnage (INT)" }, { "query": "SELECT count(*) FROM list", "question": "Find the number of students in total.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT count(*) FROM list", "question": "How many students are there?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT lastname FROM list WHERE classroom = 111", "question": "Find the last names of students studying in room 111.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT lastname FROM list WHERE classroom = 111", "question": "What are the last names of students in room 111?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT firstname FROM list WHERE classroom = 108", "question": "Find the first names of students studying in room 108.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT firstname FROM list WHERE classroom = 108", "question": "What are the first names of students in room 108?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT firstname FROM list WHERE classroom = 107", "question": "What are the first names of students studying in room 107?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT firstname FROM list WHERE classroom = 107", "question": "List the first names of all the students in room 107.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT classroom , grade FROM list", "question": "For each classroom report the grade that is taught in it. Report just the classroom number and the grade number.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT classroom , grade FROM list", "question": "What are the grade number and classroom number of each class in the list?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT grade FROM list WHERE classroom = 103", "question": "Which grade is studying in classroom 103?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT grade FROM list WHERE classroom = 103", "question": "Find the grade taught in classroom 103.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT grade FROM list WHERE classroom = 105", "question": "Find the grade studying in room 105.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT grade FROM list WHERE classroom = 105", "question": "Which grade is studying in room 105?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT classroom FROM list WHERE grade = 4", "question": "Which classrooms are used by grade 4?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT classroom FROM list WHERE grade = 4", "question": "Find the classrooms in which grade 4 is studying.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT classroom FROM list WHERE grade = 5", "question": "Which classrooms are used by grade 5?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT classroom FROM list WHERE grade = 5", "question": "Show me the classrooms grade 5 is using.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5", "question": "Find the last names of the teachers that teach fifth grade.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5", "question": "what are the last names of the teachers who teach grade 5?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1", "question": "Find the first names of the teachers that teach first grade.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1", "question": "What are the first names of the teachers who teach grade 1?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT firstname FROM teachers WHERE classroom = 110", "question": "Find the first names of all the teachers that teach in classroom 110.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT firstname FROM teachers WHERE classroom = 110", "question": "Which teachers teach in classroom 110? Give me their first names.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT lastname FROM teachers WHERE classroom = 109", "question": "Find the last names of teachers teaching in classroom 109.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT lastname FROM teachers WHERE classroom = 109", "question": "Which teachers teach in classroom 109? Give me their last names.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT firstname , lastname FROM teachers", "question": "Report the first name and last name of all the teachers.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT firstname , lastname FROM teachers", "question": "What are the first name and last name of all the teachers?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT firstname , lastname FROM list", "question": "Report the first name and last name of all the students.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT firstname , lastname FROM list", "question": "Show each student's first name and last name.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = \"OTHA\" AND T2.lastname = \"MOYER\"", "question": "Find all students taught by OTHA MOYER. Output the first and last names of the students.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = \"OTHA\" AND T2.lastname = \"MOYER\"", "question": "Which students study under the teacher named OTHA MOYER? Give me the first and last names of the students.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = \"MARROTTE\" AND T2.lastname = \"KIRK\"", "question": "Find all students taught by MARROTTE KIRK. Output first and last names of students.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = \"MARROTTE\" AND T2.lastname = \"KIRK\"", "question": "Which are the first and last names of the students taught by MARROTTE KIRK?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT T2.firstname , T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = \"EVELINA\" AND T1.lastname = \"BROMLEY\"", "question": "Find the first and last name of all the teachers that teach EVELINA BROMLEY.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT T2.firstname , T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = \"EVELINA\" AND T1.lastname = \"BROMLEY\"", "question": "Which teachers teach the student named EVELINA BROMLEY? Give me the first and last name of the teachers.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = \"GELL\" AND T1.lastname = \"TAMI\"", "question": "Find the last names of all the teachers that teach GELL TAMI.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = \"GELL\" AND T1.lastname = \"TAMI\"", "question": "What are the last names of the teachers who teach the student called GELL TAMI?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = \"LORIA\" AND T2.lastname = \"ONDERSMA\"", "question": "How many students does LORIA ONDERSMA teaches?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = \"LORIA\" AND T2.lastname = \"ONDERSMA\"", "question": "Count the number of students the teacher LORIA ONDERSMA teaches.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = \"KAWA\" AND T2.lastname = \"GORDON\"", "question": "How many students does KAWA GORDON teaches?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = \"KAWA\" AND T2.lastname = \"GORDON\"", "question": "Find the number of students taught by the teacher KAWA GORDON.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = \"TARRING\" AND T2.lastname = \"LEIA\"", "question": "Find the number of students taught by TARRING LEIA.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = \"TARRING\" AND T2.lastname = \"LEIA\"", "question": "How many students are taught by teacher TARRING LEIA?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = \"CHRISSY\" AND T1.lastname = \"NABOZNY\"", "question": "How many teachers does the student named CHRISSY NABOZNY have?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = \"CHRISSY\" AND T1.lastname = \"NABOZNY\"", "question": "Find the number of teachers who teach the student called CHRISSY NABOZNY.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = \"MADLOCK\" AND T1.lastname = \"RAY\"", "question": "How many teachers does the student named MADLOCK RAY have?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = \"MADLOCK\" AND T1.lastname = \"RAY\"", "question": "Find the number of teachers who teach the student called MADLOCK RAY.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = \"OTHA\" AND T2.lastname = \"MOYER\"", "question": "Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = \"OTHA\" AND T2.lastname = \"MOYER\"", "question": "What are the first and last names of the first-grade students who are NOT taught by teacher OTHA MOYER?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname != \"COVIN\" AND T2.lastname != \"JEROME\"", "question": "Find the last names of the students in third grade that are not taught by COVIN JEROME.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname != \"COVIN\" AND T2.lastname != \"JEROME\"", "question": "Which students in third grade are not taught by teacher COVIN JEROME? Give me the last names of the students.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT grade , count(DISTINCT classroom) , count(*) FROM list GROUP BY grade", "question": "For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT grade , count(DISTINCT classroom) , count(*) FROM list GROUP BY grade", "question": "For each grade, return the grade number, the number of classrooms used for the grade, and the total number of students enrolled in the grade.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT classroom , count(DISTINCT grade) FROM list GROUP BY classroom", "question": "For each classroom, report the classroom number and the number of grades using it.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT classroom , count(DISTINCT grade) FROM list GROUP BY classroom", "question": "For each classroom, show the classroom number and count the number of distinct grades that use the room.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT classroom FROM list GROUP BY classroom ORDER BY count(*) DESC LIMIT 1", "question": "Which classroom has the most students?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT classroom FROM list GROUP BY classroom ORDER BY count(*) DESC LIMIT 1", "question": "Find the classroom that the most students use.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT classroom , count(*) FROM list GROUP BY classroom", "question": "Report the number of students in each classroom.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT classroom , count(*) FROM list GROUP BY classroom", "question": "For each classroom, show the classroom number and find how many students are using it.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT classroom , count(*) FROM list WHERE grade = \"0\" GROUP BY classroom", "question": "For each grade 0 classroom, report the total number of students.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT classroom , count(*) FROM list WHERE grade = \"0\" GROUP BY classroom", "question": "For each grade 0 classroom, return the classroom number and the count of students.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT classroom , count(*) FROM list WHERE grade = \"4\" GROUP BY classroom", "question": "Report the total number of students for each fourth-grade classroom.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT classroom , count(*) FROM list WHERE grade = \"4\" GROUP BY classroom", "question": "For each fourth-grade classroom, show the classroom number and the total number of students using it.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT T2.firstname , T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom GROUP BY T2.firstname , T2.lastname ORDER BY count(*) DESC LIMIT 1", "question": "Find the name of the teacher who teaches the largest number of students.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT T2.firstname , T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom GROUP BY T2.firstname , T2.lastname ORDER BY count(*) DESC LIMIT 1", "question": "Which teacher teaches the most students? Give me the first name and last name of the teacher.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT count(*) , classroom FROM list GROUP BY classroom", "question": "Find the number of students in one classroom.", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT count(*) , classroom FROM list GROUP BY classroom", "question": "How many students does one classroom have?", "schema": "list: LastName (TEXT), FirstName (TEXT), Grade (INTEGER), Classroom (INTEGER)\nteachers: LastName (TEXT), FirstName (TEXT), Classroom (INTEGER)" }, { "query": "SELECT count(*) FROM company WHERE Headquarters = 'USA'", "question": "How many companies are headquartered in the US?", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT Name FROM company ORDER BY Sales_in_Billion ASC", "question": "List the names of companies by ascending number of sales.", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT Headquarters , Industry FROM company", "question": "What are the headquarters and industries of all companies?", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT Name FROM company WHERE Industry = \"Banking\" OR Industry = \"Retailing\"", "question": "Show the names of companies in the banking or retailing industry?", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT max(Market_Value_in_Billion) , min(Market_Value_in_Billion) FROM company", "question": "What is the maximum and minimum market value of companies?", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1", "question": "What is the headquarter of the company with the largest sales?", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT Headquarters , COUNT(*) FROM company GROUP BY Headquarters", "question": "Show the different headquarters and number of companies at each headquarter.", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the most common headquarter for companies.", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*) >= 2", "question": "Show the headquarters that have at least two companies.", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT Headquarters FROM company WHERE Industry = \"Banking\" INTERSECT SELECT Headquarters FROM company WHERE Industry = \"Oil and gas\"", "question": "Show the headquarters that have both companies in banking industry and companies in oil and gas industry.", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT T3.Name , T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID", "question": "Show the names of companies and of employees.", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT T3.Name , T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID ORDER BY T1.Year_working", "question": "Show names of companies and that of employees in descending order of number of years working for that employee.", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID WHERE T3.Sales_in_Billion > 200", "question": "Show the names of employees that work for companies with sales bigger than 200.", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT T3.Name , COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID GROUP BY T3.Name", "question": "Show the names of companies and the number of employees they have", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM employment)", "question": "List the names of people that are not employed by any company", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion , Profits_in_Billion DESC", "question": "list the names of the companies with more than 200 sales in the descending order of sales and profits.", "schema": "people: People_ID (INT), Age (INT), Name (TEXT), Nationality (TEXT), Graduation_College (TEXT)\ncompany: Company_ID (REAL), Name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_in_Billion (REAL), Profits_in_Billion (REAL), Assets_in_Billion (REAL), Market_Value_in_Billion (REAL)\nemployment: Company_ID (INT), People_ID (INT), Year_working (INT)" }, { "query": "SELECT count(*) FROM film", "question": "How many film are there?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT count(*) FROM film", "question": "Count the number of films.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT DISTINCT Director FROM film", "question": "List the distinct director of all films.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT DISTINCT Director FROM film", "question": "What are the different film Directors?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT avg(Gross_in_dollar) FROM film", "question": "What is the average ticket sales gross in dollars of films?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT avg(Gross_in_dollar) FROM film", "question": "Return the average gross sales in dollars across all films.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Low_Estimate , High_Estimate FROM film_market_estimation", "question": "What are the low and high estimates of film markets?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Low_Estimate , High_Estimate FROM film_market_estimation", "question": "Return the low and high estimates for all film markets.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995", "question": "What are the types of film market estimations in year 1995?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995", "question": "Return the types of film market estimations in 1995.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT max(Number_cities) , min(Number_cities) FROM market", "question": "What are the maximum and minimum number of cities in all markets.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT max(Number_cities) , min(Number_cities) FROM market", "question": "Return the maximum and minimum number of cities across all markets.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT count(*) FROM market WHERE Number_cities < 300", "question": "How many markets have number of cities smaller than 300?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT count(*) FROM market WHERE Number_cities < 300", "question": "Count the number of markets that have a number of cities lower than 300.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Country FROM market ORDER BY Country ASC", "question": "List all countries of markets in ascending alphabetical order.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Country FROM market ORDER BY Country ASC", "question": "What are the countries for each market, ordered alphabetically?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Country FROM market ORDER BY Number_cities DESC", "question": "List all countries of markets in descending order of number of cities.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Country FROM market ORDER BY Number_cities DESC", "question": "What are the countries for each market ordered by decreasing number of cities?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT T1.Title , T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID", "question": "Please show the titles of films and the types of market estimations.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT T1.Title , T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID", "question": "What are the titles of films and corresponding types of market estimations?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995", "question": "Show the distinct director of films with market estimation in the year of 1995.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995", "question": "Who are the different directors of films which had market estimation in 1995?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT avg(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000", "question": "What is the average number of cities of markets with low film market estimate bigger than 10000?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT avg(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000", "question": "Give the average number of cities within markets that had a low market estimation larger than 10000?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT T2.Country , T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID", "question": "Please list the countries and years of film market estimations.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT T2.Country , T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID", "question": "What are the countries of markets and their corresponding years of market estimation?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = \"Japan\" ORDER BY T1.Year DESC", "question": "Please list the years of film market estimations when the market is in country \"Japan\" in descending order.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = \"Japan\" ORDER BY T1.Year DESC", "question": "What are the years of film market estimation for the market of Japan, ordered by year descending?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Studio , COUNT(*) FROM film GROUP BY Studio", "question": "List the studios of each film and the number of films produced by that studio.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Studio , COUNT(*) FROM film GROUP BY Studio", "question": "How films are produced by each studio?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1", "question": "List the name of film studio that have the most number of films.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the name of teh studio that created the most films?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2", "question": "List the names of studios that have at least two films.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2", "question": "What are the names of studios that have made two or more films?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation)", "question": "List the title of films that do not have any market estimation.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation)", "question": "What are the titles of films that do not have a film market estimation?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Studio FROM film WHERE Director = \"Nicholas Meyer\" INTERSECT SELECT Studio FROM film WHERE Director = \"Walter Hill\"", "question": "Show the studios that have produced films with director \"Nicholas Meyer\" and \"Walter Hill\".", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Studio FROM film WHERE Director = \"Nicholas Meyer\" INTERSECT SELECT Studio FROM film WHERE Director = \"Walter Hill\"", "question": "What are the names of studios that have produced films with both Nicholas Meyer and Walter Hill?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT title , Studio FROM film WHERE Studio LIKE \"%Universal%\"", "question": "Find the titles and studios of the films that are produced by some film studios that contained the word \"Universal\".", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT title , Studio FROM film WHERE Studio LIKE \"%Universal%\"", "question": "What are the titles and studios of films that have been produced by a studio whose name contains \"Universal\"?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = \"Walter Hill\"", "question": "Show the studios that have not produced films with director \"Walter Hill\".", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = \"Walter Hill\"", "question": "Which studios have never worked with the director Walter Hill?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar) >= 4500000", "question": "List the studios which average gross is above 4500000.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar) >= 4500000", "question": "Which studios have an average gross of over 4500000?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1", "question": "What is the title of the film that has the highest high market estimation.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1", "question": "Return the title of the film with the highest high estimate?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT title , director FROM film WHERE film_id NOT IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China')", "question": "What are the titles and directors of the films were never presented in China?", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT title , director FROM film WHERE film_id NOT IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China')", "question": "Return the titles and directors of films that were never in the market of China.", "schema": "film: Film_ID (INT), Title (TEXT), Studio (TEXT), Director (TEXT), Gross_in_dollar (INT)\nmarket: Market_ID (INT), Country (TEXT), Number_cities (INT)\nfilm_market_estimation: Estimation_ID (INT), Low_Estimate (REAL), High_Estimate (REAL), Film_ID (INT), Type (TEXT), Market_ID (INT), Year (INT)" }, { "query": "SELECT count(*) FROM Ref_calendar", "question": "How many calendar items do we have?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Ref_calendar", "question": "Count the number of all the calendar items.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT calendar_date , day_Number FROM Ref_calendar", "question": "Show all calendar dates and day Numbers.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT calendar_date , day_Number FROM Ref_calendar", "question": "What are all the calendar dates and day Numbers?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Ref_document_types", "question": "Show the number of document types.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Ref_document_types", "question": "How many document types are there?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT document_type_code , document_type_name FROM Ref_document_types", "question": "List all document type codes and document type names.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT document_type_code , document_type_name FROM Ref_document_types", "question": "What are all the document type codes and document type names?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT document_type_name , document_type_description FROM Ref_document_types WHERE document_type_code = \"RV\"", "question": "What is the name and description for document type code RV?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT document_type_name , document_type_description FROM Ref_document_types WHERE document_type_code = \"RV\"", "question": "Give me the name and description of the document type code RV.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT document_type_code FROM Ref_document_types WHERE document_type_name = \"Paper\"", "question": "What is the document type code for document type \"Paper\"?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT document_type_code FROM Ref_document_types WHERE document_type_name = \"Paper\"", "question": "Find the code of the document type \"Paper\".", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM All_documents WHERE document_type_code = \"CV\" OR document_type_code = \"BK\"", "question": "Show the number of documents with document type code CV or BK.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM All_documents WHERE document_type_code = \"CV\" OR document_type_code = \"BK\"", "question": "How many documents have document type code CV or BK?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT date_stored FROM All_documents WHERE Document_name = \"Marry CV\"", "question": "What is the date when the document \"Marry CV\" was stored?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT date_stored FROM All_documents WHERE Document_name = \"Marry CV\"", "question": "When was the document named \"Marry CV\" stored? Give me the date.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T2.day_Number , T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date", "question": "What is the day Number and date of all the documents?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T2.day_Number , T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date", "question": "Return the day Number and stored date for all the documents.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = \"How to read a book\"", "question": "What is the document type name for the document with name \"How to read a book\"?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = \"How to read a book\"", "question": "Find the document type name of the document named \"How to read a book\".", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Ref_locations", "question": "Show the number of locations.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Ref_locations", "question": "How many locations are listed in the database?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT location_code , location_name FROM Ref_locations", "question": "List all location codes and location names.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT location_code , location_name FROM Ref_locations", "question": "What are all the location codes and location names?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT location_name , location_description FROM Ref_locations WHERE location_code = \"x\"", "question": "What are the name and description for location code x?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT location_name , location_description FROM Ref_locations WHERE location_code = \"x\"", "question": "Give me the name and description of the location with code x.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT location_code FROM Ref_locations WHERE location_name = \"Canada\"", "question": "What is the location code for the country \"Canada\"?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT location_code FROM Ref_locations WHERE location_name = \"Canada\"", "question": "Show the location code of the country \"Canada\".", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM ROLES", "question": "How many roles are there?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM ROLES", "question": "Count the total number of roles listed.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT role_code , role_name , role_description FROM ROLES", "question": "List all role codes, role names, and role descriptions.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT role_code , role_name , role_description FROM ROLES", "question": "What are all the role codes, role names, and role descriptions?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT role_name , role_description FROM ROLES WHERE role_code = \"MG\"", "question": "What are the name and description for role code \"MG\"?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT role_name , role_description FROM ROLES WHERE role_code = \"MG\"", "question": "Find the name and description of the role with code \"MG\".", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT role_description FROM ROLES WHERE role_name = \"Proof Reader\"", "question": "Show the description for role name \"Proof Reader\".", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT role_description FROM ROLES WHERE role_name = \"Proof Reader\"", "question": "What is the description of the role named \"Proof Reader\"?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Employees", "question": "How many employees do we have?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Employees", "question": "Find the number of employees we have.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT employee_name , role_code , date_of_birth FROM Employees WHERE employee_Name = 'Armani'", "question": "Show the name, role code, and date of birth for the employee with name 'Armani'.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT employee_name , role_code , date_of_birth FROM Employees WHERE employee_Name = 'Armani'", "question": "What are the name, role code, and date of birth of the employee named 'Armani'?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT employee_ID FROM Employees WHERE employee_name = \"Ebba\"", "question": "What is the id for the employee called Ebba?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT employee_ID FROM Employees WHERE employee_name = \"Ebba\"", "question": "Show the id of the employee named Ebba.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT employee_name FROM Employees WHERE role_code = \"HR\"", "question": "Show the names of all the employees with role \"HR\".", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT employee_name FROM Employees WHERE role_code = \"HR\"", "question": "Which employees have the role with code \"HR\"? Find their names.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT role_code , count(*) FROM Employees GROUP BY role_code", "question": "Show all role codes and the number of employees in each role.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT role_code , count(*) FROM Employees GROUP BY role_code", "question": "What is the code of each role and the number of employees in each role?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) DESC LIMIT 1", "question": "What is the role code with the largest number of employees?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) DESC LIMIT 1", "question": "Find the code of the role that have the most employees.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT role_code FROM Employees GROUP BY role_code HAVING count(*) >= 3", "question": "Show all role codes with at least 3 employees.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT role_code FROM Employees GROUP BY role_code HAVING count(*) >= 3", "question": "What are the roles with three or more employees? Give me the role codes.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) ASC LIMIT 1", "question": "Show the role code with the least employees.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) ASC LIMIT 1", "question": "What is the role with the smallest number of employees? Find the role codes.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T2.role_name , T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = \"Ebba\"", "question": "What is the role name and role description for employee called Ebba?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T2.role_name , T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = \"Ebba\"", "question": "Show the name and description of the role played by the employee named Ebba.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = \"Editor\"", "question": "Show the names of employees with role name Editor.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = \"Editor\"", "question": "Find the names of all the employees whose the role name is \"Editor\".", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = \"Human Resource\" OR T2.role_name = \"Manager\"", "question": "Show the employee ids for all employees with role name \"Human Resource\" or \"Manager\".", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = \"Human Resource\" OR T2.role_name = \"Manager\"", "question": "What are the employee ids of the employees whose role name is \"Human Resource\" or \"Manager\"?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT DISTINCT location_code FROM Document_locations", "question": "What are the different location codes for documents?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT DISTINCT location_code FROM Document_locations", "question": "Give me all the distinct location codes for documents.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T3.location_name FROM All_documents AS T1 JOIN Document_locations AS T2 ON T1.document_id = T2.document_id JOIN Ref_locations AS T3 ON T2.location_code = T3.location_code WHERE T1.document_name = \"Robin CV\"", "question": "Show the location name for document \"Robin CV\".", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T3.location_name FROM All_documents AS T1 JOIN Document_locations AS T2 ON T1.document_id = T2.document_id JOIN Ref_locations AS T3 ON T2.location_code = T3.location_code WHERE T1.document_name = \"Robin CV\"", "question": "What is the location name of the document \"Robin CV\"?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT location_code , date_in_location_from , date_in_locaton_to FROM Document_locations", "question": "Show the location code, the starting date and ending data in that location for all the documents.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT location_code , date_in_location_from , date_in_locaton_to FROM Document_locations", "question": "What are each document's location code, and starting date and ending data in that location?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T1.date_in_location_from , T1.date_in_locaton_to FROM Document_locations AS T1 JOIN All_documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = \"Robin CV\"", "question": "What is \"the date in location from\" and \"the date in location to\" for the document with name \"Robin CV\"?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T1.date_in_location_from , T1.date_in_locaton_to FROM Document_locations AS T1 JOIN All_documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = \"Robin CV\"", "question": "Find the starting date and ending data in location for the document named \"Robin CV\".", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT location_code , count(*) FROM Document_locations GROUP BY location_code", "question": "Show the location codes and the number of documents in each location.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT location_code , count(*) FROM Document_locations GROUP BY location_code", "question": "What is the code of each location and the number of documents in that location?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT location_code FROM Document_locations GROUP BY location_code ORDER BY count(*) DESC LIMIT 1", "question": "What is the location code with the most documents?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT location_code FROM Document_locations GROUP BY location_code ORDER BY count(*) DESC LIMIT 1", "question": "Find the code of the location with the largest number of documents.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT location_code FROM Document_locations GROUP BY location_code HAVING count(*) >= 3", "question": "Show the location codes with at least 3 documents.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT location_code FROM Document_locations GROUP BY location_code HAVING count(*) >= 3", "question": "What are the codes of the locations with at least three documents?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T2.location_name , T1.location_code FROM Document_locations AS T1 JOIN Ref_locations AS T2 ON T1.location_code = T2.location_code GROUP BY T1.location_code ORDER BY count(*) ASC LIMIT 1", "question": "Show the location name and code with the least documents.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T2.location_name , T1.location_code FROM Document_locations AS T1 JOIN Ref_locations AS T2 ON T1.location_code = T2.location_code GROUP BY T1.location_code ORDER BY count(*) ASC LIMIT 1", "question": "What are the name and code of the location with the smallest number of documents?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T2.employee_name , T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id;", "question": "What are the names of the employees who authorised the destruction and the employees who destroyed the corresponding documents?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT T2.employee_name , T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id;", "question": "List the names of the employees who authorized the destruction of documents and the employees who destroyed the corresponding documents.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT Destruction_Authorised_by_Employee_ID , count(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID", "question": "Show the id of each employee and the number of document destruction authorised by that employee.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT Destruction_Authorised_by_Employee_ID , count(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID", "question": "What are the id of each employee and the number of document destruction authorised by that employee?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT Destroyed_by_Employee_ID , count(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID", "question": "Show the employee ids and the number of documents destroyed by each employee.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT Destroyed_by_Employee_ID , count(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID", "question": "What are the id of each employee and the number of document destroyed by that employee?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed", "question": "Show the ids of the employees who don't authorize destruction for any document.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed", "question": "Which employees do not authorize destruction for any document? Give me their employee ids.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed", "question": "Show the ids of all employees who have authorized destruction.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed", "question": "What are the ids of all the employees who authorize document destruction?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT DISTINCT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed", "question": "Show the ids of all employees who have destroyed a document.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT DISTINCT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed", "question": "What are the ids of all the employees who have destroyed documents?", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed", "question": "Show the ids of all employees who don't destroy any document.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed", "question": "Which employees do not destroy any document? Find their employee ids.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed UNION SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed", "question": "Show the ids of all employees who have either destroyed a document or made an authorization to do this.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed UNION SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed", "question": "Which employees have either destroyed a document or made an authorization to do so? Return their employee ids.", "schema": "Ref_Document_Types: Document_Type_Code (CHAR(15)), Document_Type_Name (VARCHAR(255)), Document_Type_Description (VARCHAR(255))\nRef_Calendar: Calendar_Date (DATETIME), Day_Number (INTEGER)\nRef_Locations: Location_Code (CHAR(15)), Location_Name (VARCHAR(255)), Location_Description (VARCHAR(255))\nRoles: Role_Code (CHAR(15)), Role_Name (VARCHAR(255)), Role_Description (VARCHAR(255))\nAll_Documents: Document_ID (INTEGER), Date_Stored (DATETIME), Document_Type_Code (CHAR(15)), Document_Name (CHAR(255)), Document_Description (CHAR(255)), Other_Details (VARCHAR(255))\nEmployees: Employee_ID (INTEGER), Role_Code (CHAR(15)), Employee_Name (VARCHAR(255)), Gender_MFU (CHAR(1)), Date_of_Birth (DATETIME), Other_Details (VARCHAR(255))\nDocument_Locations: Document_ID (INTEGER), Location_Code (CHAR(15)), Date_in_Location_From (DATETIME), Date_in_Locaton_To (DATETIME)\nDocuments_to_be_Destroyed: Document_ID (INTEGER), Destruction_Authorised_by_Employee_ID (INTEGER), Destroyed_by_Employee_ID (INTEGER), Planned_Destruction_Date (DATETIME), Actual_Destruction_Date (DATETIME), Other_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM club", "question": "How many clubs are there?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM club", "question": "Count the total number of clubs.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT clubname FROM club", "question": "What are the names of all clubs?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT clubname FROM club", "question": "Give me the name of each club.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM student", "question": "How many students are there?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM student", "question": "Count the total number of students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT DISTINCT fname FROM student", "question": "What are the first names of all the students?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT DISTINCT fname FROM student", "question": "Find each student's first name.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\"", "question": "Find the last names of the members of the club \"Bootup Baltimore\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\"", "question": "Who are the members of the club named \"Bootup Baltimore\"? Give me their last names.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Hopkins Student Enterprises\"", "question": "Who are the members of the club named \"Hopkins Student Enterprises\"? Show the last name.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Hopkins Student Enterprises\"", "question": "Return the last name for the members of the club named \"Hopkins Student Enterprises\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Tennis Club\"", "question": "How many members does the club \"Tennis Club\" has?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Tennis Club\"", "question": "Count the members of the club \"Tennis Club\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Pen and Paper Gaming\"", "question": "Find the number of members of club \"Pen and Paper Gaming\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Pen and Paper Gaming\"", "question": "How many people have membership in the club \"Pen and Paper Gaming\"?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = \"Linda\" AND t3.lname = \"Smith\"", "question": "How many clubs does \"Linda Smith\" belong to?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = \"Linda\" AND t3.lname = \"Smith\"", "question": "How many clubs does \"Linda Smith\" have membership for?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = \"Tracy\" AND t3.lname = \"Kim\"", "question": "Find the number of clubs where \"Tracy Kim\" is a member.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = \"Tracy\" AND t3.lname = \"Kim\"", "question": "For how many clubs is \"Tracy Kim\" a member?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\" AND t3.sex = \"F\"", "question": "Find all the female members of club \"Bootup Baltimore\". Show the first name and last name.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\" AND t3.sex = \"F\"", "question": "Give me the first name and last name for all the female members of the club \"Bootup Baltimore\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Hopkins Student Enterprises\" AND t3.sex = \"M\"", "question": "Find all the male members of club \"Hopkins Student Enterprises\". Show the first name and last name.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Hopkins Student Enterprises\" AND t3.sex = \"M\"", "question": "What are the first name and last name of each male member in club \"Hopkins Student Enterprises\"?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\" AND t3.major = \"600\"", "question": "Find all members of \"Bootup Baltimore\" whose major is \"600\". Show the first name and last name.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\" AND t3.major = \"600\"", "question": "Which members of \"Bootup Baltimore\" major in \"600\"? Give me their first names and last names.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = \"600\" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1", "question": "Which club has the most members majoring in \"600\"?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = \"600\" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1", "question": "Find the club which has the largest number of members majoring in \"600\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = \"F\" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1", "question": "Find the name of the club that has the most female students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = \"F\" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1", "question": "Which club has the most female students as their members? Give me the name of the club.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT clubdesc FROM club WHERE clubname = \"Tennis Club\"", "question": "What is the description of the club named \"Tennis Club\"?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT clubdesc FROM club WHERE clubname = \"Tennis Club\"", "question": "Find the description of the club called \"Tennis Club\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT clubdesc FROM club WHERE clubname = \"Pen and Paper Gaming\"", "question": "Find the description of the club \"Pen and Paper Gaming\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT clubdesc FROM club WHERE clubname = \"Pen and Paper Gaming\"", "question": "What is the description of the club \"Pen and Paper Gaming\"?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT clublocation FROM club WHERE clubname = \"Tennis Club\"", "question": "What is the location of the club named \"Tennis Club\"?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT clublocation FROM club WHERE clubname = \"Tennis Club\"", "question": "Where us the club named \"Tennis Club\" located?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT clublocation FROM club WHERE clubname = \"Pen and Paper Gaming\"", "question": "Find the location of the club \"Pen and Paper Gaming\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT clublocation FROM club WHERE clubname = \"Pen and Paper Gaming\"", "question": "Where is the club \"Pen and Paper Gaming\" located?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT clublocation FROM club WHERE clubname = \"Hopkins Student Enterprises\"", "question": "Where is the club \"Hopkins Student Enterprises\" located?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT clublocation FROM club WHERE clubname = \"Hopkins Student Enterprises\"", "question": "Tell me the location of the club \"Hopkins Student Enterprises\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT clubname FROM club WHERE clublocation = \"AKW\"", "question": "Find the name of all the clubs at \"AKW\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT clubname FROM club WHERE clublocation = \"AKW\"", "question": "Which clubs are located at \"AKW\"? Return the club names.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM club WHERE clublocation = \"HHH\"", "question": "How many clubs are located at \"HHH\"?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM club WHERE clublocation = \"HHH\"", "question": "Count the number of clubs located at \"HHH\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\" AND t2.position = \"President\"", "question": "What are the first and last name of the president of the club \"Bootup Baltimore\"?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\" AND t2.position = \"President\"", "question": "Who is the president of the club \"Bootup Baltimore\"? Give me the first and last name.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Hopkins Student Enterprises\" AND t2.position = \"CTO\"", "question": "Who is the \"CTO\" of club \"Hopkins Student Enterprises\"? Show the first name and last name.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Hopkins Student Enterprises\" AND t2.position = \"CTO\"", "question": "Find the first name and last name for the \"CTO\" of the club \"Hopkins Student Enterprises\"?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = \"Bootup Baltimore\"", "question": "How many different roles are there in the club \"Bootup Baltimore\"?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = \"Bootup Baltimore\"", "question": "Count the number of different positions in the club \"Bootup Baltimore\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\" AND t3.age > 18", "question": "How many members of \"Bootup Baltimore\" are older than 18?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\" AND t3.age > 18", "question": "Count the number of members in club \"Bootup Baltimore\" whose age is above 18.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\" AND t3.age < 18", "question": "How many members of club \"Bootup Baltimore\" are younger than 18?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\" AND t3.age < 18", "question": "Count the number of members in club \"Bootup Baltimore\" whose age is below 18.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = \"BAL\"", "question": "Find the names of all the clubs that have at least a member from the city with city code \"BAL\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = \"BAL\"", "question": "Which clubs have one or more members from the city with code \"BAL\"? Give me the names of the clubs.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = \"HOU\"", "question": "Find the names of the clubs that have at least a member from the city with city code \"HOU\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = \"HOU\"", "question": "Which clubs have one or more members from the city with code \"HOU\"? Give me the names of the clubs.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(DISTINCT t1.clubname) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = \"Eric\" AND t3.lname = \"Tai\"", "question": "How many clubs does the student named \"Eric Tai\" belong to?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT count(DISTINCT t1.clubname) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = \"Eric\" AND t3.lname = \"Tai\"", "question": "Count the number of clubs for which the student named \"Eric Tai\" is a member.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = \"Davis\" AND t3.lname = \"Steven\"", "question": "List the clubs having \"Davis Steven\" as a member.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = \"Davis\" AND t3.lname = \"Steven\"", "question": "What are the names of the clubs that have \"Davis Steven\" as a member?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121", "question": "List the clubs that have at least a member with advisor \"1121\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121", "question": "Which clubs have one or more members whose advisor is \"1121\"?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\"", "question": "What is the average age of the members of the club \"Bootup Baltimore\"?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\"", "question": "Find the average age of the members in the club \"Bootup Baltimore\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Hopkins Student Enterprises\"", "question": "Find the average age of members of the club \"Hopkins Student Enterprises\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Hopkins Student Enterprises\"", "question": "On average, how old are the members in the club \"Hopkins Student Enterprises\"?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Tennis Club\"", "question": "Retrieve the average age of members of the club \"Tennis Club\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Tennis Club\"", "question": "Compute the average age of the members in the club \"Tennis Club\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nClub: ClubID (INTEGER), ClubName (VARCHAR(40)), ClubDesc (VARCHAR(1024)), ClubLocation (VARCHAR(40))\nMember_of_club: StuID (INTEGER), ClubID (INTEGER), Position (VARCHAR(40))" }, { "query": "SELECT T1.grant_amount FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id WHERE T2.sent_date < '1986-08-26 20:49:27' INTERSECT SELECT grant_amount FROM grants WHERE grant_end_date > '1989-03-16 18:27:16'", "question": "What are the distinct grant amount for the grants where the documents were sent before '1986-08-26 20:49:27' and grant were ended after '1989-03-16 18:27:16'?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.grant_amount FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id WHERE T2.sent_date < '1986-08-26 20:49:27' INTERSECT SELECT grant_amount FROM grants WHERE grant_end_date > '1989-03-16 18:27:16'", "question": "What are the different grant amounts for documents sent before '1986-08-26 20:49:27' and after the grant ended on '1989-03-16 18:27:16'?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Paper' INTERSECT SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Patent'", "question": "List the project details of the project both producing patent and paper as outcomes.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Paper' INTERSECT SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Patent'", "question": "What are the details of the project that is producing both patents and papers as outcomes?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT sum(grant_amount) FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id JOIN organisation_Types AS T3 ON T2.organisation_type = T3.organisation_type WHERE T3.organisation_type_description = 'Research'", "question": "What is the total grant amount of the organisations described as research?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT sum(grant_amount) FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id JOIN organisation_Types AS T3 ON T2.organisation_type = T3.organisation_type WHERE T3.organisation_type_description = 'Research'", "question": "What is the total amount of grant money for research?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT date_from , date_to FROM Project_Staff WHERE project_id IN( SELECT project_id FROM Project_Staff GROUP BY project_id ORDER BY count(*) DESC LIMIT 1 ) UNION SELECT date_from , date_to FROM Project_Staff WHERE role_code = 'leader'", "question": "List from which date and to which date these staff work: project staff of the project which hires the most staffs", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT date_from , date_to FROM Project_Staff WHERE project_id IN( SELECT project_id FROM Project_Staff GROUP BY project_id ORDER BY count(*) DESC LIMIT 1 ) UNION SELECT date_from , date_to FROM Project_Staff WHERE role_code = 'leader'", "question": "From what date and to what date do the staff work on a project that has the most staff and has staff in a leader role?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T2.organisation_id , T2.organisation_details FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_id HAVING sum(T1.grant_amount) > 6000", "question": "Find the organisation ids and details of the organisations which are involved in", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T2.organisation_id , T2.organisation_details FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_id HAVING sum(T1.grant_amount) > 6000", "question": "What are the ids and details for all organizations that have grants of more than 6000 dollars?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.organisation_type , T1.organisation_id FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the organisation type and id of the organisation which has the most number of research staff?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.organisation_type , T1.organisation_id FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the type and id of the organization that has the most research staff?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.organisation_type FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_type ORDER BY count(*) DESC LIMIT 1", "question": "Which organisation type hires most research staff?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.organisation_type FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_type ORDER BY count(*) DESC LIMIT 1", "question": "What is the type of the organization with the most research staff?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.sent_date FROM documents AS T1 JOIN Grants AS T2 ON T1.grant_id = T2.grant_id JOIN Organisations AS T3 ON T2.organisation_id = T3.organisation_id JOIN organisation_Types AS T4 ON T3.organisation_type = T4.organisation_type WHERE T2.grant_amount > 5000 AND T4.organisation_type_description = 'Research'", "question": "Find out the send dates of the documents with the grant amount of more than 5000 were granted by organisation type described", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.sent_date FROM documents AS T1 JOIN Grants AS T2 ON T1.grant_id = T2.grant_id JOIN Organisations AS T3 ON T2.organisation_id = T3.organisation_id JOIN organisation_Types AS T4 ON T3.organisation_type = T4.organisation_type WHERE T2.grant_amount > 5000 AND T4.organisation_type_description = 'Research'", "question": "What are the send dates for all documents that have a grant amount of more than 5000 and are involved in research?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100", "question": "What are the response received dates for the documents described as 'Regular' or granted with more than 100?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100", "question": "What is the response received date for the document described as Regular that was granted more than 100 dollars?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT project_details FROM Projects WHERE project_id NOT IN ( SELECT project_id FROM Project_Staff WHERE role_code = 'researcher' )", "question": "List the project details of the projects which did not hire any staff for a researcher role.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT project_details FROM Projects WHERE project_id NOT IN ( SELECT project_id FROM Project_Staff WHERE role_code = 'researcher' )", "question": "What are the details for all projects that did not hire any staff in a research role?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.task_details , T1.task_id , T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details , T1.task_id , T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING count(*) > 2", "question": "What are the task details, task id and project id for the projects which are detailed as 'omnis' or have more than 2 outcomes?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.task_details , T1.task_id , T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details , T1.task_id , T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING count(*) > 2", "question": "What are the task details, task ids, and project ids for the progrects that are detailed as 'omnis' or have at least 3 outcomes?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT date_from , date_to FROM Project_Staff WHERE role_code = 'researcher'", "question": "When do all the researcher role staff start to work, and when do they stop working?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT date_from , date_to FROM Project_Staff WHERE role_code = 'researcher'", "question": "When did researchers start and stop working?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT count(DISTINCT role_code) FROM Project_Staff", "question": "How many kinds of roles are there for the staff?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT count(DISTINCT role_code) FROM Project_Staff", "question": "How many different roles are there on the project staff?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT sum(grant_amount) , organisation_id FROM Grants GROUP BY organisation_id", "question": "What is the total amount of grants given by each organisations? Also list the organisation id.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT sum(grant_amount) , organisation_id FROM Grants GROUP BY organisation_id", "question": "What is the total amount of grant money given to each organization and what is its id?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%'", "question": "List the project details of the projects with the research outcome described with the substring 'Published'.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%'", "question": "What are the details for the project whose research has been published?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.project_id , count(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY count(*) ASC", "question": "How many staff does each project has? List the project id and the number in an ascending order.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.project_id , count(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY count(*) ASC", "question": "For each project id, how many staff does it have? List them in increasing order.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT role_description FROM Staff_Roles WHERE role_code = 'researcher'", "question": "What is the complete description of the researcher role.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT role_description FROM Staff_Roles WHERE role_code = 'researcher'", "question": "What is the complete description of the job of a researcher?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT date_from FROM Project_Staff ORDER BY date_from ASC LIMIT 1", "question": "When did the first staff for the projects started working?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT date_from FROM Project_Staff ORDER BY date_from ASC LIMIT 1", "question": "When did the first staff member start working?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.project_details , T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY count(*) DESC LIMIT 1", "question": "Which project made the most number of outcomes? List the project details and the project id.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.project_details , T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY count(*) DESC LIMIT 1", "question": "What are the details and id of the project with the most outcomes?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT project_details FROM Projects WHERE project_id NOT IN ( SELECT project_id FROM Project_outcomes )", "question": "Which projects have no outcome? List the project details.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT project_details FROM Projects WHERE project_id NOT IN ( SELECT project_id FROM Project_outcomes )", "question": "What are the details of the project with no outcomes?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.organisation_id , T1.organisation_type , T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY count(*) DESC LIMIT 1", "question": "Which organisation hired the most number of research staff? List the organisation id, type and detail.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.organisation_id , T1.organisation_type , T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY count(*) DESC LIMIT 1", "question": "What are the ids, types, and details of the organization with the most research staff?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.role_description , T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code = T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY count(*) DESC LIMIT 1", "question": "Show the role description and the id of the project staff involved in most number of project outcomes?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.role_description , T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code = T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY count(*) DESC LIMIT 1", "question": "For each staff id, what is the description of the role that is involved with the most number of projects?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%'", "question": "Which document type is described with the prefix 'Initial'?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%'", "question": "What is the type of the document whose description starts with the word 'Initial'?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Initial Application'", "question": "For grants with both documents described as 'Regular' and documents described as 'Initial Application', list its start date.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Initial Application'", "question": "For grants that have descriptions of Regular and Initial Applications, what are their start dates?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT grant_id , count(*) FROM Documents GROUP BY grant_id ORDER BY count(*) DESC LIMIT 1", "question": "How many documents can one grant have at most? List the grant id and number.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT grant_id , count(*) FROM Documents GROUP BY grant_id ORDER BY count(*) DESC LIMIT 1", "question": "For each grant id, how many documents does it have, and which one has the most?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_details = 'quo'", "question": "Find the organisation type description of the organisation detailed as 'quo'.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_details = 'quo'", "question": "What is the type description of the organization whose detail is listed as 'quo'?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details", "question": "What are all the details of the organisations described as 'Sponsor'? Sort the result in an ascending order.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details", "question": "What are the details of all organizations that are described as Sponsors and sort the results in ascending order?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT count(*) FROM Project_outcomes WHERE outcome_code = 'Patent'", "question": "How many Patent outcomes are generated from all the projects?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT count(*) FROM Project_outcomes WHERE outcome_code = 'Patent'", "question": "How many patents outcomes were listed for all the projects?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT count(*) FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54'", "question": "How many project staff worked as leaders or started working before '1989-04-24 23:51:54'?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT count(*) FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54'", "question": "How many project members were leaders or started working before '1989-04-24 23:51:54'?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1", "question": "What is the last date of the staff leaving the projects?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1", "question": "What is the last date that a staff member left a project?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN Projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint'", "question": "What are the result description of the project whose detail is 'sint'?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN Projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint'", "question": "What is the description for the results whose project detail is 'sint'?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.organisation_id , count(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY count(*) DESC LIMIT 1", "question": "List the organisation id with the maximum outcome count, and the count.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.organisation_id , count(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the id of the organization with the maximum number of outcomes and how many outcomes are there?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT project_details FROM Projects WHERE organisation_id IN ( SELECT organisation_id FROM Projects GROUP BY organisation_id ORDER BY count(*) DESC LIMIT 1 )", "question": "List the project details of the projects launched by the organisation", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT project_details FROM Projects WHERE organisation_id IN ( SELECT organisation_id FROM Projects GROUP BY organisation_id ORDER BY count(*) DESC LIMIT 1 )", "question": "What are the details for the projects which were launched by the organization with the most projects?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT staff_details FROM Research_Staff ORDER BY staff_details ASC", "question": "List the research staff details, and order in ascending order.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT staff_details FROM Research_Staff ORDER BY staff_details ASC", "question": "What details are there on the research staff? List the result in ascending alphabetical order.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT count(*) FROM Tasks", "question": "How many tasks are there in total?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT count(*) FROM Tasks", "question": "How many tasks are there?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT count(*) , T1.project_details FROM Projects AS T1 JOIN Tasks AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id", "question": "How many tasks does each project have? List the task count and the project detail.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT count(*) , T1.project_details FROM Projects AS T1 JOIN Tasks AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id", "question": "For each project id, how many tasks are there?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT role_code FROM Project_Staff WHERE date_from > '2003-04-19 15:06:20' AND date_to < '2016-03-15 00:33:18'", "question": "What are the staff roles of the staff who", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT role_code FROM Project_Staff WHERE date_from > '2003-04-19 15:06:20' AND date_to < '2016-03-15 00:33:18'", "question": "What roles did staff members play between '2003-04-19 15:06:20' and '2016-03-15 00:33:18'?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code", "question": "What are the descriptions of all the project outcomes?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code", "question": "List the description of the outcomes for all projects.", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT role_code FROM Project_Staff GROUP BY role_code ORDER BY count(*) DESC LIMIT 1", "question": "Which role is most common for the staff?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT role_code FROM Project_Staff GROUP BY role_code ORDER BY count(*) DESC LIMIT 1", "question": "What is the most common role for the staff?", "schema": "Document_Types: document_type_code (VARCHAR(10)), document_description (VARCHAR(255))\nDocuments: document_id (INTEGER), document_type_code (VARCHAR(10)), grant_id (INTEGER), sent_date (DATETIME), response_received_date (DATETIME), other_details (VARCHAR(255))\nGrants: grant_id (INTEGER), organisation_id (INTEGER), grant_start_date (DATETIME), grant_end_date (DATETIME), other_details (VARCHAR(255))\nOrganisation_Types: organisation_type (VARCHAR(10)), organisation_type_description (VARCHAR(255))\nOrganisations: organisation_id (INTEGER), organisation_type (VARCHAR(10)), organisation_details (VARCHAR(255))\nProject_Outcomes: project_id (INTEGER), outcome_code (VARCHAR(10)), outcome_details (VARCHAR(255))\nProject_Staff: staff_id (DOUBLE), project_id (INTEGER), role_code (VARCHAR(10)), date_from (DATETIME), date_to (DATETIME), other_details (VARCHAR(255))\nProjects: project_id (INTEGER), organisation_id (INTEGER), project_details (VARCHAR(255))\nResearch_Outcomes: outcome_code (VARCHAR(10)), outcome_description (VARCHAR(255))\nResearch_Staff: staff_id (INTEGER), employer_organisation_id (INTEGER), staff_details (VARCHAR(255))\nStaff_Roles: role_code (VARCHAR(10)), role_description (VARCHAR(255))\nTasks: task_id (INTEGER), project_id (INTEGER), task_details (VARCHAR(255)), eg (AGREE)" }, { "query": "SELECT count(T2.friend) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Dan'", "question": "How many friends does Dan have?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(T2.friend) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Dan'", "question": "How many friends does Dan have?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(*) FROM Person WHERE gender = 'female'", "question": "How many females does this network has?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(*) FROM Person WHERE gender = 'female'", "question": "How many females are in the network?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT avg(age) FROM Person", "question": "What is the average age for all person?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT avg(age) FROM Person", "question": "What is the average age for all people in the table?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(DISTINCT city) FROM Person", "question": "How many different cities are they from?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(DISTINCT city) FROM Person", "question": "How many different cities do people originate from?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(DISTINCT job) FROM Person", "question": "How many type of jobs do they have?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(DISTINCT job) FROM Person", "question": "How many different jobs are listed?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM Person WHERE age = (SELECT max(age) FROM person)", "question": "Who is the oldest person?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM Person WHERE age = (SELECT max(age) FROM person)", "question": "What is the name of the person who is the oldest?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM Person WHERE job = 'student' AND age = (SELECT max(age) FROM person WHERE job = 'student' )", "question": "Who is the oldest person whose job is student?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM Person WHERE job = 'student' AND age = (SELECT max(age) FROM person WHERE job = 'student' )", "question": "What is the name of the oldest student?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT min(age) FROM person WHERE gender = 'male' )", "question": "Who is the youngest male?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT min(age) FROM person WHERE gender = 'male' )", "question": "What is the name of the youngest male?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach'", "question": "How old is the doctor named Zach?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach'", "question": "What is the age of the doctor named Zach?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM Person WHERE age < 30", "question": "Who is the person whose age is below 30?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM Person WHERE age < 30", "question": "What is the name of the person whose age is below 30?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(*) FROM Person WHERE age > 30 AND job = 'engineer'", "question": "How many people whose age is greater 30 and job is engineer?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(*) FROM Person WHERE age > 30 AND job = 'engineer'", "question": "HOw many engineers are older than 30?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT avg(age) , gender FROM Person GROUP BY gender", "question": "What is the average age for each gender?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT avg(age) , gender FROM Person GROUP BY gender", "question": "How old is each gender, on average?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT avg(age) , job FROM Person GROUP BY job", "question": "What is average age for different job title?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT avg(age) , job FROM Person GROUP BY job", "question": "How old is the average person for each job?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT avg(age) , job FROM Person WHERE gender = 'male' GROUP BY job", "question": "What is average age of male for different job title?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT avg(age) , job FROM Person WHERE gender = 'male' GROUP BY job", "question": "What is the average age for a male in each job?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT min(age) , job FROM Person GROUP BY job", "question": "What is minimum age for different job title?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT min(age) , job FROM Person GROUP BY job", "question": "How old is the youngest person for each job?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(*) , gender FROM Person WHERE age < 40 GROUP BY gender", "question": "Find the number of people who is under 40 for each gender.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(*) , gender FROM Person WHERE age < 40 GROUP BY gender", "question": "How many people are under 40 for each gender?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM Person WHERE age > (SELECT min(age) FROM person WHERE job = 'engineer') ORDER BY age", "question": "Find the name of people whose age is greater than any engineer sorted by their age.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM Person WHERE age > (SELECT min(age) FROM person WHERE job = 'engineer') ORDER BY age", "question": "What is the name of all the people who are older than at least one engineer? Order them by age.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(*) FROM Person WHERE age > (SELECT max(age) FROM person WHERE job = 'engineer')", "question": "Find the number of people whose age is greater than all engineers.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(*) FROM Person WHERE age > (SELECT max(age) FROM person WHERE job = 'engineer')", "question": "How many people are older than every engineer?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name , job FROM Person ORDER BY name", "question": "list the name, job title of all people ordered by their names.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name , job FROM Person ORDER BY name", "question": "What are the names and job titles of every person ordered alphabetically by name?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM Person ORDER BY age DESC", "question": "Find the names of all person sorted in the descending order using age.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM Person ORDER BY age DESC", "question": "What are the names of everybody sorted by age in descending order?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM Person WHERE gender = 'male' ORDER BY age", "question": "Find the name and age of all males in order of their age.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM Person WHERE gender = 'male' ORDER BY age", "question": "What is the name and age of every male? Order the results by age.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'", "question": "Find the name and age of the person who is a friend of both Dan and Alice.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'", "question": "What are the names and ages of every person who is a friend of both Dan and Alice?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT DISTINCT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'", "question": "Find the name and age of the person who is a friend of Dan or Alice.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT DISTINCT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'", "question": "What are the different names and ages of every friend of either Dan or alice?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)", "question": "Find the name of the person who has friends with age above 40 and under age 30?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)", "question": "What are the names of every person who has a friend over 40 and under 30?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)", "question": "Find the name of the person who has friends with age above 40 but not under age 30?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)", "question": "What are the names of the people who are older 40 but no friends under age 30?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student'", "question": "Find the name of the person who has no student friends.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student'", "question": "What are the names of the people who have no friends who are students?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM PersonFriend GROUP BY name HAVING count(*) = 1", "question": "Find the person who has exactly one friend.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM PersonFriend GROUP BY name HAVING count(*) = 1", "question": "What are the names of everybody who has exactly one friend?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob'", "question": "Who are the friends of Bob?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob'", "question": "Who are Bob's friends?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob'", "question": "Find the name of persons who are friends with Bob.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob'", "question": "What are the names of all of Bob's friends?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female'", "question": "Find the names of females who are friends with Zach", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female'", "question": "What are the names of all females who are friends with Zach?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'", "question": "Find the female friends of Alice.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'", "question": "What are all the friends of Alice who are female?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor'", "question": "Find the male friend of Alice whose job is a doctor?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor'", "question": "Who are the friends of Alice that are doctors?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city'", "question": "Who has a friend that is from new york city?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city'", "question": "What are the names of all friends who are from New York?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT avg(age) FROM person)", "question": "Who has friends that are younger than the average age?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT avg(age) FROM person)", "question": "What are the different names of friends who are younger than the average age for a friend?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT DISTINCT T2.name , T2.friend , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT avg(age) FROM person)", "question": "Who has friends that are older than the average age? Print their friends and their ages as well", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT DISTINCT T2.name , T2.friend , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT avg(age) FROM person)", "question": "Whare the names, friends, and ages of all people who are older than the average age of a person?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')", "question": "Who is the friend of Zach with longest year relationship?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')", "question": "Which friend of Zach has the longest-lasting friendship?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')", "question": "What is the age of the friend of Zach with longest year relationship?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')", "question": "What are the ages of all of Zach's friends who are in the longest relationship?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT min(YEAR) FROM PersonFriend WHERE friend = 'Alice')", "question": "Find the name of persons who are friends with Alice for the shortest years.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT min(YEAR) FROM PersonFriend WHERE friend = 'Alice')", "question": "What are the names of all people who are friends with Alice for the shortest amount of time?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T1.name , T1.age , T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE friend = 'Alice')", "question": "Find the name, age, and job title of persons who are friends with Alice for the longest years.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T1.name , T1.age , T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE friend = 'Alice')", "question": "What are the names, ages, and jobs of all people who are friends with Alice for the longest amount of time?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM person EXCEPT SELECT name FROM PersonFriend", "question": "Who is the person that has no friend?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT name FROM person EXCEPT SELECT name FROM PersonFriend", "question": "What are the names of all people who do not have friends?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T2.name , avg(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY avg(T1.age) DESC LIMIT 1", "question": "Which person whose friends have the oldest average age?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT T2.name , avg(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY avg(T1.age) DESC LIMIT 1", "question": "What is the name of the person who has the oldest average age for their friends, and what is that average age?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE city = 'Austin')", "question": "What is the total number of people who has no friend living in the city of Austin.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE city = 'Austin')", "question": "What is the total number of people who have no friends living in Austin?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name = T2.name JOIN PersonFriend AS T3 ON T1.friend = T3.name JOIN PersonFriend AS T4 ON T3.friend = T4.name WHERE T2.name = 'Alice' AND T4.name != 'Alice'", "question": "Find Alice's friends of friends.", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name = T2.name JOIN PersonFriend AS T3 ON T1.friend = T3.name JOIN PersonFriend AS T4 ON T3.friend = T4.name WHERE T2.name = 'Alice' AND T4.name != 'Alice'", "question": "What are the names of all of Alice's friends of friends?", "schema": "Person: name (VARCHAR(20)), age (INTEGER), city (TEXT), gender (TEXT), job (TEXT)\nPersonFriend: name (VARCHAR(20)), friend (VARCHAR(20)), year (INTEGER)" }, { "query": "SELECT count(*) FROM member", "question": "How many members are there?", "schema": "college: College_ID (INT), Name (TEXT), Leader_Name (TEXT), College_Location (TEXT)\nmember: Member_ID (INT), Name (TEXT), Country (TEXT), College_ID (INT)\nround: Round_ID (INT), Member_ID (INT), Decoration_Theme (TEXT), Rank_in_Round (INT)" }, { "query": "SELECT Name FROM member ORDER BY Name ASC", "question": "List the names of members in ascending alphabetical order.", "schema": "college: College_ID (INT), Name (TEXT), Leader_Name (TEXT), College_Location (TEXT)\nmember: Member_ID (INT), Name (TEXT), Country (TEXT), College_ID (INT)\nround: Round_ID (INT), Member_ID (INT), Decoration_Theme (TEXT), Rank_in_Round (INT)" }, { "query": "SELECT Name , Country FROM member", "question": "What are the names and countries of members?", "schema": "college: College_ID (INT), Name (TEXT), Leader_Name (TEXT), College_Location (TEXT)\nmember: Member_ID (INT), Name (TEXT), Country (TEXT), College_ID (INT)\nround: Round_ID (INT), Member_ID (INT), Decoration_Theme (TEXT), Rank_in_Round (INT)" }, { "query": "SELECT Name FROM member WHERE Country = \"United States\" OR Country = \"Canada\"", "question": "Show the names of members whose country is \"United States\" or \"Canada\".", "schema": "college: College_ID (INT), Name (TEXT), Leader_Name (TEXT), College_Location (TEXT)\nmember: Member_ID (INT), Name (TEXT), Country (TEXT), College_ID (INT)\nround: Round_ID (INT), Member_ID (INT), Decoration_Theme (TEXT), Rank_in_Round (INT)" }, { "query": "SELECT Country , COUNT(*) FROM member GROUP BY Country", "question": "Show the different countries and the number of members from each.", "schema": "college: College_ID (INT), Name (TEXT), Leader_Name (TEXT), College_Location (TEXT)\nmember: Member_ID (INT), Name (TEXT), Country (TEXT), College_ID (INT)\nround: Round_ID (INT), Member_ID (INT), Decoration_Theme (TEXT), Rank_in_Round (INT)" }, { "query": "SELECT Country FROM member GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the most common country across members.", "schema": "college: College_ID (INT), Name (TEXT), Leader_Name (TEXT), College_Location (TEXT)\nmember: Member_ID (INT), Name (TEXT), Country (TEXT), College_ID (INT)\nround: Round_ID (INT), Member_ID (INT), Decoration_Theme (TEXT), Rank_in_Round (INT)" }, { "query": "SELECT Country FROM member GROUP BY Country HAVING COUNT(*) > 2", "question": "Which countries have more than two members?", "schema": "college: College_ID (INT), Name (TEXT), Leader_Name (TEXT), College_Location (TEXT)\nmember: Member_ID (INT), Name (TEXT), Country (TEXT), College_ID (INT)\nround: Round_ID (INT), Member_ID (INT), Decoration_Theme (TEXT), Rank_in_Round (INT)" }, { "query": "SELECT Leader_Name , College_Location FROM college", "question": "Show the leader names and locations of colleges.", "schema": "college: College_ID (INT), Name (TEXT), Leader_Name (TEXT), College_Location (TEXT)\nmember: Member_ID (INT), Name (TEXT), Country (TEXT), College_ID (INT)\nround: Round_ID (INT), Member_ID (INT), Decoration_Theme (TEXT), Rank_in_Round (INT)" }, { "query": "SELECT T2.Name , T1.Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID", "question": "Show the names of members and names of colleges they go to.", "schema": "college: College_ID (INT), Name (TEXT), Leader_Name (TEXT), College_Location (TEXT)\nmember: Member_ID (INT), Name (TEXT), Country (TEXT), College_ID (INT)\nround: Round_ID (INT), Member_ID (INT), Decoration_Theme (TEXT), Rank_in_Round (INT)" }, { "query": "SELECT T2.Name , T1.College_Location FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID ORDER BY T2.Name ASC", "question": "Show the names of members and the locations of colleges they go to in ascending alphabetical order of member names.", "schema": "college: College_ID (INT), Name (TEXT), Leader_Name (TEXT), College_Location (TEXT)\nmember: Member_ID (INT), Name (TEXT), Country (TEXT), College_ID (INT)\nround: Round_ID (INT), Member_ID (INT), Decoration_Theme (TEXT), Rank_in_Round (INT)" }, { "query": "SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID WHERE T2.Country = \"Canada\"", "question": "Show the distinct leader names of colleges associated with members from country \"Canada\".", "schema": "college: College_ID (INT), Name (TEXT), Leader_Name (TEXT), College_Location (TEXT)\nmember: Member_ID (INT), Name (TEXT), Country (TEXT), College_ID (INT)\nround: Round_ID (INT), Member_ID (INT), Decoration_Theme (TEXT), Rank_in_Round (INT)" }, { "query": "SELECT T1.Name , T2.Decoration_Theme FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID", "question": "Show the names of members and the decoration themes they have.", "schema": "college: College_ID (INT), Name (TEXT), Leader_Name (TEXT), College_Location (TEXT)\nmember: Member_ID (INT), Name (TEXT), Country (TEXT), College_ID (INT)\nround: Round_ID (INT), Member_ID (INT), Decoration_Theme (TEXT), Rank_in_Round (INT)" }, { "query": "SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID WHERE T2.Rank_in_Round > 3", "question": "Show the names of members that have a rank in round higher than 3.", "schema": "college: College_ID (INT), Name (TEXT), Leader_Name (TEXT), College_Location (TEXT)\nmember: Member_ID (INT), Name (TEXT), Country (TEXT), College_ID (INT)\nround: Round_ID (INT), Member_ID (INT), Decoration_Theme (TEXT), Rank_in_Round (INT)" }, { "query": "SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID ORDER BY Rank_in_Round ASC", "question": "Show the names of members in ascending order of their rank in rounds.", "schema": "college: College_ID (INT), Name (TEXT), Leader_Name (TEXT), College_Location (TEXT)\nmember: Member_ID (INT), Name (TEXT), Country (TEXT), College_ID (INT)\nround: Round_ID (INT), Member_ID (INT), Decoration_Theme (TEXT), Rank_in_Round (INT)" }, { "query": "SELECT Name FROM member WHERE Member_ID NOT IN (SELECT Member_ID FROM round)", "question": "List the names of members who did not participate in any round.", "schema": "college: College_ID (INT), Name (TEXT), Leader_Name (TEXT), College_Location (TEXT)\nmember: Member_ID (INT), Name (TEXT), Country (TEXT), College_ID (INT)\nround: Round_ID (INT), Member_ID (INT), Decoration_Theme (TEXT), Rank_in_Round (INT)" }, { "query": "SELECT document_name , access_count FROM documents ORDER BY document_name", "question": "Find the name and access counts of all documents, in alphabetic order of the document name.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_name , access_count FROM documents ORDER BY document_name", "question": "What are the names of all the documents, as well as the access counts of each, ordered alphabetically?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_name , access_count FROM documents ORDER BY access_count DESC LIMIT 1", "question": "Find the name of the document that has been accessed the greatest number of times, as well as the count of how many times it has been accessed?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_name , access_count FROM documents ORDER BY access_count DESC LIMIT 1", "question": "What is the name of the document which has been accessed the most times, as well as the number of times it has been accessed?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 4", "question": "Find the types of documents with more than 4 documents.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 4", "question": "What are the codes of types of documents of which there are for or more?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT sum(access_count) FROM documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1", "question": "Find the total access count of all documents in the most popular document type.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT sum(access_count) FROM documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1", "question": "What is the total access count of documents that are of the most common document type?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT avg(access_count) FROM documents", "question": "What is the average access count of documents?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT avg(access_count) FROM documents", "question": "Find the average access count across all documents?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code = t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY count(*) DESC LIMIT 1", "question": "What is the structure of the document with the least number of accesses?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code = t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY count(*) DESC LIMIT 1", "question": "Return the structure description of the document that has been accessed the fewest number of times.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_type_code FROM documents WHERE document_name = \"David CV\"", "question": "What is the type of the document named \"David CV\"?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_type_code FROM documents WHERE document_name = \"David CV\"", "question": "Return the type code of the document named \"David CV\".", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_name FROM documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 3 INTERSECT SELECT document_name FROM documents GROUP BY document_structure_code ORDER BY count(*) DESC LIMIT 3", "question": "Find the list of documents that are both in the most three popular type and have the most three popular structure.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_name FROM documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 3 INTERSECT SELECT document_name FROM documents GROUP BY document_structure_code ORDER BY count(*) DESC LIMIT 3", "question": "What are the names of documents that have both one of the three most common types and one of three most common structures?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_type_code FROM documents GROUP BY document_type_code HAVING sum(access_count) > 10000", "question": "What document types do have more than 10000 total access number.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_type_code FROM documents GROUP BY document_type_code HAVING sum(access_count) > 10000", "question": "Return the codes of the document types that do not have a total access count of over 10000.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = \"David CV\"", "question": "What are all the section titles of the document named \"David CV\"?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = \"David CV\"", "question": "Give the section titles of the document with the name \"David CV\".", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_name FROM documents WHERE document_code NOT IN (SELECT document_code FROM document_sections)", "question": "Find all the name of documents without any sections.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_name FROM documents WHERE document_code NOT IN (SELECT document_code FROM document_sections)", "question": "What are the names of documents that do not have any sections?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT user_name , password FROM users GROUP BY role_code ORDER BY count(*) DESC LIMIT 1", "question": "List all the username and passwords of users with the most popular role.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT user_name , password FROM users GROUP BY role_code ORDER BY count(*) DESC LIMIT 1", "question": "What are the usernames and passwords of users that have the most common role?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT avg(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = \"Acknowledgement\"", "question": "Find the average access counts of documents with functional area \"Acknowledgement\".", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT avg(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = \"Acknowledgement\"", "question": "What are the average access counts of documents that have the functional area description \"Acknowledgement\"?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id", "question": "Find names of the document without any images.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id", "question": "What are the names of documents that do not have any images?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of the document with the most number of sections?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY count(*) DESC LIMIT 1", "question": "Return the name of the document that has the most sections.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_name FROM documents WHERE document_name LIKE \"%CV%\"", "question": "List all the document names which contains \"CV\".", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_name FROM documents WHERE document_name LIKE \"%CV%\"", "question": "What are the names of documents that contain the substring \"CV\"?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT count(*) FROM users WHERE user_login = 1", "question": "How many users are logged in?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT count(*) FROM users WHERE user_login = 1", "question": "Count the number of users that are logged in.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY count(*) DESC LIMIT 1)", "question": "Find the description of the most popular role among the users that have logged in.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY count(*) DESC LIMIT 1)", "question": "What is the description of the most popular role among users that have logged in?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT avg(access_count) FROM documents GROUP BY document_structure_code ORDER BY count(*) ASC LIMIT 1", "question": "Find the average access count of documents with the least popular structure.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT avg(access_count) FROM documents GROUP BY document_structure_code ORDER BY count(*) ASC LIMIT 1", "question": "What is the average access count of documents that have the least common structure?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT image_name , image_url FROM images ORDER BY image_name", "question": "List all the image name and URLs in the order of their names.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT image_name , image_url FROM images ORDER BY image_name", "question": "What are the names and urls of images, sorted alphabetically?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT count(*) , role_code FROM users GROUP BY role_code", "question": "Find the number of users in each role.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT count(*) , role_code FROM users GROUP BY role_code", "question": "What are the different role codes for users, and how many users have each?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 2", "question": "What document types have more than 2 corresponding documents?", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 2", "question": "Give the codes of document types that have more than 2 corresponding documents.", "schema": "Roles: role_code (VARCHAR(15)), role_description (VARCHAR(80))\nUsers: user_id (INTEGER), role_code (VARCHAR(15)), user_name (VARCHAR(40)), user_login (VARCHAR(40)), password (VARCHAR(40))\nDocument_Structures: document_structure_code (VARCHAR(15)), parent_document_structure_code (VARCHAR(15)), document_structure_description (VARCHAR(80))\nFunctional_Areas: functional_area_code (VARCHAR(15)), parent_functional_area_code (VARCHAR(15)), functional_area_description (VARCHAR(80))\nImages: image_id (INTEGER), image_alt_text (VARCHAR(80)), image_name (VARCHAR(40)), image_url (VARCHAR(255))\nDocuments: document_code (VARCHAR(15)), document_structure_code (VARCHAR(15)), document_type_code (VARCHAR(15)), access_count (INTEGER), document_name (VARCHAR(80))\nDocument_Functional_Areas: document_code (VARCHAR(15)), functional_area_code (VARCHAR(15))\nDocument_Sections: section_id (INTEGER), document_code (VARCHAR(15)), section_sequence (INTEGER), section_code (VARCHAR(20)), section_title (VARCHAR(80))\nDocument_Sections_Images: section_id (INTEGER), image_id (INTEGER)" }, { "query": "SELECT count(*) FROM Companies", "question": "How many companies are there?", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT count(*) FROM Companies", "question": "Count the number of companies.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT name FROM Companies ORDER BY Market_Value_billion DESC", "question": "List the names of companies in descending order of market value.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT name FROM Companies ORDER BY Market_Value_billion DESC", "question": "Sort the company names in descending order of the company's market value.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT name FROM Companies WHERE Headquarters != 'USA'", "question": "What are the names of companies whose headquarters are not \"USA\"?", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT name FROM Companies WHERE Headquarters != 'USA'", "question": "Find the names of the companies whose headquarters are not located in \"USA\".", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT name , Assets_billion FROM Companies ORDER BY name ASC", "question": "What are the name and assets of each company, sorted in ascending order of company name?", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT name , Assets_billion FROM Companies ORDER BY name ASC", "question": "List the name and assets of each company in ascending order of company name.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT avg(Profits_billion) FROM Companies", "question": "What are the average profits of companies?", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT avg(Profits_billion) FROM Companies", "question": "Compute the average profits companies make.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT max(Sales_billion) , min(Sales_billion) FROM Companies WHERE Industry != \"Banking\"", "question": "What are the maximum and minimum sales of the companies whose industries are not \"Banking\".", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT max(Sales_billion) , min(Sales_billion) FROM Companies WHERE Industry != \"Banking\"", "question": "Find the maximum and minimum sales of the companies that are not in the \"Banking\" industry.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT count(DISTINCT Industry) FROM Companies", "question": "How many different industries are the companies in?", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT count(DISTINCT Industry) FROM Companies", "question": "Count the number of distinct company industries.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT name FROM buildings ORDER BY Height DESC", "question": "List the names of buildings in descending order of building height.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT name FROM buildings ORDER BY Height DESC", "question": "What are the names of buildings sorted in descending order of building height?", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1", "question": "Find the stories of the building with the largest height.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1", "question": "What is the stories of highest building?", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT T3.name , T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id", "question": "List the name of a building along with the name of a company whose office is in the building.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT T3.name , T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id", "question": "For each company, return the company name and the name of the building its office is located in.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id HAVING COUNT(*) > 1", "question": "Show the names of the buildings that have more than one company offices.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id HAVING COUNT(*) > 1", "question": "Which buildings have more than one company offices? Give me the building names.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the name of the building that has the most company offices.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1", "question": "Which building has the largest number of company offices? Give me the building name.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT name FROM buildings WHERE Status = \"on-hold\" ORDER BY Stories ASC", "question": "Please show the names of the buildings whose status is \"on-hold\", in ascending order of stories.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT name FROM buildings WHERE Status = \"on-hold\" ORDER BY Stories ASC", "question": "Find the names of the buildings in \"on-hold\" status, and sort them in ascending order of building stories.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT Industry , COUNT(*) FROM Companies GROUP BY Industry", "question": "Please show each industry and the corresponding number of companies in that industry.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT Industry , COUNT(*) FROM Companies GROUP BY Industry", "question": "Whah are the name of each industry and the number of companies in that industry?", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC", "question": "Please show the industries of companies in descending order of the number of companies.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC", "question": "Sort all the industries in descending order of the count of companies in each industry", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1", "question": "List the industry shared by the most companies.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1", "question": "Which industry has the most companies?", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT name FROM buildings WHERE id NOT IN (SELECT building_id FROM Office_locations)", "question": "List the names of buildings that have no company office.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT name FROM buildings WHERE id NOT IN (SELECT building_id FROM Office_locations)", "question": "Which buildings do not have any company office? Give me the building names.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT Industry FROM Companies WHERE Headquarters = \"USA\" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = \"China\"", "question": "Show the industries shared by companies whose headquarters are \"USA\" and companies whose headquarters are \"China\".", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT Industry FROM Companies WHERE Headquarters = \"USA\" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = \"China\"", "question": "Which industries have both companies with headquarter in \"USA\" and companies with headquarter in \"China\"?", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT count(*) FROM Companies WHERE Industry = \"Banking\" OR Industry = \"Conglomerate\"", "question": "Find the number of companies whose industry is \"Banking\" or \"Conglomerate\",", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT count(*) FROM Companies WHERE Industry = \"Banking\" OR Industry = \"Conglomerate\"", "question": "How many companies are in either \"Banking\" industry or \"Conglomerate\" industry?", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT Headquarters FROM Companies GROUP BY Headquarters HAVING COUNT(*) > 2", "question": "Show the headquarters shared by more than two companies.", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT Headquarters FROM Companies GROUP BY Headquarters HAVING COUNT(*) > 2", "question": "Which headquarter locations are used by more than 2 companies?", "schema": "buildings: id (INT), name (TEXT), City (TEXT), Height (INT), Stories (INT), Status (TEXT)\nCompanies: id (INT), name (TEXT), Headquarters (TEXT), Industry (TEXT), Sales_billion (REAL), Profits_billion (REAL), Assets_billion (REAL), Market_Value_billion (TEXT)\nOffice_locations: building_id (INT), company_id (INT), move_in_year (INT)" }, { "query": "SELECT count(*) FROM Products", "question": "How many products are there?", "schema": "Addresses: Address_ID (INTEGER), address_details (VARCHAR(255))\nLocations: Location_ID (INTEGER), Other_Details (VARCHAR(255))\nProducts: Product_ID (INTEGER), Product_Type_Code (CHAR(15)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204))\nParties: Party_ID (INTEGER), Party_Details (VARCHAR(255))\nAssets: Asset_ID (INTEGER), Other_Details (VARCHAR(255))\nChannels: Channel_ID (INTEGER), Other_Details (VARCHAR(255))\nFinances: Finance_ID (INTEGER), Other_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Address_ID (INTEGER), Channel_ID (INTEGER), Event_Type_Code (CHAR(15)), Finance_ID (INTEGER), Location_ID (INTEGER)\nProducts_in_Events: Product_in_Event_ID (INTEGER), Event_ID (INTEGER), Product_ID (INTEGER)\nParties_in_Events: Party_ID (INTEGER), Event_ID (INTEGER), Role_Code (CHAR(15))\nAgreements: Document_ID (INTEGER), Event_ID (INTEGER)\nAssets_in_Events: Asset_ID (INTEGER), Event_ID (INTEGER)" }, { "query": "SELECT Product_Name FROM Products ORDER BY Product_Price ASC", "question": "List the name of products in ascending order of price.", "schema": "Addresses: Address_ID (INTEGER), address_details (VARCHAR(255))\nLocations: Location_ID (INTEGER), Other_Details (VARCHAR(255))\nProducts: Product_ID (INTEGER), Product_Type_Code (CHAR(15)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204))\nParties: Party_ID (INTEGER), Party_Details (VARCHAR(255))\nAssets: Asset_ID (INTEGER), Other_Details (VARCHAR(255))\nChannels: Channel_ID (INTEGER), Other_Details (VARCHAR(255))\nFinances: Finance_ID (INTEGER), Other_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Address_ID (INTEGER), Channel_ID (INTEGER), Event_Type_Code (CHAR(15)), Finance_ID (INTEGER), Location_ID (INTEGER)\nProducts_in_Events: Product_in_Event_ID (INTEGER), Event_ID (INTEGER), Product_ID (INTEGER)\nParties_in_Events: Party_ID (INTEGER), Event_ID (INTEGER), Role_Code (CHAR(15))\nAgreements: Document_ID (INTEGER), Event_ID (INTEGER)\nAssets_in_Events: Asset_ID (INTEGER), Event_ID (INTEGER)" }, { "query": "SELECT Product_Name , Product_Type_Code FROM Products", "question": "What are the names and type codes of products?", "schema": "Addresses: Address_ID (INTEGER), address_details (VARCHAR(255))\nLocations: Location_ID (INTEGER), Other_Details (VARCHAR(255))\nProducts: Product_ID (INTEGER), Product_Type_Code (CHAR(15)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204))\nParties: Party_ID (INTEGER), Party_Details (VARCHAR(255))\nAssets: Asset_ID (INTEGER), Other_Details (VARCHAR(255))\nChannels: Channel_ID (INTEGER), Other_Details (VARCHAR(255))\nFinances: Finance_ID (INTEGER), Other_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Address_ID (INTEGER), Channel_ID (INTEGER), Event_Type_Code (CHAR(15)), Finance_ID (INTEGER), Location_ID (INTEGER)\nProducts_in_Events: Product_in_Event_ID (INTEGER), Event_ID (INTEGER), Product_ID (INTEGER)\nParties_in_Events: Party_ID (INTEGER), Event_ID (INTEGER), Role_Code (CHAR(15))\nAgreements: Document_ID (INTEGER), Event_ID (INTEGER)\nAssets_in_Events: Asset_ID (INTEGER), Event_ID (INTEGER)" }, { "query": "SELECT Product_Price FROM Products WHERE Product_Name = \"Dining\" OR Product_Name = \"Trading Policy\"", "question": "Show the prices of the products named \"Dining\" or \"Trading Policy\".", "schema": "Addresses: Address_ID (INTEGER), address_details (VARCHAR(255))\nLocations: Location_ID (INTEGER), Other_Details (VARCHAR(255))\nProducts: Product_ID (INTEGER), Product_Type_Code (CHAR(15)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204))\nParties: Party_ID (INTEGER), Party_Details (VARCHAR(255))\nAssets: Asset_ID (INTEGER), Other_Details (VARCHAR(255))\nChannels: Channel_ID (INTEGER), Other_Details (VARCHAR(255))\nFinances: Finance_ID (INTEGER), Other_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Address_ID (INTEGER), Channel_ID (INTEGER), Event_Type_Code (CHAR(15)), Finance_ID (INTEGER), Location_ID (INTEGER)\nProducts_in_Events: Product_in_Event_ID (INTEGER), Event_ID (INTEGER), Product_ID (INTEGER)\nParties_in_Events: Party_ID (INTEGER), Event_ID (INTEGER), Role_Code (CHAR(15))\nAgreements: Document_ID (INTEGER), Event_ID (INTEGER)\nAssets_in_Events: Asset_ID (INTEGER), Event_ID (INTEGER)" }, { "query": "SELECT avg(Product_Price) FROM Products", "question": "What is the average price for products?", "schema": "Addresses: Address_ID (INTEGER), address_details (VARCHAR(255))\nLocations: Location_ID (INTEGER), Other_Details (VARCHAR(255))\nProducts: Product_ID (INTEGER), Product_Type_Code (CHAR(15)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204))\nParties: Party_ID (INTEGER), Party_Details (VARCHAR(255))\nAssets: Asset_ID (INTEGER), Other_Details (VARCHAR(255))\nChannels: Channel_ID (INTEGER), Other_Details (VARCHAR(255))\nFinances: Finance_ID (INTEGER), Other_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Address_ID (INTEGER), Channel_ID (INTEGER), Event_Type_Code (CHAR(15)), Finance_ID (INTEGER), Location_ID (INTEGER)\nProducts_in_Events: Product_in_Event_ID (INTEGER), Event_ID (INTEGER), Product_ID (INTEGER)\nParties_in_Events: Party_ID (INTEGER), Event_ID (INTEGER), Role_Code (CHAR(15))\nAgreements: Document_ID (INTEGER), Event_ID (INTEGER)\nAssets_in_Events: Asset_ID (INTEGER), Event_ID (INTEGER)" }, { "query": "SELECT Product_Name FROM Products ORDER BY Product_Price DESC LIMIT 1", "question": "What is the name of the product with the highest price?", "schema": "Addresses: Address_ID (INTEGER), address_details (VARCHAR(255))\nLocations: Location_ID (INTEGER), Other_Details (VARCHAR(255))\nProducts: Product_ID (INTEGER), Product_Type_Code (CHAR(15)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204))\nParties: Party_ID (INTEGER), Party_Details (VARCHAR(255))\nAssets: Asset_ID (INTEGER), Other_Details (VARCHAR(255))\nChannels: Channel_ID (INTEGER), Other_Details (VARCHAR(255))\nFinances: Finance_ID (INTEGER), Other_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Address_ID (INTEGER), Channel_ID (INTEGER), Event_Type_Code (CHAR(15)), Finance_ID (INTEGER), Location_ID (INTEGER)\nProducts_in_Events: Product_in_Event_ID (INTEGER), Event_ID (INTEGER), Product_ID (INTEGER)\nParties_in_Events: Party_ID (INTEGER), Event_ID (INTEGER), Role_Code (CHAR(15))\nAgreements: Document_ID (INTEGER), Event_ID (INTEGER)\nAssets_in_Events: Asset_ID (INTEGER), Event_ID (INTEGER)" }, { "query": "SELECT Product_Type_Code , COUNT(*) FROM Products GROUP BY Product_Type_Code", "question": "Show different type codes of products and the number of products with each type code.", "schema": "Addresses: Address_ID (INTEGER), address_details (VARCHAR(255))\nLocations: Location_ID (INTEGER), Other_Details (VARCHAR(255))\nProducts: Product_ID (INTEGER), Product_Type_Code (CHAR(15)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204))\nParties: Party_ID (INTEGER), Party_Details (VARCHAR(255))\nAssets: Asset_ID (INTEGER), Other_Details (VARCHAR(255))\nChannels: Channel_ID (INTEGER), Other_Details (VARCHAR(255))\nFinances: Finance_ID (INTEGER), Other_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Address_ID (INTEGER), Channel_ID (INTEGER), Event_Type_Code (CHAR(15)), Finance_ID (INTEGER), Location_ID (INTEGER)\nProducts_in_Events: Product_in_Event_ID (INTEGER), Event_ID (INTEGER), Product_ID (INTEGER)\nParties_in_Events: Party_ID (INTEGER), Event_ID (INTEGER), Role_Code (CHAR(15))\nAgreements: Document_ID (INTEGER), Event_ID (INTEGER)\nAssets_in_Events: Asset_ID (INTEGER), Event_ID (INTEGER)" }, { "query": "SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the most common type code across products.", "schema": "Addresses: Address_ID (INTEGER), address_details (VARCHAR(255))\nLocations: Location_ID (INTEGER), Other_Details (VARCHAR(255))\nProducts: Product_ID (INTEGER), Product_Type_Code (CHAR(15)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204))\nParties: Party_ID (INTEGER), Party_Details (VARCHAR(255))\nAssets: Asset_ID (INTEGER), Other_Details (VARCHAR(255))\nChannels: Channel_ID (INTEGER), Other_Details (VARCHAR(255))\nFinances: Finance_ID (INTEGER), Other_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Address_ID (INTEGER), Channel_ID (INTEGER), Event_Type_Code (CHAR(15)), Finance_ID (INTEGER), Location_ID (INTEGER)\nProducts_in_Events: Product_in_Event_ID (INTEGER), Event_ID (INTEGER), Product_ID (INTEGER)\nParties_in_Events: Party_ID (INTEGER), Event_ID (INTEGER), Role_Code (CHAR(15))\nAgreements: Document_ID (INTEGER), Event_ID (INTEGER)\nAssets_in_Events: Asset_ID (INTEGER), Event_ID (INTEGER)" }, { "query": "SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code HAVING COUNT(*) >= 2", "question": "Show the product type codes that have at least two products.", "schema": "Addresses: Address_ID (INTEGER), address_details (VARCHAR(255))\nLocations: Location_ID (INTEGER), Other_Details (VARCHAR(255))\nProducts: Product_ID (INTEGER), Product_Type_Code (CHAR(15)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204))\nParties: Party_ID (INTEGER), Party_Details (VARCHAR(255))\nAssets: Asset_ID (INTEGER), Other_Details (VARCHAR(255))\nChannels: Channel_ID (INTEGER), Other_Details (VARCHAR(255))\nFinances: Finance_ID (INTEGER), Other_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Address_ID (INTEGER), Channel_ID (INTEGER), Event_Type_Code (CHAR(15)), Finance_ID (INTEGER), Location_ID (INTEGER)\nProducts_in_Events: Product_in_Event_ID (INTEGER), Event_ID (INTEGER), Product_ID (INTEGER)\nParties_in_Events: Party_ID (INTEGER), Event_ID (INTEGER), Role_Code (CHAR(15))\nAgreements: Document_ID (INTEGER), Event_ID (INTEGER)\nAssets_in_Events: Asset_ID (INTEGER), Event_ID (INTEGER)" }, { "query": "SELECT Product_Type_Code FROM Products WHERE Product_Price > 4500 INTERSECT SELECT Product_Type_Code FROM Products WHERE Product_Price < 3000", "question": "Show the product type codes that have both products with price higher than 4500 and products with price lower than 3000.", "schema": "Addresses: Address_ID (INTEGER), address_details (VARCHAR(255))\nLocations: Location_ID (INTEGER), Other_Details (VARCHAR(255))\nProducts: Product_ID (INTEGER), Product_Type_Code (CHAR(15)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204))\nParties: Party_ID (INTEGER), Party_Details (VARCHAR(255))\nAssets: Asset_ID (INTEGER), Other_Details (VARCHAR(255))\nChannels: Channel_ID (INTEGER), Other_Details (VARCHAR(255))\nFinances: Finance_ID (INTEGER), Other_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Address_ID (INTEGER), Channel_ID (INTEGER), Event_Type_Code (CHAR(15)), Finance_ID (INTEGER), Location_ID (INTEGER)\nProducts_in_Events: Product_in_Event_ID (INTEGER), Event_ID (INTEGER), Product_ID (INTEGER)\nParties_in_Events: Party_ID (INTEGER), Event_ID (INTEGER), Role_Code (CHAR(15))\nAgreements: Document_ID (INTEGER), Event_ID (INTEGER)\nAssets_in_Events: Asset_ID (INTEGER), Event_ID (INTEGER)" }, { "query": "SELECT T1.Product_Name , COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name", "question": "Show the names of products and the number of events they are in.", "schema": "Addresses: Address_ID (INTEGER), address_details (VARCHAR(255))\nLocations: Location_ID (INTEGER), Other_Details (VARCHAR(255))\nProducts: Product_ID (INTEGER), Product_Type_Code (CHAR(15)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204))\nParties: Party_ID (INTEGER), Party_Details (VARCHAR(255))\nAssets: Asset_ID (INTEGER), Other_Details (VARCHAR(255))\nChannels: Channel_ID (INTEGER), Other_Details (VARCHAR(255))\nFinances: Finance_ID (INTEGER), Other_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Address_ID (INTEGER), Channel_ID (INTEGER), Event_Type_Code (CHAR(15)), Finance_ID (INTEGER), Location_ID (INTEGER)\nProducts_in_Events: Product_in_Event_ID (INTEGER), Event_ID (INTEGER), Product_ID (INTEGER)\nParties_in_Events: Party_ID (INTEGER), Event_ID (INTEGER), Role_Code (CHAR(15))\nAgreements: Document_ID (INTEGER), Event_ID (INTEGER)\nAssets_in_Events: Asset_ID (INTEGER), Event_ID (INTEGER)" }, { "query": "SELECT T1.Product_Name , COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY COUNT(*) DESC", "question": "Show the names of products and the number of events they are in, sorted by the number of events in descending order.", "schema": "Addresses: Address_ID (INTEGER), address_details (VARCHAR(255))\nLocations: Location_ID (INTEGER), Other_Details (VARCHAR(255))\nProducts: Product_ID (INTEGER), Product_Type_Code (CHAR(15)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204))\nParties: Party_ID (INTEGER), Party_Details (VARCHAR(255))\nAssets: Asset_ID (INTEGER), Other_Details (VARCHAR(255))\nChannels: Channel_ID (INTEGER), Other_Details (VARCHAR(255))\nFinances: Finance_ID (INTEGER), Other_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Address_ID (INTEGER), Channel_ID (INTEGER), Event_Type_Code (CHAR(15)), Finance_ID (INTEGER), Location_ID (INTEGER)\nProducts_in_Events: Product_in_Event_ID (INTEGER), Event_ID (INTEGER), Product_ID (INTEGER)\nParties_in_Events: Party_ID (INTEGER), Event_ID (INTEGER), Role_Code (CHAR(15))\nAgreements: Document_ID (INTEGER), Event_ID (INTEGER)\nAssets_in_Events: Asset_ID (INTEGER), Event_ID (INTEGER)" }, { "query": "SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2", "question": "Show the names of products that are in at least two events.", "schema": "Addresses: Address_ID (INTEGER), address_details (VARCHAR(255))\nLocations: Location_ID (INTEGER), Other_Details (VARCHAR(255))\nProducts: Product_ID (INTEGER), Product_Type_Code (CHAR(15)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204))\nParties: Party_ID (INTEGER), Party_Details (VARCHAR(255))\nAssets: Asset_ID (INTEGER), Other_Details (VARCHAR(255))\nChannels: Channel_ID (INTEGER), Other_Details (VARCHAR(255))\nFinances: Finance_ID (INTEGER), Other_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Address_ID (INTEGER), Channel_ID (INTEGER), Event_Type_Code (CHAR(15)), Finance_ID (INTEGER), Location_ID (INTEGER)\nProducts_in_Events: Product_in_Event_ID (INTEGER), Event_ID (INTEGER), Product_ID (INTEGER)\nParties_in_Events: Party_ID (INTEGER), Event_ID (INTEGER), Role_Code (CHAR(15))\nAgreements: Document_ID (INTEGER), Event_ID (INTEGER)\nAssets_in_Events: Asset_ID (INTEGER), Event_ID (INTEGER)" }, { "query": "SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2 ORDER BY T1.Product_Name", "question": "Show the names of products that are in at least two events in ascending alphabetical order of product name.", "schema": "Addresses: Address_ID (INTEGER), address_details (VARCHAR(255))\nLocations: Location_ID (INTEGER), Other_Details (VARCHAR(255))\nProducts: Product_ID (INTEGER), Product_Type_Code (CHAR(15)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204))\nParties: Party_ID (INTEGER), Party_Details (VARCHAR(255))\nAssets: Asset_ID (INTEGER), Other_Details (VARCHAR(255))\nChannels: Channel_ID (INTEGER), Other_Details (VARCHAR(255))\nFinances: Finance_ID (INTEGER), Other_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Address_ID (INTEGER), Channel_ID (INTEGER), Event_Type_Code (CHAR(15)), Finance_ID (INTEGER), Location_ID (INTEGER)\nProducts_in_Events: Product_in_Event_ID (INTEGER), Event_ID (INTEGER), Product_ID (INTEGER)\nParties_in_Events: Party_ID (INTEGER), Event_ID (INTEGER), Role_Code (CHAR(15))\nAgreements: Document_ID (INTEGER), Event_ID (INTEGER)\nAssets_in_Events: Asset_ID (INTEGER), Event_ID (INTEGER)" }, { "query": "SELECT Product_Name FROM Products WHERE Product_ID NOT IN (SELECT Product_ID FROM Products_in_Events)", "question": "List the names of products that are not in any event.", "schema": "Addresses: Address_ID (INTEGER), address_details (VARCHAR(255))\nLocations: Location_ID (INTEGER), Other_Details (VARCHAR(255))\nProducts: Product_ID (INTEGER), Product_Type_Code (CHAR(15)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204))\nParties: Party_ID (INTEGER), Party_Details (VARCHAR(255))\nAssets: Asset_ID (INTEGER), Other_Details (VARCHAR(255))\nChannels: Channel_ID (INTEGER), Other_Details (VARCHAR(255))\nFinances: Finance_ID (INTEGER), Other_Details (VARCHAR(255))\nEvents: Event_ID (INTEGER), Address_ID (INTEGER), Channel_ID (INTEGER), Event_Type_Code (CHAR(15)), Finance_ID (INTEGER), Location_ID (INTEGER)\nProducts_in_Events: Product_in_Event_ID (INTEGER), Event_ID (INTEGER), Product_ID (INTEGER)\nParties_in_Events: Party_ID (INTEGER), Event_ID (INTEGER), Role_Code (CHAR(15))\nAgreements: Document_ID (INTEGER), Event_ID (INTEGER)\nAssets_in_Events: Asset_ID (INTEGER), Event_ID (INTEGER)" }, { "query": "SELECT count(*) FROM artwork", "question": "How many artworks are there?", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT Name FROM artwork ORDER BY Name ASC", "question": "List the name of artworks in ascending alphabetical order.", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT Name FROM artwork WHERE TYPE != \"Program Talent Show\"", "question": "List the name of artworks whose type is not \"Program Talent Show\".", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT Festival_Name , LOCATION FROM festival_detail", "question": "What are the names and locations of festivals?", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT Chair_Name FROM festival_detail ORDER BY YEAR ASC", "question": "What are the names of the chairs of festivals, sorted in ascending order of the year held?", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT LOCATION FROM festival_detail ORDER BY Num_of_Audience DESC LIMIT 1", "question": "What is the location of the festival with the largest number of audience?", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT Festival_Name FROM festival_detail WHERE YEAR = 2007", "question": "What are the names of festivals held in year 2007?", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT avg(Num_of_Audience) FROM festival_detail", "question": "What is the average number of audience for festivals?", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT Festival_Name FROM festival_detail ORDER BY YEAR DESC LIMIT 3", "question": "Show the names of the three most recent festivals.", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT T2.Name , T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID", "question": "For each nomination, show the name of the artwork and name of the festival where it is nominated.", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT DISTINCT T2.Type FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T3.Year = 2007", "question": "Show distinct types of artworks that are nominated in festivals in 2007.", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT T2.Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID ORDER BY T3.Year", "question": "Show the names of artworks in ascending order of the year they are nominated in.", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T2.Type = \"Program Talent Show\"", "question": "Show the names of festivals that have nominated artworks of type \"Program Talent Show\".", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT T1.Festival_ID , T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID HAVING COUNT(*) >= 2", "question": "Show the ids and names of festivals that have at least two nominations for artworks.", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT T1.Festival_ID , T3.Festival_Name , COUNT(*) FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID", "question": "Show the id, name of each festival and the number of artworks it has nominated.", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT TYPE , COUNT(*) FROM artwork GROUP BY TYPE", "question": "Please show different types of artworks with the corresponding number of artworks of each type.", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT TYPE FROM artwork GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1", "question": "List the most common type of artworks.", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT YEAR FROM festival_detail GROUP BY YEAR HAVING COUNT(*) > 1", "question": "List the year in which there are more than one festivals.", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT Name FROM Artwork WHERE Artwork_ID NOT IN (SELECT Artwork_ID FROM nomination)", "question": "List the name of artworks that are not nominated.", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT Num_of_Audience FROM festival_detail WHERE YEAR = 2008 OR YEAR = 2010", "question": "Show the number of audience in year 2008 or 2010.", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT sum(Num_of_Audience) FROM festival_detail", "question": "What are the total number of the audiences who visited any of the festivals?", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT YEAR FROM festival_detail WHERE LOCATION = 'United States' INTERSECT SELECT YEAR FROM festival_detail WHERE LOCATION != 'United States'", "question": "In which year are there festivals both inside the 'United States' and outside the 'United States'?", "schema": "festival_detail: Festival_ID (INT), Festival_Name (TEXT), Chair_Name (TEXT), Location (TEXT), Year (INT), Num_of_Audience (INT)\nartwork: Artwork_ID (INT), Type (TEXT), Name (TEXT)\nnomination: Artwork_ID (INT), Festival_ID (INT), Result (TEXT)" }, { "query": "SELECT count(*) FROM premises", "question": "How many premises are there?", "schema": "Premises: premise_id (INTEGER), premises_type (VARCHAR(15)), premise_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_category (VARCHAR(15)), product_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), customer_address (VARCHAR(255)), customer_login (VARCHAR(80)), customer_password (VARCHAR(10))\nMailshot_Campaigns: mailshot_id (INTEGER), product_category (VARCHAR(15)), mailshot_name (VARCHAR(80)), mailshot_start_date (DATETIME), mailshot_end_date (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), premise_id (INTEGER), date_address_from (DATETIME), address_type_code (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(15)), shipping_method_code (VARCHAR(15)), order_placed_datetime (DATETIME), order_delivered_datetime (DATETIME), order_shipping_charges (VARCHAR(255))\nMailshot_Customers: mailshot_id (INTEGER), customer_id (INTEGER), outcome_code (VARCHAR(15)), mailshot_customer_date (DATETIME)\nOrder_Items: item_id (INTEGER), order_item_status_code (VARCHAR(15)), order_id (INTEGER), product_id (INTEGER), item_status_code (VARCHAR(15)), item_delivered_datetime (DATETIME), item_order_quantity (VARCHAR(80))" }, { "query": "SELECT DISTINCT premises_type FROM premises", "question": "What are all the distinct premise types?", "schema": "Premises: premise_id (INTEGER), premises_type (VARCHAR(15)), premise_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_category (VARCHAR(15)), product_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), customer_address (VARCHAR(255)), customer_login (VARCHAR(80)), customer_password (VARCHAR(10))\nMailshot_Campaigns: mailshot_id (INTEGER), product_category (VARCHAR(15)), mailshot_name (VARCHAR(80)), mailshot_start_date (DATETIME), mailshot_end_date (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), premise_id (INTEGER), date_address_from (DATETIME), address_type_code (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(15)), shipping_method_code (VARCHAR(15)), order_placed_datetime (DATETIME), order_delivered_datetime (DATETIME), order_shipping_charges (VARCHAR(255))\nMailshot_Customers: mailshot_id (INTEGER), customer_id (INTEGER), outcome_code (VARCHAR(15)), mailshot_customer_date (DATETIME)\nOrder_Items: item_id (INTEGER), order_item_status_code (VARCHAR(15)), order_id (INTEGER), product_id (INTEGER), item_status_code (VARCHAR(15)), item_delivered_datetime (DATETIME), item_order_quantity (VARCHAR(80))" }, { "query": "SELECT premises_type , premise_details FROM premises ORDER BY premises_type", "question": "Find the types and details for all premises and order by the premise type.", "schema": "Premises: premise_id (INTEGER), premises_type (VARCHAR(15)), premise_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_category (VARCHAR(15)), product_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), customer_address (VARCHAR(255)), customer_login (VARCHAR(80)), customer_password (VARCHAR(10))\nMailshot_Campaigns: mailshot_id (INTEGER), product_category (VARCHAR(15)), mailshot_name (VARCHAR(80)), mailshot_start_date (DATETIME), mailshot_end_date (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), premise_id (INTEGER), date_address_from (DATETIME), address_type_code (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(15)), shipping_method_code (VARCHAR(15)), order_placed_datetime (DATETIME), order_delivered_datetime (DATETIME), order_shipping_charges (VARCHAR(255))\nMailshot_Customers: mailshot_id (INTEGER), customer_id (INTEGER), outcome_code (VARCHAR(15)), mailshot_customer_date (DATETIME)\nOrder_Items: item_id (INTEGER), order_item_status_code (VARCHAR(15)), order_id (INTEGER), product_id (INTEGER), item_status_code (VARCHAR(15)), item_delivered_datetime (DATETIME), item_order_quantity (VARCHAR(80))" }, { "query": "SELECT premises_type , count(*) FROM premises GROUP BY premises_type", "question": "Show each premise type and the number of premises in that type.", "schema": "Premises: premise_id (INTEGER), premises_type (VARCHAR(15)), premise_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_category (VARCHAR(15)), product_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), customer_address (VARCHAR(255)), customer_login (VARCHAR(80)), customer_password (VARCHAR(10))\nMailshot_Campaigns: mailshot_id (INTEGER), product_category (VARCHAR(15)), mailshot_name (VARCHAR(80)), mailshot_start_date (DATETIME), mailshot_end_date (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), premise_id (INTEGER), date_address_from (DATETIME), address_type_code (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(15)), shipping_method_code (VARCHAR(15)), order_placed_datetime (DATETIME), order_delivered_datetime (DATETIME), order_shipping_charges (VARCHAR(255))\nMailshot_Customers: mailshot_id (INTEGER), customer_id (INTEGER), outcome_code (VARCHAR(15)), mailshot_customer_date (DATETIME)\nOrder_Items: item_id (INTEGER), order_item_status_code (VARCHAR(15)), order_id (INTEGER), product_id (INTEGER), item_status_code (VARCHAR(15)), item_delivered_datetime (DATETIME), item_order_quantity (VARCHAR(80))" }, { "query": "SELECT product_category , count(*) FROM mailshot_campaigns GROUP BY product_category", "question": "Show all distinct product categories along with the number of mailshots in each category.", "schema": "Premises: premise_id (INTEGER), premises_type (VARCHAR(15)), premise_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_category (VARCHAR(15)), product_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), customer_address (VARCHAR(255)), customer_login (VARCHAR(80)), customer_password (VARCHAR(10))\nMailshot_Campaigns: mailshot_id (INTEGER), product_category (VARCHAR(15)), mailshot_name (VARCHAR(80)), mailshot_start_date (DATETIME), mailshot_end_date (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), premise_id (INTEGER), date_address_from (DATETIME), address_type_code (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(15)), shipping_method_code (VARCHAR(15)), order_placed_datetime (DATETIME), order_delivered_datetime (DATETIME), order_shipping_charges (VARCHAR(255))\nMailshot_Customers: mailshot_id (INTEGER), customer_id (INTEGER), outcome_code (VARCHAR(15)), mailshot_customer_date (DATETIME)\nOrder_Items: item_id (INTEGER), order_item_status_code (VARCHAR(15)), order_id (INTEGER), product_id (INTEGER), item_status_code (VARCHAR(15)), item_delivered_datetime (DATETIME), item_order_quantity (VARCHAR(80))" }, { "query": "SELECT customer_name , customer_phone FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM mailshot_customers)", "question": "Show the name and phone of the customer without any mailshot.", "schema": "Premises: premise_id (INTEGER), premises_type (VARCHAR(15)), premise_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_category (VARCHAR(15)), product_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), customer_address (VARCHAR(255)), customer_login (VARCHAR(80)), customer_password (VARCHAR(10))\nMailshot_Campaigns: mailshot_id (INTEGER), product_category (VARCHAR(15)), mailshot_name (VARCHAR(80)), mailshot_start_date (DATETIME), mailshot_end_date (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), premise_id (INTEGER), date_address_from (DATETIME), address_type_code (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(15)), shipping_method_code (VARCHAR(15)), order_placed_datetime (DATETIME), order_delivered_datetime (DATETIME), order_shipping_charges (VARCHAR(255))\nMailshot_Customers: mailshot_id (INTEGER), customer_id (INTEGER), outcome_code (VARCHAR(15)), mailshot_customer_date (DATETIME)\nOrder_Items: item_id (INTEGER), order_item_status_code (VARCHAR(15)), order_id (INTEGER), product_id (INTEGER), item_status_code (VARCHAR(15)), item_delivered_datetime (DATETIME), item_order_quantity (VARCHAR(80))" }, { "query": "SELECT T1.customer_name , T1.customer_phone FROM customers AS T1 JOIN mailshot_customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.outcome_code = 'No Response'", "question": "Show the name and phone for customers with a mailshot with outcome code 'No Response'.", "schema": "Premises: premise_id (INTEGER), premises_type (VARCHAR(15)), premise_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_category (VARCHAR(15)), product_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), customer_address (VARCHAR(255)), customer_login (VARCHAR(80)), customer_password (VARCHAR(10))\nMailshot_Campaigns: mailshot_id (INTEGER), product_category (VARCHAR(15)), mailshot_name (VARCHAR(80)), mailshot_start_date (DATETIME), mailshot_end_date (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), premise_id (INTEGER), date_address_from (DATETIME), address_type_code (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(15)), shipping_method_code (VARCHAR(15)), order_placed_datetime (DATETIME), order_delivered_datetime (DATETIME), order_shipping_charges (VARCHAR(255))\nMailshot_Customers: mailshot_id (INTEGER), customer_id (INTEGER), outcome_code (VARCHAR(15)), mailshot_customer_date (DATETIME)\nOrder_Items: item_id (INTEGER), order_item_status_code (VARCHAR(15)), order_id (INTEGER), product_id (INTEGER), item_status_code (VARCHAR(15)), item_delivered_datetime (DATETIME), item_order_quantity (VARCHAR(80))" }, { "query": "SELECT outcome_code , count(*) FROM mailshot_customers GROUP BY outcome_code", "question": "Show the outcome code of mailshots along with the number of mailshots in each outcome code.", "schema": "Premises: premise_id (INTEGER), premises_type (VARCHAR(15)), premise_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_category (VARCHAR(15)), product_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), customer_address (VARCHAR(255)), customer_login (VARCHAR(80)), customer_password (VARCHAR(10))\nMailshot_Campaigns: mailshot_id (INTEGER), product_category (VARCHAR(15)), mailshot_name (VARCHAR(80)), mailshot_start_date (DATETIME), mailshot_end_date (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), premise_id (INTEGER), date_address_from (DATETIME), address_type_code (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(15)), shipping_method_code (VARCHAR(15)), order_placed_datetime (DATETIME), order_delivered_datetime (DATETIME), order_shipping_charges (VARCHAR(255))\nMailshot_Customers: mailshot_id (INTEGER), customer_id (INTEGER), outcome_code (VARCHAR(15)), mailshot_customer_date (DATETIME)\nOrder_Items: item_id (INTEGER), order_item_status_code (VARCHAR(15)), order_id (INTEGER), product_id (INTEGER), item_status_code (VARCHAR(15)), item_delivered_datetime (DATETIME), item_order_quantity (VARCHAR(80))" }, { "query": "SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE outcome_code = 'Order' GROUP BY T1.customer_id HAVING count(*) >= 2", "question": "Show the names of customers who have at least 2 mailshots with outcome code 'Order'.", "schema": "Premises: premise_id (INTEGER), premises_type (VARCHAR(15)), premise_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_category (VARCHAR(15)), product_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), customer_address (VARCHAR(255)), customer_login (VARCHAR(80)), customer_password (VARCHAR(10))\nMailshot_Campaigns: mailshot_id (INTEGER), product_category (VARCHAR(15)), mailshot_name (VARCHAR(80)), mailshot_start_date (DATETIME), mailshot_end_date (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), premise_id (INTEGER), date_address_from (DATETIME), address_type_code (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(15)), shipping_method_code (VARCHAR(15)), order_placed_datetime (DATETIME), order_delivered_datetime (DATETIME), order_shipping_charges (VARCHAR(255))\nMailshot_Customers: mailshot_id (INTEGER), customer_id (INTEGER), outcome_code (VARCHAR(15)), mailshot_customer_date (DATETIME)\nOrder_Items: item_id (INTEGER), order_item_status_code (VARCHAR(15)), order_id (INTEGER), product_id (INTEGER), item_status_code (VARCHAR(15)), item_delivered_datetime (DATETIME), item_order_quantity (VARCHAR(80))" }, { "query": "SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1", "question": "Show the names of customers who have the most mailshots.", "schema": "Premises: premise_id (INTEGER), premises_type (VARCHAR(15)), premise_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_category (VARCHAR(15)), product_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), customer_address (VARCHAR(255)), customer_login (VARCHAR(80)), customer_password (VARCHAR(10))\nMailshot_Campaigns: mailshot_id (INTEGER), product_category (VARCHAR(15)), mailshot_name (VARCHAR(80)), mailshot_start_date (DATETIME), mailshot_end_date (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), premise_id (INTEGER), date_address_from (DATETIME), address_type_code (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(15)), shipping_method_code (VARCHAR(15)), order_placed_datetime (DATETIME), order_delivered_datetime (DATETIME), order_shipping_charges (VARCHAR(255))\nMailshot_Customers: mailshot_id (INTEGER), customer_id (INTEGER), outcome_code (VARCHAR(15)), mailshot_customer_date (DATETIME)\nOrder_Items: item_id (INTEGER), order_item_status_code (VARCHAR(15)), order_id (INTEGER), product_id (INTEGER), item_status_code (VARCHAR(15)), item_delivered_datetime (DATETIME), item_order_quantity (VARCHAR(80))" }, { "query": "SELECT T2.customer_name , T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'Order' INTERSECT SELECT T2.customer_name , T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'No Response'", "question": "What are the name and payment method of customers who have both mailshots in 'Order' outcome and mailshots in 'No Response' outcome.", "schema": "Premises: premise_id (INTEGER), premises_type (VARCHAR(15)), premise_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_category (VARCHAR(15)), product_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), customer_address (VARCHAR(255)), customer_login (VARCHAR(80)), customer_password (VARCHAR(10))\nMailshot_Campaigns: mailshot_id (INTEGER), product_category (VARCHAR(15)), mailshot_name (VARCHAR(80)), mailshot_start_date (DATETIME), mailshot_end_date (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), premise_id (INTEGER), date_address_from (DATETIME), address_type_code (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(15)), shipping_method_code (VARCHAR(15)), order_placed_datetime (DATETIME), order_delivered_datetime (DATETIME), order_shipping_charges (VARCHAR(255))\nMailshot_Customers: mailshot_id (INTEGER), customer_id (INTEGER), outcome_code (VARCHAR(15)), mailshot_customer_date (DATETIME)\nOrder_Items: item_id (INTEGER), order_item_status_code (VARCHAR(15)), order_id (INTEGER), product_id (INTEGER), item_status_code (VARCHAR(15)), item_delivered_datetime (DATETIME), item_order_quantity (VARCHAR(80))" }, { "query": "SELECT T2.premises_type , T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id", "question": "Show the premise type and address type code for all customer addresses.", "schema": "Premises: premise_id (INTEGER), premises_type (VARCHAR(15)), premise_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_category (VARCHAR(15)), product_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), customer_address (VARCHAR(255)), customer_login (VARCHAR(80)), customer_password (VARCHAR(10))\nMailshot_Campaigns: mailshot_id (INTEGER), product_category (VARCHAR(15)), mailshot_name (VARCHAR(80)), mailshot_start_date (DATETIME), mailshot_end_date (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), premise_id (INTEGER), date_address_from (DATETIME), address_type_code (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(15)), shipping_method_code (VARCHAR(15)), order_placed_datetime (DATETIME), order_delivered_datetime (DATETIME), order_shipping_charges (VARCHAR(255))\nMailshot_Customers: mailshot_id (INTEGER), customer_id (INTEGER), outcome_code (VARCHAR(15)), mailshot_customer_date (DATETIME)\nOrder_Items: item_id (INTEGER), order_item_status_code (VARCHAR(15)), order_id (INTEGER), product_id (INTEGER), item_status_code (VARCHAR(15)), item_delivered_datetime (DATETIME), item_order_quantity (VARCHAR(80))" }, { "query": "SELECT DISTINCT address_type_code FROM customer_addresses", "question": "What are the distinct address type codes for all customer addresses?", "schema": "Premises: premise_id (INTEGER), premises_type (VARCHAR(15)), premise_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_category (VARCHAR(15)), product_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), customer_address (VARCHAR(255)), customer_login (VARCHAR(80)), customer_password (VARCHAR(10))\nMailshot_Campaigns: mailshot_id (INTEGER), product_category (VARCHAR(15)), mailshot_name (VARCHAR(80)), mailshot_start_date (DATETIME), mailshot_end_date (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), premise_id (INTEGER), date_address_from (DATETIME), address_type_code (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(15)), shipping_method_code (VARCHAR(15)), order_placed_datetime (DATETIME), order_delivered_datetime (DATETIME), order_shipping_charges (VARCHAR(255))\nMailshot_Customers: mailshot_id (INTEGER), customer_id (INTEGER), outcome_code (VARCHAR(15)), mailshot_customer_date (DATETIME)\nOrder_Items: item_id (INTEGER), order_item_status_code (VARCHAR(15)), order_id (INTEGER), product_id (INTEGER), item_status_code (VARCHAR(15)), item_delivered_datetime (DATETIME), item_order_quantity (VARCHAR(80))" }, { "query": "SELECT order_shipping_charges , customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' OR order_status_code = 'Paid'", "question": "Show the shipping charge and customer id for customer orders with order status Cancelled or Paid.", "schema": "Premises: premise_id (INTEGER), premises_type (VARCHAR(15)), premise_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_category (VARCHAR(15)), product_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), customer_address (VARCHAR(255)), customer_login (VARCHAR(80)), customer_password (VARCHAR(10))\nMailshot_Campaigns: mailshot_id (INTEGER), product_category (VARCHAR(15)), mailshot_name (VARCHAR(80)), mailshot_start_date (DATETIME), mailshot_end_date (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), premise_id (INTEGER), date_address_from (DATETIME), address_type_code (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(15)), shipping_method_code (VARCHAR(15)), order_placed_datetime (DATETIME), order_delivered_datetime (DATETIME), order_shipping_charges (VARCHAR(255))\nMailshot_Customers: mailshot_id (INTEGER), customer_id (INTEGER), outcome_code (VARCHAR(15)), mailshot_customer_date (DATETIME)\nOrder_Items: item_id (INTEGER), order_item_status_code (VARCHAR(15)), order_id (INTEGER), product_id (INTEGER), item_status_code (VARCHAR(15)), item_delivered_datetime (DATETIME), item_order_quantity (VARCHAR(80))" }, { "query": "SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE shipping_method_code = 'FedEx' AND order_status_code = 'Paid'", "question": "Show the names of customers having an order with shipping method FedEx and order status Paid.", "schema": "Premises: premise_id (INTEGER), premises_type (VARCHAR(15)), premise_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_category (VARCHAR(15)), product_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80)), customer_address (VARCHAR(255)), customer_login (VARCHAR(80)), customer_password (VARCHAR(10))\nMailshot_Campaigns: mailshot_id (INTEGER), product_category (VARCHAR(15)), mailshot_name (VARCHAR(80)), mailshot_start_date (DATETIME), mailshot_end_date (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), premise_id (INTEGER), date_address_from (DATETIME), address_type_code (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(15)), shipping_method_code (VARCHAR(15)), order_placed_datetime (DATETIME), order_delivered_datetime (DATETIME), order_shipping_charges (VARCHAR(255))\nMailshot_Customers: mailshot_id (INTEGER), customer_id (INTEGER), outcome_code (VARCHAR(15)), mailshot_customer_date (DATETIME)\nOrder_Items: item_id (INTEGER), order_item_status_code (VARCHAR(15)), order_id (INTEGER), product_id (INTEGER), item_status_code (VARCHAR(15)), item_delivered_datetime (DATETIME), item_order_quantity (VARCHAR(80))" }, { "query": "SELECT count(*) FROM COURSE", "question": "How many courses are there in total?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT count(*) FROM COURSE", "question": "Count the number of courses.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT count(*) FROM COURSE WHERE Credits > 2", "question": "How many courses have more than 2 credits?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT count(*) FROM COURSE WHERE Credits > 2", "question": "Count the number of courses with more than 2 credits.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT CName FROM COURSE WHERE Credits = 1", "question": "List all names of courses with 1 credit?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT CName FROM COURSE WHERE Credits = 1", "question": "What are the names of courses with 1 credit?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT CName FROM COURSE WHERE Days = \"MTW\"", "question": "Which courses are taught on days MTW?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT CName FROM COURSE WHERE Days = \"MTW\"", "question": "What are the course names for courses taught on MTW?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT count(*) FROM DEPARTMENT WHERE Division = \"AS\"", "question": "What is the number of departments in Division \"AS\"?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT count(*) FROM DEPARTMENT WHERE Division = \"AS\"", "question": "How many departments are in the division AS?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT DPhone FROM DEPARTMENT WHERE Room = 268", "question": "What are the phones of departments in Room 268?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT DPhone FROM DEPARTMENT WHERE Room = 268", "question": "Give the phones for departments in room 268.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT COUNT(DISTINCT StuID) FROM ENROLLED_IN WHERE Grade = \"B\"", "question": "Find the number of students that have at least one grade \"B\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT COUNT(DISTINCT StuID) FROM ENROLLED_IN WHERE Grade = \"B\"", "question": "How many students have had at least one \"B\" grade?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT max(gradepoint) , min(gradepoint) FROM GRADECONVERSION", "question": "Find the max and min grade point for all letter grade.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT max(gradepoint) , min(gradepoint) FROM GRADECONVERSION", "question": "What are the maximum and minumum grade points?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%'", "question": "Find the first names of students whose first names contain letter \"a\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%'", "question": "What are the first names for students who have an \"a\" in their first name?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT Fname , Lname FROM FACULTY WHERE sex = \"M\" AND Building = \"NEB\"", "question": "Find the first names and last names of male (sex is M) faculties who live in building NEB.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT Fname , Lname FROM FACULTY WHERE sex = \"M\" AND Building = \"NEB\"", "question": "What are the full names of faculties with sex M and who live in building NEB?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT Room FROM FACULTY WHERE Rank = \"Professor\" AND Building = \"NEB\"", "question": "Find the rooms of faculties with rank professor who live in building NEB.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT Room FROM FACULTY WHERE Rank = \"Professor\" AND Building = \"NEB\"", "question": "What are the rooms for members of the faculty who are professors and who live in building NEB?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT DName FROM DEPARTMENT WHERE Building = \"Mergenthaler\"", "question": "Find the department name that is in Building \"Mergenthaler\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT DName FROM DEPARTMENT WHERE Building = \"Mergenthaler\"", "question": "What is the name of the department in the Building Mergenthaler?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT * FROM COURSE ORDER BY Credits", "question": "List all information about courses sorted by credits in the ascending order.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT * FROM COURSE ORDER BY Credits", "question": "What is all the information about courses, ordered by credits ascending?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT CName FROM COURSE ORDER BY Credits", "question": "List the course name of courses sorted by credits.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT CName FROM COURSE ORDER BY Credits", "question": "What are the course names, ordered by credits?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT Fname FROM STUDENT ORDER BY Age DESC", "question": "Find the first name of students in the descending order of age.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT Fname FROM STUDENT ORDER BY Age DESC", "question": "What are the first names of students, ordered by age from greatest to least?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT LName FROM STUDENT WHERE Sex = \"F\" ORDER BY Age DESC", "question": "Find the last name of female (sex is F) students in the descending order of age.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT LName FROM STUDENT WHERE Sex = \"F\" ORDER BY Age DESC", "question": "What are the last names of female students, ordered by age descending?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT Lname FROM FACULTY WHERE Building = \"Barton\" ORDER BY Lname", "question": "Find the last names of faculties in building Barton in alphabetic order.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT Lname FROM FACULTY WHERE Building = \"Barton\" ORDER BY Lname", "question": "What are the last names of faculty in building Barton, sorted by last name?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT Fname FROM FACULTY WHERE Rank = \"Professor\" ORDER BY Fname", "question": "Find the first names of faculties of rank Professor in alphabetic order.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT Fname FROM FACULTY WHERE Rank = \"Professor\" ORDER BY Fname", "question": "What are the first names for all faculty professors, ordered by first name?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY count(*) DESC LIMIT 1", "question": "Find the name of the department that has the biggest number of students minored in?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of the department with the most students minoring in it?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT DName FROM DEPARTMENT EXCEPT SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO", "question": "Find the name of the department that has no students minored in?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT DName FROM DEPARTMENT EXCEPT SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO", "question": "What is the name of the department htat has no students minoring in it?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MEMBER_OF AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY count(*) ASC LIMIT 1", "question": "Find the name of the department that has the fewest members.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MEMBER_OF AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY count(*) ASC LIMIT 1", "question": "What is the name of the department with the fewest members?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT Rank FROM FACULTY GROUP BY Rank ORDER BY count(*) ASC LIMIT 1", "question": "Find the rank of the faculty that the fewest faculties belong to.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT Rank FROM FACULTY GROUP BY Rank ORDER BY count(*) ASC LIMIT 1", "question": "What is the least common faculty rank?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T2.Fname , T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY count(*) DESC LIMIT 3", "question": "What are the first and last names of the instructors who teach the top 3 number of courses?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T2.Fname , T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY count(*) DESC LIMIT 3", "question": "What are the full names of the 3 instructors who teach the most courses?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY count(*) DESC LIMIT 1", "question": "Which building does the instructor who teaches the most number of courses live in?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY count(*) DESC LIMIT 1", "question": "Give the building that the instructor who teaches the greatest number of courses lives in.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T1.CName FROM COURSE AS T1 JOIN ENROLLED_IN AS T2 ON T1.CID = T2.CID GROUP BY T2.CID HAVING COUNT(*) >= 5", "question": "What are the name of courses that have at least five enrollments?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T1.CName FROM COURSE AS T1 JOIN ENROLLED_IN AS T2 ON T1.CID = T2.CID GROUP BY T2.CID HAVING COUNT(*) >= 5", "question": "Give the names of the courses with at least five enrollments.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T2.Fname , T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID WHERE T1.CName = \"COMPUTER LITERACY\"", "question": "Find the first name and last name of the instructor of course that has course name", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T2.Fname , T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID WHERE T1.CName = \"COMPUTER LITERACY\"", "question": "What is the full name of the instructor who has a course named COMPUTER LITERACY?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T2.Dname , T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = \"INTRODUCTION TO COMPUTER SCIENCE\"", "question": "Find the department name and room of the course INTRODUCTION TO COMPUTER SCIENCE.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T2.Dname , T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = \"INTRODUCTION TO COMPUTER SCIENCE\"", "question": "What are the department name and room for the course INTRODUCTION TO COMPUTER SCIENCE?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T3.Fname , T3.LName , T2.gradepoint FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID", "question": "Find the student first and last names and grade points of all enrollments.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T3.Fname , T3.LName , T2.gradepoint FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID", "question": "What are the full names and gradepoints for all enrollments?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T2.gradepoint >= 3.8", "question": "Find the distinct student first names of all students that have grade point at least 3.8 in one course.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T2.gradepoint >= 3.8", "question": "What are the distinct first names for students with a grade point of 3.8 or above in at least one course?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T1.Fname , T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID = T2.FacID WHERE T2.DNO = 520", "question": "Find the full names of faculties who are members of department with department number 520.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T1.Fname , T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID = T2.FacID WHERE T2.DNO = 520", "question": "What are the full names of faculty members who are a part of department 520?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T2.Fname , T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID = T2.StuID WHERE T1.DNO = 140", "question": "What are the first names and last names of the students that minor in the department with DNO 140.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T2.Fname , T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID = T2.StuID WHERE T1.DNO = 140", "question": "What are the full names of students minoring in department 140?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO = T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID = T3.FacID WHERE T1.DName = \"Computer Science\"", "question": "Find the last names of faculties who are members of computer science department.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO = T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID = T3.FacID WHERE T1.DName = \"Computer Science\"", "question": "What are the last names of faculty who are part of the computer science department?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT avg(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.LName = \"Smith\"", "question": "Find the average grade point of student whose last name is Smith.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT avg(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.LName = \"Smith\"", "question": "What is the average gradepoint for students with the last name Smith?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT max(T2.gradepoint) , min(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.city_code = \"NYC\"", "question": "What is the maximum and minimum grade point of students who live in NYC?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT max(T2.gradepoint) , min(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.city_code = \"NYC\"", "question": "Give the maximum and minimum gradepoints for students living in NYC?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT CName FROM COURSE WHERE Credits = 3 UNION SELECT CName FROM COURSE WHERE Credits = 1 AND Hours = 4", "question": "Find the names of courses that have either 3 credits or 1 credit but 4 hours.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT CName FROM COURSE WHERE Credits = 3 UNION SELECT CName FROM COURSE WHERE Credits = 1 AND Hours = 4", "question": "What are the names of courses that give either 3 credits, or 1 credit and 4 hours?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT DName FROM DEPARTMENT WHERE Division = \"AS\" UNION SELECT DName FROM DEPARTMENT WHERE Division = \"EN\" AND Building = \"NEB\"", "question": "Find the names of departments that are either in division AS or in division EN and in Building NEB.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT DName FROM DEPARTMENT WHERE Division = \"AS\" UNION SELECT DName FROM DEPARTMENT WHERE Division = \"EN\" AND Building = \"NEB\"", "question": "What are the names of departments either in division AS, or in division EN and in building NEB?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT Fname FROM STUDENT WHERE StuID NOT IN (SELECT StuID FROM ENROLLED_IN)", "question": "Find the first name of students not enrolled in any course.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT Fname FROM STUDENT WHERE StuID NOT IN (SELECT StuID FROM ENROLLED_IN)", "question": "What are the first names of all students that are not enrolled in courses?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nFaculty: FacID (INTEGER), Lname (VARCHAR(15)), Fname (VARCHAR(15)), Rank (VARCHAR(15)), Sex (VARCHAR(1)), Phone (INTEGER), Room (VARCHAR(5)), Building (VARCHAR(13))\nDepartment: DNO (INTEGER), Division (VARCHAR(2)), DName (VARCHAR(25)), Room (VARCHAR(5)), Building (VARCHAR(13)), DPhone (INTEGER)\nMember_of: FacID (INTEGER), DNO (INTEGER), Appt_Type (VARCHAR(15))\nCourse: CID (VARCHAR(7)), CName (VARCHAR(40)), Credits (INTEGER), Instructor (INTEGER), Days (VARCHAR(5)), Hours (VARCHAR(11)), DNO (INTEGER)\nMinor_in: StuID (INTEGER), DNO (INTEGER)\nEnrolled_in: StuID (INTEGER), CID (VARCHAR(7)), Grade (VARCHAR(2))\nGradeconversion: lettergrade (VARCHAR(2)), gradepoint (FLOAT)" }, { "query": "SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3", "question": "What are the ids of the top three products that were purchased in the largest amount?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3", "question": "Give the ids of the three products purchased in the largest amounts.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_id , product_type_code FROM products ORDER BY product_price LIMIT 1", "question": "What are the product id and product type of the cheapest product?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_id , product_type_code FROM products ORDER BY product_price LIMIT 1", "question": "Give the id and product type of the product with the lowest price.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT count(DISTINCT product_type_code) FROM products", "question": "Find the number of different product types.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT count(DISTINCT product_type_code) FROM products", "question": "Count the number of distinct product types.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.address_details FROM addresses AS T1 JOIN customer_addresses AS T2 ON T1.address_id = T2.address_id WHERE T2.customer_id = 10", "question": "Return the address of customer 10.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.address_details FROM addresses AS T1 JOIN customer_addresses AS T2 ON T1.address_id = T2.address_id WHERE T2.customer_id = 10", "question": "What is the address for the customer with id 10?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.staff_id , T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = \"Department Manager\"", "question": "What are the staff ids and genders of all staffs whose job title is Department Manager?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.staff_id , T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = \"Department Manager\"", "question": "Return the staff ids and genders for any staff with the title Department Manager.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT payment_method_code , count(*) FROM customers GROUP BY payment_method_code", "question": "For each payment method, return how many customers use it.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT payment_method_code , count(*) FROM customers GROUP BY payment_method_code", "question": "How many customers use each payment method?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_id FROM order_items GROUP BY product_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the id of the product that was ordered the most often?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_id FROM order_items GROUP BY product_id ORDER BY count(*) DESC LIMIT 1", "question": "Give the product id for the product that was ordered most frequently.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.customer_name , T1.customer_phone , T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id ORDER BY count(*) DESC LIMIT 1", "question": "What are the name, phone number and email address of the customer who made the largest number of orders?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.customer_name , T1.customer_phone , T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id ORDER BY count(*) DESC LIMIT 1", "question": "Return the name, phone number and email address for the customer with the most orders.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_type_code , avg(product_price) FROM products GROUP BY product_type_code", "question": "What is the average price for each type of product?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_type_code , avg(product_price) FROM products GROUP BY product_type_code", "question": "Return the average price for each product type.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT count(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id = T2.dept_store_chain_id WHERE T2.dept_store_chain_name = \"South\"", "question": "How many department stores does the store chain South have?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT count(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id = T2.dept_store_chain_id WHERE T2.dept_store_chain_name = \"South\"", "question": "Count the number of stores the chain South has.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.staff_name , T2.job_title_code FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY T2.date_assigned_to DESC LIMIT 1", "question": "What is the name and job title of the staff who was assigned the latest?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.staff_name , T2.job_title_code FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY T2.date_assigned_to DESC LIMIT 1", "question": "Return the name and job title of the staff with the latest date assigned.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T2.product_type_code , T2.product_name , T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3", "question": "Give me the product type, name and price for all the products supplied by supplier id 3.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T2.product_type_code , T2.product_name , T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3", "question": "Return the product type, name, and price for products supplied by supplier 3.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = \"Pending\" ORDER BY T2.customer_id", "question": "Return the distinct name of customers whose order status is Pending, in the order of customer id.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = \"Pending\" ORDER BY T2.customer_id", "question": "What are the distinct names of customers with an order status of Pending, sorted by customer id?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.customer_name , T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = \"New\" INTERSECT SELECT T1.customer_name , T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = \"Pending\"", "question": "Find the name and address of the customers who have both New and Pending orders.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.customer_name , T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = \"New\" INTERSECT SELECT T1.customer_name , T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = \"Pending\"", "question": "What are the names and addressed of customers who have both New and Pending orders?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 2 AND T2.product_price > (SELECT avg(product_price) FROM products)", "question": "Return ids of all the products that are supplied by supplier id 2 and are more expensive than the average price of all products.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 2 AND T2.product_price > (SELECT avg(product_price) FROM products)", "question": "What are the ids of products from the supplier with id 2, which are more expensive than the average price across all products?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T2.dept_store_id , T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = \"marketing\" INTERSECT SELECT T2.dept_store_id , T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = \"managing\"", "question": "What is the id and name of the department store that has both marketing and managing department?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T2.dept_store_id , T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = \"marketing\" INTERSECT SELECT T2.dept_store_id , T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = \"managing\"", "question": "What are the ids and names of department stores with both marketing and managing departments?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY count(*) DESC LIMIT 2", "question": "What are the ids of the two department store chains with the largest number of department stores?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY count(*) DESC LIMIT 2", "question": "Return the ids of the two department store chains with the most department stores.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY count(*) LIMIT 1", "question": "What is the id of the department with the least number of staff?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY count(*) LIMIT 1", "question": "Return the id of the department with the fewest staff assignments.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_type_code , max(product_price) , min(product_price) FROM products GROUP BY product_type_code", "question": "For each product type, return the maximum and minimum price.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_type_code , max(product_price) , min(product_price) FROM products GROUP BY product_type_code", "question": "What are the maximum and minimum product prices for each product type?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_type_code FROM products GROUP BY product_type_code HAVING avg(product_price) > (SELECT avg(product_price) FROM products)", "question": "Find the product type whose average price is higher than the average price of all products.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_type_code FROM products GROUP BY product_type_code HAVING avg(product_price) > (SELECT avg(product_price) FROM products)", "question": "What is the code of the product type with an average price higher than the average price of all products?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.staff_id , T1.staff_name FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY date_assigned_to - date_assigned_from LIMIT 1", "question": "Find the id and name of the staff who has been assigned for the shortest period.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.staff_id , T1.staff_name FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY date_assigned_to - date_assigned_from LIMIT 1", "question": "What is the id and name of the staff who has been assigned for the least amount of time?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_name , product_id FROM products WHERE product_price BETWEEN 600 AND 700", "question": "Return the names and ids of all products whose price is between 600 and 700.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_name , product_id FROM products WHERE product_price BETWEEN 600 AND 700", "question": "What are the names and ids of products costing between 600 and 700?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date > (SELECT min(order_date) FROM Customer_Orders WHERE order_status_code = \"Cancelled\")", "question": "Find the ids of all distinct customers who made order after some orders that were Cancelled.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date > (SELECT min(order_date) FROM Customer_Orders WHERE order_status_code = \"Cancelled\")", "question": "What are the distinct ids of customers who made an order after any order that was Cancelled?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to < (SELECT max(date_assigned_to) FROM Staff_Department_Assignments WHERE job_title_code = 'Clerical Staff')", "question": "What is id of the staff who had a Staff Department Assignment earlier than any Clerical Staff?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to < (SELECT max(date_assigned_to) FROM Staff_Department_Assignments WHERE job_title_code = 'Clerical Staff')", "question": "Return the id of the staff whose Staff Department Assignment was earlier than that of any Clerical Staff.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT customer_name , customer_id FROM customers WHERE customer_address LIKE \"%TN%\"", "question": "What are the names and ids of customers whose address contains TN?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT customer_name , customer_id FROM customers WHERE customer_address LIKE \"%TN%\"", "question": "Return the names and ids of customers who have TN in their address.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.staff_name , T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.date_assigned_from LIKE \"2016%\"", "question": "Return the name and gender of the staff who was assigned in 2016.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.staff_name , T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.date_assigned_from LIKE \"2016%\"", "question": "What are the names and genders of staff who were assigned in 2016?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.staff_name FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id GROUP BY T2.staff_id HAVING COUNT (*) > 1", "question": "List the name of staff who has been assigned multiple jobs.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.staff_name FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id GROUP BY T2.staff_id HAVING COUNT (*) > 1", "question": "What are the names of staff who have been assigned multiple jobs?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.supplier_name , T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id = T2.supplier_id JOIN addresses AS T3 ON T2.address_id = T3.address_id ORDER BY T3.address_details", "question": "List the name and phone number of all suppliers in the alphabetical order of their addresses.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.supplier_name , T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id = T2.supplier_id JOIN addresses AS T3 ON T2.address_id = T3.address_id ORDER BY T3.address_details", "question": "What are the names and phone numbers for all suppliers, sorted in alphabetical order of their addressed?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT customer_phone FROM customers UNION SELECT supplier_phone FROM suppliers", "question": "What are the phone numbers of all customers and suppliers.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT customer_phone FROM customers UNION SELECT supplier_phone FROM suppliers", "question": "Return the phone numbers for all customers and suppliers.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_id FROM Order_Items GROUP BY product_id HAVING count(*) > 3 UNION SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING sum(total_amount_purchased) > 80000", "question": "Return the ids of all products that were ordered more than three times or supplied more than 80000.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_id FROM Order_Items GROUP BY product_id HAVING count(*) > 3 UNION SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING sum(total_amount_purchased) > 80000", "question": "What are the ids of all products that were either ordered more than 3 times or have a cumulative amount purchased of above 80000?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_id , product_name FROM products WHERE product_price < 600 OR product_price > 900", "question": "What are id and name of the products whose price is lower than 600 or higher than 900?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_id , product_name FROM products WHERE product_price < 600 OR product_price > 900", "question": "Give the ids and names of products with price lower than 600 or higher than 900.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id HAVING avg(total_amount_purchased) > 50000 OR avg(total_amount_purchased) < 30000", "question": "Find the id of suppliers whose average amount purchased for each product is above 50000 or below 30000.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id HAVING avg(total_amount_purchased) > 50000 OR avg(total_amount_purchased) < 30000", "question": "What are the ids of suppliers which have an average amount purchased of above 50000 or below 30000?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT avg(total_amount_purchased) , avg(total_value_purchased) FROM Product_Suppliers WHERE supplier_id = (SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id ORDER BY count(*) DESC LIMIT 1)", "question": "What are the average amount purchased and value purchased for the supplier who supplies the most products.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT avg(total_amount_purchased) , avg(total_value_purchased) FROM Product_Suppliers WHERE supplier_id = (SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id ORDER BY count(*) DESC LIMIT 1)", "question": "Return the average total amount purchased and total value purchased for the supplier who supplies the greatest number of products.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT max(customer_code) , min(customer_code) FROM Customers", "question": "What is the largest and smallest customer codes?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT max(customer_code) , min(customer_code) FROM Customers", "question": "Return the maximum and minimum customer codes.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id JOIN products AS T4 ON T3.product_id = T4.product_id WHERE T4.product_name = \"keyboard\"", "question": "List the names of all the distinct customers who bought a keyboard.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id JOIN products AS T4 ON T3.product_id = T4.product_id WHERE T4.product_name = \"keyboard\"", "question": "What are the distinct names of customers who have purchased a keyboard?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT DISTINCT T1.supplier_name , T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id = T2.supplier_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_name = \"red jeans\"", "question": "List the names and phone numbers of all the distinct suppliers who supply red jeans.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT DISTINCT T1.supplier_name , T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id = T2.supplier_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_name = \"red jeans\"", "question": "What are the distinct names and phone numbers for suppliers who have red jeans?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT max(product_price) , min(product_price) , product_type_code FROM products GROUP BY product_type_code ORDER BY product_type_code", "question": "What are the highest and lowest prices of products, grouped by and alphabetically ordered by product type?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT max(product_price) , min(product_price) , product_type_code FROM products GROUP BY product_type_code ORDER BY product_type_code", "question": "Give the maximum and minimum product prices for each product type, grouped and ordered by product type.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT order_id , customer_id FROM customer_orders WHERE order_status_code = \"Cancelled\" ORDER BY order_date", "question": "List the order id, customer id for orders in Cancelled status, ordered by their order dates.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT order_id , customer_id FROM customer_orders WHERE order_status_code = \"Cancelled\" ORDER BY order_date", "question": "What are the order ids and customer ids for orders that have been Cancelled, sorted by their order dates?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id JOIN products AS T3 ON T2.product_id = T3.product_id GROUP BY T3.product_id HAVING COUNT (DISTINCT T1.customer_id) >= 2", "question": "Find the names of products that were bought by at least two distinct customers.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id JOIN products AS T3 ON T2.product_id = T3.product_id GROUP BY T3.product_id HAVING COUNT (DISTINCT T1.customer_id) >= 2", "question": "What are the distinct names of products purchased by at least two different customers?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id GROUP BY T1.customer_id HAVING COUNT (DISTINCT T3.product_id) >= 3", "question": "Find the names of customers who have bought by at least three distinct products.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id GROUP BY T1.customer_id HAVING COUNT (DISTINCT T3.product_id) >= 3", "question": "What are the distinct names of customers who have purchased at least three different products?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.staff_name , T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = \"Sales Person\" EXCEPT SELECT T1.staff_name , T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = \"Clerical Staff\"", "question": "Find the name and gender of the staff who has been assigned the job of Sales Person but never Clerical Staff.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT T1.staff_name , T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = \"Sales Person\" EXCEPT SELECT T1.staff_name , T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = \"Clerical Staff\"", "question": "What are the names and genders of staff who have held the title Sales Person, but never Clerical Staff?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT customer_id , customer_name FROM customers WHERE customer_address LIKE \"%WY%\" AND payment_method_code != \"Credit Card\"", "question": "Find the id and name of customers whose address contains WY state and do not use credit card for payment.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT customer_id , customer_name FROM customers WHERE customer_address LIKE \"%WY%\" AND payment_method_code != \"Credit Card\"", "question": "What are the ids and names of customers with addressed that contain WY and who do not use a credit card for payment?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT avg(product_price) FROM products WHERE product_type_code = 'Clothes'", "question": "Find the average price of all product clothes.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT avg(product_price) FROM products WHERE product_type_code = 'Clothes'", "question": "What is the average price of clothes?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_name FROM products WHERE product_type_code = 'Hardware' ORDER BY product_price DESC LIMIT 1", "question": "Find the name of the most expensive hardware product.", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT product_name FROM products WHERE product_type_code = 'Hardware' ORDER BY product_price DESC LIMIT 1", "question": "What is the name of the hardware product with the greatest price?", "schema": "Addresses: address_id (INTEGER), address_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_gender (VARCHAR(1)), staff_name (VARCHAR(80))\nSuppliers: supplier_id (INTEGER), supplier_name (VARCHAR(80)), supplier_phone (VARCHAR(80))\nDepartment_Store_Chain: dept_store_chain_id (INTEGER), dept_store_chain_name (VARCHAR(80))\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(10)), customer_code (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(10)), product_name (VARCHAR(80)), product_price (DECIMAL(194))\nSupplier_Addresses: supplier_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status_code (VARCHAR(10)), order_date (DATETIME)\nDepartment_Stores: dept_store_id (INTEGER), dept_store_chain_id (INTEGER), store_name (VARCHAR(80)), store_address (VARCHAR(255)), store_phone (VARCHAR(80)), store_email (VARCHAR(80))\nDepartments: department_id (INTEGER), dept_store_id (INTEGER), department_name (VARCHAR(80))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER)\nProduct_Suppliers: product_id (INTEGER), supplier_id (INTEGER), date_supplied_from (DATETIME), date_supplied_to (DATETIME), total_amount_purchased (VARCHAR(80)), total_value_purchased (DECIMAL(194))\nStaff_Department_Assignments: staff_id (INTEGER), department_id (INTEGER), date_assigned_from (DATETIME), job_title_code (VARCHAR(10)), date_assigned_to (DATETIME)" }, { "query": "SELECT count(*) FROM aircraft", "question": "How many aircrafts are there?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT count(*) FROM aircraft", "question": "What is the number of aircraft?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT Description FROM aircraft", "question": "List the description of all aircrafts.", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT Description FROM aircraft", "question": "What are the descriptions for the aircrafts?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT avg(International_Passengers) FROM airport", "question": "What is the average number of international passengers of all airports?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT avg(International_Passengers) FROM airport", "question": "What is the average number of international passengers for an airport?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT International_Passengers , Domestic_Passengers FROM airport WHERE Airport_Name = \"London Heathrow\"", "question": "What are the number of international and domestic passengers of the airport named London \"Heathrow\"?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT International_Passengers , Domestic_Passengers FROM airport WHERE Airport_Name = \"London Heathrow\"", "question": "How many international and domestic passengers are there in the airport London Heathrow?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT sum(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE \"%London%\"", "question": "What are the total number of Domestic Passengers of airports that contain the word \"London\".", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT sum(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE \"%London%\"", "question": "What are the total number of domestic passengers at all London airports?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT max(Transit_Passengers) , min(Transit_Passengers) FROM airport", "question": "What are the maximum and minimum number of transit passengers of all aiports.", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT max(Transit_Passengers) , min(Transit_Passengers) FROM airport", "question": "What is the maximum and mininum number of transit passengers for all airports?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT Name FROM pilot WHERE Age >= 25", "question": "What are the name of pilots aged 25 or older?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT Name FROM pilot WHERE Age >= 25", "question": "what is the name of every pilot who is at least 25 years old?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT Name FROM pilot ORDER BY Name ASC", "question": "List all pilot names in ascending alphabetical order.", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT Name FROM pilot ORDER BY Name ASC", "question": "What are the names of the pilots in alphabetical order?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC", "question": "List names of all pilot aged 30 or younger in descending alphabetical order.", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC", "question": "What are the names of all pilots 30 years old or young in descending alphabetical order?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = \"London Gatwick\"", "question": "Please show the names of aircrafts associated with airport with name \"London Gatwick\".", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = \"London Gatwick\"", "question": "What are the names of all the aircrafts associated with London Gatwick airport?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT T1.Aircraft , T1.Description FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Total_Passengers > 10000000", "question": "Please show the names and descriptions of aircrafts associated with airports that have a total number of passengers bigger than 10000000.", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT T1.Aircraft , T1.Description FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Total_Passengers > 10000000", "question": "What are the names and descriptions of aircrafts associated with an airport that has more total passengers than 10000000?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT avg(T3.Total_Passengers) FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T1.Aircraft = \"Robinson R-22\"", "question": "What is the average total number of passengers of airports that are associated with aircraft \"Robinson R-22\"?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT avg(T3.Total_Passengers) FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T1.Aircraft = \"Robinson R-22\"", "question": "What is the average total number of passengers for all airports that the aircraft \"Robinson R-22\" visits?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT T2.Location , T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft", "question": "Please list the location and the winning aircraft name.", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT T2.Location , T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft", "question": "What is the location and name of the winning aircraft?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC LIMIT 1", "question": "List the name of the aircraft that has been named winning aircraft the most number of times.", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the name of the aircraft that has won an award the most?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT T1.Aircraft , COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft", "question": "List the names of aircrafts and the number of times it won matches.", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT T1.Aircraft , COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft", "question": "For each aircraft that has won an award, what is its name and how many time has it won?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT Name FROM pilot ORDER BY Age DESC", "question": "List names of all pilot in descending order of age.", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT Name FROM pilot ORDER BY Age DESC", "question": "What are the names of all pilots listed by descending age?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft HAVING COUNT(*) >= 2", "question": "List the names of aircrafts and that won matches at least twice.", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft HAVING COUNT(*) >= 2", "question": "What are the names of all aircrafts that have won a match at least twice?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT Aircraft FROM aircraft WHERE Aircraft_ID NOT IN (SELECT Winning_Aircraft FROM MATCH)", "question": "List the names of aircrafts and that did not win any match.", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT Aircraft FROM aircraft WHERE Aircraft_ID NOT IN (SELECT Winning_Aircraft FROM MATCH)", "question": "What are the names of all aicrafts that have never won any match?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = \"London Heathrow\" INTERSECT SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = \"London Gatwick\"", "question": "Show the names of aircrafts that are associated with both an airport named \"London Heathrow\" and an airport named \"London Gatwick\"", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = \"London Heathrow\" INTERSECT SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = \"London Gatwick\"", "question": "What are the names of all aircrafts that are associated with both London Heathrow and Gatwick airports?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1", "question": "Show all information on the airport that has the largest number of international passengers.", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1", "question": "What is all the information on the airport with the largest number of international passengers?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT t1.name , t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY count(*) DESC LIMIT 1", "question": "find the name and age of the pilot who has won the most number of times among the pilots who are younger than 30.", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT t1.name , t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY count(*) DESC LIMIT 1", "question": "What is the name and age of the pilot younger than 30 who has won the most number of times?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT t1.name , t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age LIMIT 1", "question": "what is the name and age of the youngest winning pilot?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT t1.name , t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age LIMIT 1", "question": "How old is the youngest winning pilot and what is their name?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT name FROM pilot WHERE pilot_id NOT IN (SELECT Winning_Pilot FROM MATCH WHERE country = 'Australia')", "question": "find the name of pilots who did not win the matches held in the country of Australia.", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT name FROM pilot WHERE pilot_id NOT IN (SELECT Winning_Pilot FROM MATCH WHERE country = 'Australia')", "question": "What are the names of the pilots that have not won any matches in Australia?", "schema": "pilot: Pilot_Id (INT(11)), Name (VARCHAR(50)), Age (INT(11))\naircraft: Aircraft_ID (INT(11)), Aircraft (VARCHAR(50)), Description (VARCHAR(50)), Max_Gross_Weight (VARCHAR(50)), Total_disk_area (VARCHAR(50)), Max_disk_Loading (VARCHAR(50))\nmatch: Round (REAL), Location (TEXT), Country (TEXT), Date (TEXT), Fastest_Qualifying (TEXT), Winning_Pilot (TEXT), Winning_Aircraft (TEXT)\nairport: Airport_ID (INT), Airport_Name (TEXT), Total_Passengers (REAL), %_Change_2007 (TEXT), International_Passengers (REAL), Domestic_Passengers (REAL), Transit_Passengers (REAL), Aircraft_Movements (REAL), Freight_Metric_Tonnes (REAL)\nairport_aircraft: ID (INT), Airport_ID (INT), Aircraft_ID (INT)" }, { "query": "SELECT T1.property_id , count(*) FROM properties AS T1 JOIN residents AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property_id", "question": "How many residents does each property have? List property id and resident count.", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT DISTINCT T1.service_type_code FROM services AS T1 JOIN organizations AS T2 ON T1.organization_id = T2.organization_id WHERE T2.organization_details = 'Denesik and Sons Party'", "question": "What is the distinct service types that are provided by the organization which has detail 'Denesik and Sons Party'?", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT T1.resident_id , T1.other_details , count(*) FROM Residents AS T1 JOIN Residents_Services AS T2 ON T1.resident_id = T2.resident_id GROUP BY T1.resident_id ORDER BY count(*) DESC", "question": "How many services has each resident requested? List the resident id, details, and the count in descending order of the count.", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT T1.service_id , T1.service_details , count(*) FROM Services AS T1 JOIN Residents_Services AS T2 ON T1.service_id = T2.service_id GROUP BY T1.service_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the maximum number that a certain service is provided? List the service id, details and number.", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT T1.thing_id , T1.type_of_Thing_Code , T2.organization_details FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id", "question": "List the id and type of each thing, and the details of the organization that owns it.", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT T1.customer_id , T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 3", "question": "What are the id and details of the customers who have at least 3 events?", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT T2.date_moved_in , T1.customer_id , T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id", "question": "What is each customer's move in date, and the corresponding customer id and details?", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT T1.Customer_Event_ID , T1.property_id FROM Customer_Events AS T1 JOIN Customer_Event_Notes AS T2 ON T1.Customer_Event_ID = T2.Customer_Event_ID GROUP BY T1.customer_event_id HAVING count(*) BETWEEN 1 AND 3", "question": "Which events have the number of notes between one and three? List the event id and the property id.", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT DISTINCT T2.thing_id , T2.Type_of_Thing_Code FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21'", "question": "What are the distinct id and type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21'", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT count(DISTINCT T2.Location_Code) FROM Things AS T1 JOIN Timed_Locations_of_Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.service_details = 'Unsatisfied'", "question": "How many distinct locations have the things with service detail 'Unsatisfied' been located in?", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT count(DISTINCT Status_of_Thing_Code) FROM Timed_Status_of_Things", "question": "How many different status codes of things are there?", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT organization_id FROM organizations EXCEPT SELECT parent_organization_id FROM organizations", "question": "Which organizations are not a parent organization of others? List the organization id.", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT max(date_moved_in) FROM Residents", "question": "When is the last day any resident moved in?", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT other_details FROM Residents WHERE other_details LIKE '%Miss%'", "question": "What are the resident details containing the substring 'Miss'?", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT customer_event_id , date_moved_in , property_id FROM customer_events", "question": "List the customer event id and the corresponding move in date and property id.", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT count(*) FROM customers WHERE customer_id NOT IN ( SELECT customer_id FROM customer_events )", "question": "How many customers did not have any event?", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT DISTINCT date_moved_in FROM residents", "question": "What are the distinct move in dates of the residents?", "schema": "Customers: customer_id (INTEGER), customer_details (VARCHAR(255))\nProperties: property_id (INTEGER), property_type_code (CHAR(15)), property_address (VARCHAR(255)), other_details (VARCHAR(255))\nResidents: resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME), date_moved_out (DATETIME), other_details (VARCHAR(255))\nOrganizations: organization_id (INTEGER), parent_organization_id (INTEGER), organization_details (VARCHAR(255))\nServices: service_id (INTEGER), organization_id (INTEGER), service_type_code (CHAR(15)), service_details (VARCHAR(255))\nResidents_Services: resident_id (INTEGER), service_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), date_requested (DATETIME), date_provided (DATETIME), other_details (VARCHAR(255))\nThings: thing_id (INTEGER), organization_id (INTEGER), Type_of_Thing_Code (CHAR(15)), service_type_code (CHAR(10)), service_details (VARCHAR(255))\nCustomer_Events: Customer_Event_ID (INTEGER), customer_id (INTEGER), date_moved_in (DATETIME), property_id (INTEGER), resident_id (INTEGER), thing_id (INTEGER)\nCustomer_Event_Notes: Customer_Event_Note_ID (INTEGER), Customer_Event_ID (INTEGER), service_type_code (CHAR(15)), resident_id (INTEGER), property_id (INTEGER), date_moved_in (DATETIME)\nTimed_Status_of_Things: thing_id (INTEGER), Date_and_Date (DATETIME), Status_of_Thing_Code (CHAR(15))\nTimed_Locations_of_Things: thing_id (INTEGER), Date_and_Time (DATETIME), Location_Code (CHAR(15))" }, { "query": "SELECT count(*) FROM school", "question": "How many schools are there?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT count(*) FROM school", "question": "Count the number of schools.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT LOCATION FROM school ORDER BY Enrollment ASC", "question": "List the locations of schools in ascending order of enrollment.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT LOCATION FROM school ORDER BY Enrollment ASC", "question": "What is the list of school locations sorted in ascending order of school enrollment?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT LOCATION FROM school ORDER BY Founded DESC", "question": "List the locations of schools in descending order of founded year.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT LOCATION FROM school ORDER BY Founded DESC", "question": "What is the list of school locations sorted in descending order of school foundation year?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Enrollment FROM school WHERE Denomination != \"Catholic\"", "question": "What are the enrollments of schools whose denomination is not \"Catholic\"?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Enrollment FROM school WHERE Denomination != \"Catholic\"", "question": "List the enrollment for each school that does not have \"Catholic\" as denomination.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT avg(Enrollment) FROM school", "question": "What is the average enrollment of schools?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT avg(Enrollment) FROM school", "question": "Take the average of the school enrollment.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Team FROM player ORDER BY Team ASC", "question": "What are the teams of the players, sorted in ascending alphabetical order?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Team FROM player ORDER BY Team ASC", "question": "Find the team of each player and sort them in ascending alphabetical order.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT count(DISTINCT POSITION) FROM player", "question": "How many different positions of players are there?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT count(DISTINCT POSITION) FROM player", "question": "Count the number of distinct player positions.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Team FROM player ORDER BY Age DESC LIMIT 1", "question": "Find the team of the player of the highest age.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Team FROM player ORDER BY Age DESC LIMIT 1", "question": "Which team has the oldest player?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Team FROM player ORDER BY Age DESC LIMIT 5", "question": "List the teams of the players with the top 5 largest ages.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Team FROM player ORDER BY Age DESC LIMIT 5", "question": "What are the teams that have the 5 oldest players?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT T1.Team , T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID", "question": "For each player, show the team and the location of school they belong to.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT T1.Team , T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID", "question": "What are the team and the location of school each player belongs to?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1", "question": "Show the locations of schools that have more than 1 player.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1", "question": "Which schools have more than 1 player? Give me the school locations.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the denomination of the school that has the most players.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the denomination of the school the most players belong to?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT T1.Location , T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID", "question": "Show locations and nicknames of schools.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT T1.Location , T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID", "question": "What are the location and nickname of each school?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination", "question": "Please show different denominations and the corresponding number of schools.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination", "question": "For each denomination, return the denomination and the count of schools with that denomination.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC", "question": "Please show different denominations and the corresponding number of schools in descending order.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC", "question": "Order denominations in descending order of the count of schools with the denomination. Return each denomination with the count of schools.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1", "question": "List the school color of the school that has the largest enrollment.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1", "question": "What is the school color of the school with the largest enrollment?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT LOCATION FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player)", "question": "List the locations of schools that do not have any player.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT LOCATION FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player)", "question": "Which schools do not have any player? Give me the school locations.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900", "question": "Show the denomination shared by schools founded before 1890 and schools founded after 1900", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900", "question": "What are the denominations used by both schools founded before 1890 and schools founded after 1900?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Nickname FROM school_details WHERE Division != \"Division 1\"", "question": "Show the nicknames of schools that are not in division 1.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Nickname FROM school_details WHERE Division != \"Division 1\"", "question": "What are the nicknames of schools whose division is not 1?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Denomination FROM school GROUP BY Denomination HAVING COUNT(*) > 1", "question": "Show the denomination shared by more than one school.", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT Denomination FROM school GROUP BY Denomination HAVING COUNT(*) > 1", "question": "What are the denomination more than one school have?", "schema": "school: School_ID (INT), School (TEXT), Location (TEXT), Enrollment (REAL), Founded (REAL), Denomination (TEXT), Boys_or_Girls (TEXT), Day_or_Boarding (TEXT), Year_Entered_Competition (REAL), School_Colors (TEXT)\nschool_details: School_ID (INT), Nickname (TEXT), Colors (TEXT), League (TEXT), Class (TEXT), Division (TEXT)\nschool_performance: School_Id (INT), School_Year (TEXT), Class_A (TEXT), Class_AA (TEXT)\nplayer: Player_ID (INT), Player (TEXT), Team (TEXT), Age (INT), Position (TEXT), School_ID (INT)" }, { "query": "SELECT DISTINCT District_name FROM district ORDER BY city_area DESC", "question": "Find all the distinct district names ordered by city area in descending.", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT DISTINCT District_name FROM district ORDER BY city_area DESC", "question": "What are the different district names in order of descending city area?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT max_page_size FROM product GROUP BY max_page_size HAVING count(*) > 3", "question": "Find the list of page size which have more than 3 product listed", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT max_page_size FROM product GROUP BY max_page_size HAVING count(*) > 3", "question": "What is the maximum page size for everything that has more than 3 products listed?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT District_name , City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000", "question": "Find the name and population of district with population between 200000 and 2000000", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT District_name , City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000", "question": "What are the district names and city populations for all districts that between 200,000 and 2,000,000 residents?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000", "question": "Find the name all districts with city area greater than 10 or population larger than 100000", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000", "question": "What are the names of all districts with a city area greater than 10 or have more than 100000 people living there?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1", "question": "Which district has the largest population?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1", "question": "What is the name of the district with the most residents?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT district_name FROM district ORDER BY city_area ASC LIMIT 1", "question": "Which district has the least area?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT district_name FROM district ORDER BY city_area ASC LIMIT 1", "question": "What is the name of the district with the smallest area?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT sum(city_population) FROM district ORDER BY city_area DESC LIMIT 3", "question": "Find the total population of the top 3 districts with the largest area.", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT sum(city_population) FROM district ORDER BY city_area DESC LIMIT 3", "question": "What is the total number of residents for the districts with the 3 largest areas?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT TYPE , count(*) FROM store GROUP BY TYPE", "question": "Find all types of store and number of them.", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT TYPE , count(*) FROM store GROUP BY TYPE", "question": "For each type of store, how many of them are there?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = \"Khanewal District\"", "question": "Find the names of all stores in Khanewal District.", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = \"Khanewal District\"", "question": "What are the names of all the stores located in Khanewal District?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id WHERE district_id = (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1)", "question": "Find all the stores in the district with the most population.", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id WHERE district_id = (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1)", "question": "What are the names of all the stores in the largest district by population?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = \"Blackville\"", "question": "Which city is the headquarter of the store named \"Blackville\" in?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = \"Blackville\"", "question": "What city is the headquarter of the store Blackville?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT t3.headquartered_city , count(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city", "question": "Find the number of stores in each city.", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT t3.headquartered_city , count(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city", "question": "How many stores are headquarted in each city?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY count(*) DESC LIMIT 1", "question": "Find the city with the most number of stores.", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY count(*) DESC LIMIT 1", "question": "What is the city with the most number of flagship stores?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT avg(pages_per_minute_color) FROM product", "question": "What is the average pages per minute color?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT avg(pages_per_minute_color) FROM product", "question": "What is the average number of pages per minute color?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id = t2.product_id JOIN store AS t3 ON t2.store_id = t3.store_id WHERE t3.store_name = \"Miramichi\"", "question": "What products are available at store named \"Miramichi\"?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id = t2.product_id JOIN store AS t3 ON t2.store_id = t3.store_id WHERE t3.store_name = \"Miramichi\"", "question": "What products are sold at the store named Miramichi?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT product FROM product WHERE max_page_size = \"A4\" AND pages_per_minute_color < 5", "question": "Find products with max page size as \"A4\" and pages per minute color smaller than 5.", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT product FROM product WHERE max_page_size = \"A4\" AND pages_per_minute_color < 5", "question": "What are the products with the maximum page size A4 that also have a pages per minute color smaller than 5?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT product FROM product WHERE max_page_size = \"A4\" OR pages_per_minute_color < 5", "question": "Find products with max page size as \"A4\" or pages per minute color smaller than 5.", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT product FROM product WHERE max_page_size = \"A4\" OR pages_per_minute_color < 5", "question": "What are the products with the maximum page size eqal to A4 or a pages per minute color less than 5?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT product FROM product WHERE product LIKE \"%Scanner%\"", "question": "Find all the product whose name contains the word \"Scanner\".", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT product FROM product WHERE product LIKE \"%Scanner%\"", "question": "What are all of the products whose name includes the substring \"Scanner\"?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1", "question": "Find the most prominent max page size among all the products.", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1", "question": "What is the most common maximum page size?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT product FROM product WHERE product != (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1)", "question": "Find the name of the products that are not using the most frequently-used max page size.", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT product FROM product WHERE product != (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1)", "question": "What are the names of all products that are not the most frequently-used maximum page size?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT sum(city_population) FROM district WHERE city_area > (SELECT avg(city_area) FROM district)", "question": "Find the total population of the districts where the area is bigger than the average city area.", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT sum(city_population) FROM district WHERE city_area > (SELECT avg(city_area) FROM district)", "question": "What is the total population for all the districts that have an area larger tahn the average city area?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = \"City Mall\" INTERSECT SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = \"Village Store\"", "question": "Find the names of districts where have both city mall and village store type stores.", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = \"City Mall\" INTERSECT SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = \"Village Store\"", "question": "What are the names of the districts that have both mall and village store style shops?", "schema": "product: product_id (INT), product (TEXT), dimensions (TEXT), dpi (REAL), pages_per_minute_color (REAL), max_page_size (TEXT), interface (TEXT)\nstore: Store_ID (INT), Store_Name (TEXT), Type (TEXT), Area_size (REAL), Number_of_product_category (REAL), Ranking (INT)\ndistrict: District_ID (INT), District_name (TEXT), Headquartered_City (TEXT), City_Population (REAL), City_Area (REAL)\nstore_product: Store_ID (INT), Product_ID (INT)\nstore_district: Store_ID (INT), District_ID (INT)" }, { "query": "SELECT sum(enr) FROM College", "question": "What is the total enrollment number of all colleges?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT sum(enr) FROM College", "question": "How many students are enrolled in college?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT avg(enr) FROM College", "question": "What is the average enrollment number?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT avg(enr) FROM College", "question": "How many students, on average, does each college have enrolled?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(*) FROM College", "question": "How many colleges in total?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(*) FROM College", "question": "How many different colleges are there?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Player WHERE HS > 1000", "question": "How many players have more than 1000 hours of training?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(*) FROM Player WHERE HS > 1000", "question": "How many different players trained for more than 1000 hours?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(*) FROM College WHERE enr > 15000", "question": "How many colleges has more than 15000 students?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(*) FROM College WHERE enr > 15000", "question": "What is the number of colleges with a student population greater than 15000?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT avg(HS) FROM Player", "question": "What is the average training hours of all players?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT avg(HS) FROM Player", "question": "How many hours do the players train on average?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT pName , HS FROM Player WHERE HS < 1500", "question": "Find the name and training hours of players whose hours are below 1500.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT pName , HS FROM Player WHERE HS < 1500", "question": "What are the names and number of hours spent training for each player who trains for less than 1500 hours?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(DISTINCT cName) FROM tryout", "question": "How many different colleges do attend the tryout test?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(DISTINCT cName) FROM tryout", "question": "How many different colleges were represented at tryouts?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(DISTINCT pPos) FROM tryout", "question": "What are the unique types of player positions in the tryout?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(DISTINCT pPos) FROM tryout", "question": "What are the different types of player positions?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(*) FROM tryout WHERE decision = 'yes'", "question": "How many students got accepted after the tryout?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(*) FROM tryout WHERE decision = 'yes'", "question": "How many students received a yes from tryouts?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(*) FROM tryout WHERE pPos = 'goalie'", "question": "How many students whose are playing the role of goalie?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(*) FROM tryout WHERE pPos = 'goalie'", "question": "What is the number of students playing as a goalie?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT avg(HS) , max(HS) , min(HS) FROM Player", "question": "Find the max, average and min training hours of all players.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT avg(HS) , max(HS) , min(HS) FROM Player", "question": "What is the average, maximum, and minimum for the number of hours spent training?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT avg(enr) FROM College WHERE state = 'FL'", "question": "What is average enrollment of colleges in the state FL?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT avg(enr) FROM College WHERE state = 'FL'", "question": "What is average number of students enrolled in Florida colleges?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500", "question": "What are the names of players whose training hours is between 500 and 1500?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500", "question": "What are the names of players who train between 500 and 1500 hours?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT DISTINCT pName FROM Player WHERE pName LIKE '%a%'", "question": "Find the players whose names contain letter 'a'.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT DISTINCT pName FROM Player WHERE pName LIKE '%a%'", "question": "Who are the players that have names containing the letter a?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName , enr FROM College WHERE enr > 10000 AND state = \"LA\"", "question": "Find the name, enrollment of the colleges whose size is bigger than 10000 and location is in state LA.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName , enr FROM College WHERE enr > 10000 AND state = \"LA\"", "question": "What are the names and enrollment numbers for colleges that have more than 10000 enrolled and are located in Louisiana?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT * FROM College ORDER BY enr", "question": "List all information about college sorted by enrollment number in the ascending order.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT * FROM College ORDER BY enr", "question": "What information do you have on colleges sorted by increasing enrollment numbers?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName FROM College WHERE enr > 18000 ORDER BY cName", "question": "List the name of the colleges whose enrollment is greater 18000 sorted by the college's name.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName FROM College WHERE enr > 18000 ORDER BY cName", "question": "What is the name of every college in alphabetical order that has more than 18000 students enrolled?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT pName FROM Player WHERE yCard = 'yes' ORDER BY HS DESC", "question": "Find the name of players whose card is yes in the descending order of training hours.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT pName FROM Player WHERE yCard = 'yes' ORDER BY HS DESC", "question": "What are the name of the players who received a card in descending order of the hours of training?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT DISTINCT cName FROM tryout ORDER BY cName", "question": "Find the name of different colleges involved in the tryout in alphabetical order.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT DISTINCT cName FROM tryout ORDER BY cName", "question": "What are the different names of the colleges involved in the tryout in alphabetical order?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT pPos FROM tryout GROUP BY pPos ORDER BY count(*) DESC LIMIT 1", "question": "Which position is most popular among players in the tryout?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT pPos FROM tryout GROUP BY pPos ORDER BY count(*) DESC LIMIT 1", "question": "What was the most popular position at tryouts?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(*) , cName FROM tryout GROUP BY cName ORDER BY count(*) DESC", "question": "Find the number of students who participate in the tryout for each college ordered by descending count.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(*) , cName FROM tryout GROUP BY cName ORDER BY count(*) DESC", "question": "How many students participated in tryouts for each college by descennding count?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT min(T2.HS) , T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID GROUP BY T1.pPos", "question": "What is minimum hours of the students playing in different position?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT min(T2.HS) , T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID GROUP BY T1.pPos", "question": "For each position, what is the minimum time students spent practicing?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName FROM college ORDER BY enr DESC LIMIT 3", "question": "What are the names of schools with the top 3 largest size?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName FROM college ORDER BY enr DESC LIMIT 3", "question": "What are the names of the schools with the top 3 largest class sizes?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName , state , min(enr) FROM college GROUP BY state", "question": "What is the name of school that has the smallest enrollment in each state?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName , state , min(enr) FROM college GROUP BY state", "question": "What is the name of the school with smallest enrollment size per state?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName", "question": "Find the states where have some college students in tryout.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName", "question": "What are the different states that have students trying out?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT DISTINCT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'", "question": "Find the states where have some college students in tryout and their decisions are yes.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT DISTINCT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'", "question": "What are the different states that had students successfully try out?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.pName , T2.cName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'", "question": "Find the name and college of students whose decisions are yes in the tryout.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.pName , T2.cName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'", "question": "What are the names of all the players who received a yes during tryouts, and also what are the names of their colleges?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName", "question": "Find the name of all students who were in the tryout sorted in alphabetic order.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName", "question": "What are the names of all students who tried out in alphabetical order?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.pName , T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'", "question": "Find the name and hours of the students whose tryout decision is yes.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.pName , T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'", "question": "What are the names and hours spent practicing of every student who received a yes at tryouts?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker'", "question": "Find the states of the colleges that have students in the tryout who played in striker position.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker'", "question": "What are the states of the colleges where students who tried out for the striker position attend?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker'", "question": "Find the names of the students who are in the position of striker and got a yes tryout decision.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker'", "question": "What are the names of all students who successfully tried out for the position of striker?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles'", "question": "Find the state of the college which player Charles is attending.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles'", "question": "In which state is the college that Charles attends?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT avg(T1.HS) , max(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'", "question": "Find the average and maximum hours for the students whose tryout decision is yes.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT avg(T1.HS) , max(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'", "question": "What is the average and maximum number of hours students who made the team practiced?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT avg(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no'", "question": "Find the average hours for the students whose tryout decision is no.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT avg(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no'", "question": "What is the average number of hours spent practicing for students who got rejected?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT max(T1.HS) , pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos", "question": "What is the maximum training hours for the students whose training hours is greater than 1000 in different positions?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT max(T1.HS) , pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos", "question": "For each position, what is the maximum number of hours for students who spent more than 1000 hours training?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%'", "question": "Which colleges do the tryout players whose name starts with letter D go to?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%'", "question": "Which colleges does each player with a name that starts with the letter D who tried out go to?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie'", "question": "Which college has any student who is a goalie and succeeded in the tryout.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie'", "question": "What college has a student who successfully made the team in the role of a goalie?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM college ORDER BY enr DESC LIMIT 1)", "question": "Find the name of the tryout players who are from the college with largest size.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM college ORDER BY enr DESC LIMIT 1)", "question": "What are the names of all tryout participants who are from the largest college?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT DISTINCT T1.state , T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'", "question": "What is the state and enrollment of the colleges where have any students who got accepted in the tryout decision.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT DISTINCT T1.state , T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'", "question": "How many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName FROM College WHERE enr < 13000 AND state = \"AZ\" UNION SELECT cName FROM College WHERE enr > 15000 AND state = \"LA\"", "question": "Find the names of either colleges in LA with greater than 15000 size or in state AZ with less than 13000 enrollment.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName FROM College WHERE enr < 13000 AND state = \"AZ\" UNION SELECT cName FROM College WHERE enr > 15000 AND state = \"LA\"", "question": "What are the names of colleges in LA that have more than 15,000 students and of colleges in AZ with less than 13,000 students?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid'", "question": "Find the names of schools that have some students playing in goalie and mid positions.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid'", "question": "What are the names of all schools that have students trying out for the position of goal and 'mid'-field.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid'", "question": "Find the names of states that have some college students playing in goalie and mid positions.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid'", "question": "What are the names of the states that have some college students playing in the positions of goalie and mid-field?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid')", "question": "How many schools have some students playing in goalie and mid positions.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid')", "question": "How many schools have students playing in goalie and mid-field positions?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie'", "question": "Find the names of schools that have some players in the mid position but not in the goalie position.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie'", "question": "What are the names of the schools with some players in the mid position but no goalies?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie'", "question": "Find the names of states that have some college students playing in the mid position but not in the goalie position.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie'", "question": "What are the names of all the states with college students playing in the mid position but no goalies?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie')", "question": "How many states that have some college students playing in the mid position but not in the goalie position.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie')", "question": "What is the count of states with college students playing in the mid position but not as goalies?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT DISTINCT state FROM college WHERE enr < (SELECT max(enr) FROM college)", "question": "Find the states where have the colleges whose enrollments are less than the largest size.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT DISTINCT state FROM college WHERE enr < (SELECT max(enr) FROM college)", "question": "What are the states with colleges that have enrollments less than the some other college?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT DISTINCT cName FROM college WHERE enr > (SELECT min(enr) FROM college WHERE state = 'FL')", "question": "Find names of colleges with enrollment greater than that of some (at least one) college in the FL state.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT DISTINCT cName FROM college WHERE enr > (SELECT min(enr) FROM college WHERE state = 'FL')", "question": "What are the names of the colleges that are larger than at least one college in Florida?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName FROM college WHERE enr > (SELECT max(enr) FROM college WHERE state = 'FL')", "question": "Find names of all colleges whose enrollment is greater than that of all colleges in the FL state.", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT cName FROM college WHERE enr > (SELECT max(enr) FROM college WHERE state = 'FL')", "question": "What are the names of all colleges with a larger enrollment than the largest college in Florida?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT sum(enr) FROM college WHERE cName NOT IN (SELECT cName FROM tryout WHERE pPos = \"goalie\")", "question": "What is the total number of enrollment of schools that do not have any goalie player?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT sum(enr) FROM college WHERE cName NOT IN (SELECT cName FROM tryout WHERE pPos = \"goalie\")", "question": "What is the total number of students enrolled in schools without any goalies?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(DISTINCT state) FROM college WHERE enr > (SELECT avg(enr) FROM college)", "question": "What is the number of states that has some college whose enrollment is larger than the average enrollment?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(DISTINCT state) FROM college WHERE enr > (SELECT avg(enr) FROM college)", "question": "How many states have a college with more students than average?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(DISTINCT state) FROM college WHERE enr < (SELECT avg(enr) FROM college)", "question": "What is the number of states that has some colleges whose enrollment is smaller than the average enrollment?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(DISTINCT state) FROM college WHERE enr < (SELECT avg(enr) FROM college)", "question": "How many states have smaller colleges than average?", "schema": "\tCollege: state (VARCHAR(2)), enr (NUMERIC(50))\n\tPlayer: pName (VARCHAR(20)), yCard (VARCHAR(3)), HS (NUMERIC(50))\n\tTryout: cName (VARCHAR(20)), pPos (VARCHAR(8)), decision (VARCHAR(3))" }, { "query": "SELECT count(*) FROM device", "question": "How many devices are there?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT count(*) FROM device", "question": "Count the number of devices.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Carrier FROM device ORDER BY Carrier ASC", "question": "List the carriers of devices in ascending alphabetical order.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Carrier FROM device ORDER BY Carrier ASC", "question": "What are the different carriers for devices, listed in alphabetical order?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Carrier FROM device WHERE Software_Platform != 'Android'", "question": "What are the carriers of devices whose software platforms are not \"Android\"?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Carrier FROM device WHERE Software_Platform != 'Android'", "question": "Return the device carriers that do not have Android as their software platform.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Shop_Name FROM shop ORDER BY Open_Year ASC", "question": "What are the names of shops in ascending order of open year?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Shop_Name FROM shop ORDER BY Open_Year ASC", "question": "Return the names of shops, ordered by year of opening ascending.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT avg(Quantity) FROM stock", "question": "What is the average quantity of stocks?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT avg(Quantity) FROM stock", "question": "Give the average quantity of stocks.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Shop_Name , LOCATION FROM shop ORDER BY Shop_Name ASC", "question": "What are the names and location of the shops in ascending alphabetical order of name.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Shop_Name , LOCATION FROM shop ORDER BY Shop_Name ASC", "question": "Return the names and locations of shops, ordered by name in alphabetical order.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT count(DISTINCT Software_Platform) FROM device", "question": "How many different software platforms are there for devices?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT count(DISTINCT Software_Platform) FROM device", "question": "Count the number of different software platforms.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Open_Date , Open_Year FROM shop WHERE Shop_Name = \"Apple\"", "question": "List the open date of open year of the shop named \"Apple\".", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Open_Date , Open_Year FROM shop WHERE Shop_Name = \"Apple\"", "question": "What are the open dates and years for the shop named Apple?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Shop_Name FROM shop ORDER BY Open_Year DESC LIMIT 1", "question": "List the name of the shop with the latest open year.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Shop_Name FROM shop ORDER BY Open_Year DESC LIMIT 1", "question": "What is the shop name corresponding to the shop that opened in the most recent year?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT T3.Shop_Name , T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID", "question": "Show names of shops and the carriers of devices they have in stock.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT T3.Shop_Name , T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID", "question": "What are the names of device shops, and what are the carriers that they carry devices in stock for?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1", "question": "Show names of shops that have more than one kind of device in stock.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1", "question": "What are the names of shops that have more than a single kind of device in stock?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the name of the shop that has the most kind of devices in stock.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the name of the shop that has the most different kinds of devices in stock?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1", "question": "Show the name of the shop that have the largest quantity of devices in stock.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1", "question": "What is the name of the shop that has the greatest quantity of devices in stock?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Software_Platform , COUNT(*) FROM device GROUP BY Software_Platform", "question": "Please show different software platforms and the corresponding number of devices using each.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Software_Platform , COUNT(*) FROM device GROUP BY Software_Platform", "question": "What are the different software platforms for devices, and how many devices have each?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC", "question": "Please show the software platforms of devices in descending order of the count.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC", "question": "What are the different software platforms for devices, ordered by frequency descending?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1", "question": "List the software platform shared by the greatest number of devices.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the software platform that is most common amongst all devices?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Shop_Name FROM shop WHERE Shop_ID NOT IN (SELECT Shop_ID FROM stock)", "question": "List the names of shops that have no devices in stock.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Shop_Name FROM shop WHERE Shop_ID NOT IN (SELECT Shop_ID FROM stock)", "question": "What are the names of shops that do not have any devices in stock?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008", "question": "Show the locations shared by shops with open year later than 2012 and shops with open year before 2008.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008", "question": "Which locations contains both shops that opened after the year 2012 and shops that opened before 2008?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Carrier FROM device WHERE Device_ID NOT IN (SELECT Device_ID FROM stock)", "question": "List the carriers of devices that have no devices in stock.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT Carrier FROM device WHERE Device_ID NOT IN (SELECT Device_ID FROM stock)", "question": "What are the carriers of devices that are not in stock anywhere?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1", "question": "Show the carriers of devices in stock at more than one shop.", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1", "question": "What are the carriers of devices that are in stock in more than a single shop?", "schema": "device: Device_ID (INT), Device (TEXT), Carrier (TEXT), Package_Version (TEXT), Applications (TEXT), Software_Platform (TEXT)\nshop: Shop_ID (INT), Shop_Name (TEXT), Location (TEXT), Open_Date (TEXT), Open_Year (INT)\nstock: Shop_ID (INT), Device_ID (INT), Quantity (INT)" }, { "query": "SELECT count(*) FROM BOOKINGS", "question": "How many bookings do we have?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM BOOKINGS", "question": "Count the total number of bookings made.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Order_Date FROM BOOKINGS", "question": "List the order dates of all the bookings.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Order_Date FROM BOOKINGS", "question": "What is the order date of each booking?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Planned_Delivery_Date , Actual_Delivery_Date FROM BOOKINGS", "question": "Show all the planned delivery dates and actual delivery dates of bookings.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Planned_Delivery_Date , Actual_Delivery_Date FROM BOOKINGS", "question": "What are the planned delivery date and actual delivery date for each booking?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM CUSTOMERS", "question": "How many customers do we have?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM CUSTOMERS", "question": "Count the number of customers recorded.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Customer_Phone , Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name = \"Harold\"", "question": "What are the phone and email for customer Harold?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Customer_Phone , Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name = \"Harold\"", "question": "Find the phone number and email address of customer \"Harold\".", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Store_Name FROM Drama_Workshop_Groups", "question": "Show all the Store_Name of drama workshop groups.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Store_Name FROM Drama_Workshop_Groups", "question": "What are the store names of drama workshop groups?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT min(Order_Quantity) , avg(Order_Quantity) , max(Order_Quantity) FROM INVOICES", "question": "Show the minimum, average, maximum order quantity of all invoices.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT min(Order_Quantity) , avg(Order_Quantity) , max(Order_Quantity) FROM INVOICES", "question": "What are the minimum, average, and maximum quantities ordered? Check all the invoices.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT DISTINCT payment_method_code FROM INVOICES", "question": "What are the distinct payment method codes in all the invoices?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT DISTINCT payment_method_code FROM INVOICES", "question": "Show me the distinct payment method codes from the invoice record.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = \"China\"", "question": "What is the description of the marketing region China?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = \"China\"", "question": "Find the marketing region description of China?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT avg(Product_Price) FROM PRODUCTS)", "question": "Show all the distinct product names with price higher than the average.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT avg(Product_Price) FROM PRODUCTS)", "question": "What are the distinct names of the products that cost more than the average?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1", "question": "What is the name of the most expensive product?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1", "question": "Tell me the name of the most pricy product.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Product_Name FROM Products ORDER BY Product_Price ASC", "question": "List all product names in ascending order of price.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Product_Name FROM Products ORDER BY Product_Price ASC", "question": "Sort the names of products in ascending order of their price.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = \"Ashley\"", "question": "What is the phone number of the performer Ashley?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = \"Ashley\"", "question": "Find the phone number of performer \"Ashley\".", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT payment_method_code , count(*) FROM INVOICES GROUP BY payment_method_code", "question": "Show all payment method codes and the number of orders for each code.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT payment_method_code , count(*) FROM INVOICES GROUP BY payment_method_code", "question": "List the distinct payment method codes with the number of orders made", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1", "question": "What is the payment method code used by the most orders?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1", "question": "Find the payment method that is used the most often in all the invoices. Give me its code.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = \"FJA Filming\"", "question": "Which city is the address of the store named \"FJA Filming\" located in?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = \"FJA Filming\"", "question": "Find the city the store named \"FJA Filming\" is in.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = \"CA\"", "question": "What are the states or counties of the address of the stores with marketing region code \"CA\"?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = \"CA\"", "question": "Find the states or counties where the stores with marketing region code \"CA\" are located.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = \"Rob Dinning\"", "question": "What is the name of the marketing region that the store Rob Dinning belongs to?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = \"Rob Dinning\"", "question": "Return the name of the marketing region the store Rob Dinning is located in.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100", "question": "What are the descriptions of the service types with product price above 100?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100", "question": "Give me the descriptions of the service types that cost more than 100.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Service_Type_Description , T2.Service_Type_Code , COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code", "question": "What is the description, code and the corresponding count of each service type?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Service_Type_Description , T2.Service_Type_Code , COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code", "question": "List the description, code and the number of services for each service type.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Service_Type_Description , T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the description and code of the type of service that is performed the most often?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Service_Type_Description , T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1", "question": "Find the description and code of the service type that is performed the most times.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Store_Phone , T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID", "question": "What are the phones and emails of workshop groups in which services are performed?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Store_Phone , T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID", "question": "Give me all the phone numbers and email addresses of the workshop groups where services are performed.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Store_Phone , T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = \"film\"", "question": "What are the names of workshop groups in which services with product name \"film\" are performed?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Store_Phone , T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = \"film\"", "question": "Find the names of the workshop groups where services with product name \"film\" are performed.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Product_Name , avg(Product_Price) FROM PRODUCTS GROUP BY Product_Name", "question": "What are the different product names? What is the average product price for each of them?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Product_Name , avg(Product_Price) FROM PRODUCTS GROUP BY Product_Name", "question": "For each distinct product name, show its average product price.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING avg(Product_Price) < 1000000", "question": "What are the product names with average product price smaller than 1000000?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING avg(Product_Price) < 1000000", "question": "Find the product names whose average product price is below 1000000.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT sum(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = \"photo\"", "question": "What are the total order quantities of photo products?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT sum(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = \"photo\"", "question": "Compute the total order quantities of the product \"photo\".", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000", "question": "What are the order details of the products with price higher than 2000?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000", "question": "Find the order detail for the products with price above 2000.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1", "question": "What are the actual delivery dates of orders with quantity 1?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1", "question": "List the actual delivery date for all the orders with quantity 1", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_price > 1000", "question": "What are the order dates of orders with price higher than 1000?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_price > 1000", "question": "Find the order dates of the orders with price above 1000.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT count(DISTINCT Currency_Code) FROM Drama_Workshop_Groups", "question": "How many distinct currency codes are there for all drama workshop groups?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT count(DISTINCT Currency_Code) FROM Drama_Workshop_Groups", "question": "Find the number of distinct currency codes used in drama workshop groups.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = \"Feliciaberg\"", "question": "What are the names of the drama workshop groups with address in Feliciaberg city?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = \"Feliciaberg\"", "question": "Return the the names of the drama workshop groups that are located in Feliciaberg city.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = \"Alaska\"", "question": "What are the email addresses of the drama workshop groups with address in Alaska state?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = \"Alaska\"", "question": "List the email addresses of the drama workshop groups located in Alaska state.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.City_Town , count(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town", "question": "Show all cities along with the number of drama workshop groups in each city.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.City_Town , count(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town", "question": "How many drama workshop groups are there in each city? Return both the city and the count.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY count(*) DESC LIMIT 1", "question": "What is the marketing region code that has the most drama workshop groups?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY count(*) DESC LIMIT 1", "question": "Which marketing region has the most drama workshop groups? Give me the region code.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID", "question": "Show all cities where at least one customer lives in but no performer lives in.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID", "question": "Which cities have at least one customer but no performer?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY count(*) DESC LIMIT 1", "question": "What is the most frequent status of bookings?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY count(*) DESC LIMIT 1", "question": "Which status code is the most common of all the bookings?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = \"stop\"", "question": "What are the names of the workshop groups that have bookings with status code \"stop\"?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = \"stop\"", "question": "Which workshop groups have bookings with status code \"stop\"? Give me the names.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID", "question": "Show the names of all the clients with no booking.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID", "question": "What are the names of the clients who do not have any booking?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT avg(Order_Quantity) FROM Invoices WHERE payment_method_code = \"MasterCard\"", "question": "What is the average quantities ordered with payment method code \"MasterCard\" on invoices?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT avg(Order_Quantity) FROM Invoices WHERE payment_method_code = \"MasterCard\"", "question": "Check the invoices record and compute the average quantities ordered with the payment method \"MasterCard\".", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the product ID of the most frequently ordered item on invoices?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC LIMIT 1", "question": "Find the id of the product ordered the most often on invoices.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film'", "question": "What is the description of the service type which offers both the photo product and the film product?", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film'", "question": "Give me the description of the service type that offers not only the photo product but also the film product.", "schema": "Ref_Payment_Methods: payment_method_code (CHAR(10)), payment_method_description (VARCHAR(80))\nRef_Service_Types: Service_Type_Code (CHAR(15)), Parent_Service_Type_Code (CHAR(15)), Service_Type_Description (VARCHAR(255))\nAddresses: Address_ID (VARCHAR(100)), Line_1 (VARCHAR(255)), Line_2 (VARCHAR(255)), City_Town (VARCHAR(255)), State_County (VARCHAR(255)), Other_Details (VARCHAR(255))\nProducts: Product_ID (VARCHAR(100)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Product_Description (VARCHAR(255)), Other_Product_Service_Details (VARCHAR(255))\nMarketing_Regions: Marketing_Region_Code (CHAR(15)), Marketing_Region_Name (VARCHAR(255)), Marketing_Region_Descriptrion (VARCHAR(255)), Other_Details (VARCHAR(255))\nClients: Client_ID (INTEGER), Address_ID (INTEGER), Customer_Email_Address (VARCHAR(255)), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Other_Details (VARCHAR(255))\nDrama_Workshop_Groups: Workshop_Group_ID (INTEGER), Address_ID (INTEGER), Currency_Code (CHAR(15)), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nPerformers: Performer_ID (INTEGER), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nCustomers: Customer_ID (VARCHAR(100)), Address_ID (INTEGER), Customer_Name (VARCHAR(255)), Customer_Phone (VARCHAR(255)), Customer_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nStores: Store_ID (VARCHAR(100)), Address_ID (INTEGER), Marketing_Region_Code (CHAR(15)), Store_Name (VARCHAR(255)), Store_Phone (VARCHAR(255)), Store_Email_Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nBookings: Booking_ID (INTEGER), Customer_ID (INTEGER), Workshop_Group_ID (VARCHAR(100)), Status_Code (CHAR(15)), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nPerformers_in_Bookings: Order_ID (INTEGER), Performer_ID (INTEGER)\nCustomer_Orders: Order_ID (INTEGER), Customer_ID (INTEGER), Store_ID (INTEGER), Order_Date (DATETIME), Planned_Delivery_Date (DATETIME), Actual_Delivery_Date (DATETIME), Other_Order_Details (VARCHAR(255))\nOrder_Items: Order_Item_ID (INTEGER), Order_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255))\nInvoices: Invoice_ID (INTEGER), Order_ID (INTEGER), payment_method_code (CHAR(15)), Product_ID (INTEGER), Order_Quantity (VARCHAR(288)), Other_Item_Details (VARCHAR(255)), Order_Item_ID (INTEGER)\nServices: Service_ID (INTEGER), Service_Type_Code (CHAR(15)), Workshop_Group_ID (INTEGER), Product_Description (VARCHAR(255)), Product_Name (VARCHAR(255)), Product_Price (DECIMAL(204)), Other_Product_Service_Details (VARCHAR(255))\nBookings_Services: Order_ID (INTEGER), Product_ID (INTEGER)\nInvoice_Items: Invoice_Item_ID (INTEGER), Invoice_ID (INTEGER), Order_ID (INTEGER), Order_Item_ID (INTEGER), Product_ID (INTEGER), Order_Quantity (INTEGER), Other_Item_Details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM Band", "question": "How many bands are there?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(*) FROM Band", "question": "Find the number of bands.", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT DISTINCT label FROM Albums", "question": "What are all the labels?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT DISTINCT label FROM Albums", "question": "What are the different album labels listed?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT * FROM Albums WHERE YEAR = 2012", "question": "Find all the albums in 2012.", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT * FROM Albums WHERE YEAR = 2012", "question": "return all columns of the albums created in the year of 2012.", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = \"Solveig\"", "question": "Find all the stage positions of the musicians with first name \"Solveig\"", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = \"Solveig\"", "question": "What are the different stage positions for all musicians whose first name is \"Solveig\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(*) FROM Songs", "question": "How many songs are there?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(*) FROM Songs", "question": "Count the number of songs.", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = \"Heilo\"", "question": "Find all the songs performed by artist with last name \"Heilo\"", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = \"Heilo\"", "question": "What are the names of the songs by the artist whose last name is \"Heilo\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.Title = \"Flash\"", "question": "Hom many musicians performed in the song \"Flash\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.Title = \"Flash\"", "question": "How many musicians play in the song \"Flash\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.firstname = \"Marianne\"", "question": "Find all the songs produced by artists with first name \"Marianne\".", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.firstname = \"Marianne\"", "question": "What are the names of all songs produced by the artist with the first name \"Marianne\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = \"Badlands\"", "question": "Who performed the song named \"Badlands\"? Show the first name and the last name.", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = \"Badlands\"", "question": "What are the first and last names of the artist who perfomed the song \"Badlands\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = \"Badlands\" AND T1.StagePosition = \"back\"", "question": "Who is performing in the back stage position for the song \"Badlands\"? Show the first name and the last name.", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = \"Badlands\" AND T1.StagePosition = \"back\"", "question": "What are the first and last names of the performer who was in the back stage position for the song \"Badlands\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(DISTINCT label) FROM albums", "question": "How many unique labels are there for albums?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(DISTINCT label) FROM albums", "question": "What are the unique labels for the albums?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT label FROM albums GROUP BY label ORDER BY count(*) DESC LIMIT 1", "question": "What is the label that has the most albums?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT label FROM albums GROUP BY label ORDER BY count(*) DESC LIMIT 1", "question": "What is the label with the most albums?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY count(*) DESC LIMIT 1", "question": "What is the last name of the musician that have produced the most number of songs?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY count(*) DESC LIMIT 1", "question": "What is the last name of the musician who was in the most songs?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE stageposition = \"back\" GROUP BY lastname ORDER BY count(*) DESC LIMIT 1", "question": "What is the last name of the musician that has been at the back position the most?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE stageposition = \"back\" GROUP BY lastname ORDER BY count(*) DESC LIMIT 1", "question": "What is the last name of the musicians who has played back position the most?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT title FROM songs WHERE title LIKE '% the %'", "question": "Find all the songs whose name contains the word \"the\".", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT title FROM songs WHERE title LIKE '% the %'", "question": "What are the names of the songs whose title has the word \"the\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT DISTINCT instrument FROM Instruments", "question": "What are all the instruments used?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT DISTINCT instrument FROM Instruments", "question": "What are the different instruments listed in the database?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = \"Heilo\" AND T3.title = \"Le Pop\"", "question": "What instrument did the musician with last name \"Heilo\" use in the song \"Le Pop\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = \"Heilo\" AND T3.title = \"Le Pop\"", "question": "What instruments did the musician with the last name \"Heilo\" play in the song \"Le Pop\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT instrument FROM instruments GROUP BY instrument ORDER BY count(*) DESC LIMIT 1", "question": "What is the most used instrument?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT instrument FROM instruments GROUP BY instrument ORDER BY count(*) DESC LIMIT 1", "question": "What instrument is used the most?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(*) FROM instruments WHERE instrument = \"drums\"", "question": "How many songs have used the instrument \"drums\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(*) FROM instruments WHERE instrument = \"drums\"", "question": "How many songs use drums as an instrument?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT instrument FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Le Pop\"", "question": "What instruments does the the song \"Le Pop\" use?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT instrument FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Le Pop\"", "question": "What are the instruments are used in the song \"Le Pop\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Le Pop\"", "question": "How many instruments does the song \"Le Pop\" use?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Le Pop\"", "question": "How many different instruments are used in the song \"Le Pop\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = \"Heilo\"", "question": "How many instrument does the musician with last name \"Heilo\" use?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = \"Heilo\"", "question": "How many different instruments does the musician with the last name \"Heilo\" use?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT instrument FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = \"Heilo\"", "question": "Find all the instruments ever used by the musician with last name \"Heilo\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT instrument FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = \"Heilo\"", "question": "What are all the instruments used by the musician with the last name \"Heilo\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT title FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid GROUP BY T1.songid ORDER BY count(*) DESC LIMIT 1", "question": "Which song has the most vocals?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT title FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid GROUP BY T1.songid ORDER BY count(*) DESC LIMIT 1", "question": "What is the song with the most vocals?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1", "question": "Which vocal type is the most frequently appearring type?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1", "question": "What is the type of vocables that appears most frequently?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE lastname = \"Heilo\" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1", "question": "Which vocal type has the band mate with last name \"Heilo\" played the most?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE lastname = \"Heilo\" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1", "question": "What is the type of vocals that the band member with the last name \"Heilo\" played the most?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Le Pop\"", "question": "What are the vocal types used in song \"Le Pop\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Le Pop\"", "question": "What are the types of vocals used in the song \"Le Pop\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Demon Kitty Rag\"", "question": "Find the number of vocal types used in song \"Demon Kitty Rag\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Demon Kitty Rag\"", "question": "What are the types of vocals used in the song \"Demon Kitty Rag\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = \"lead\"", "question": "How many songs have a lead vocal?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = \"lead\"", "question": "How many songs have vocals of type lead?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.firstname = \"Solveig\" AND T2.title = \"A Bar In Amsterdam\"", "question": "Which vocal type did the musician with first name \"Solveig\" played in the song with title \"A Bar in Amsterdam\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.firstname = \"Solveig\" AND T2.title = \"A Bar In Amsterdam\"", "question": "What are the types of vocals that the musician with the first name \"Solveig\" played in the song \"A Bar in Amsterdam\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = \"lead\"", "question": "Find all the songs that do not have a lead vocal.", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = \"lead\"", "question": "What are the names of the songs without a lead vocal?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT DISTINCT TYPE FROM vocals", "question": "Find all the vocal types.", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT DISTINCT TYPE FROM vocals", "question": "What are the different types of vocals?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT * FROM Albums WHERE YEAR = 2010", "question": "What are the albums produced in year 2010?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT * FROM Albums WHERE YEAR = 2010", "question": "What information is there on albums from 2010?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = \"Le Pop\"", "question": "Who performed the song named \"Le Pop\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = \"Le Pop\"", "question": "What is the first and last name of artist who performed \"Le Pop\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY count(*) DESC LIMIT 1", "question": "What is the last name of the musician that have produced the most songs?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY count(*) DESC LIMIT 1", "question": "What is the last name of the artist who sang the most songs?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = \"Heilo\" AND T3.title = \"Badlands\"", "question": "What instrument did the musician with last name \"Heilo\" use in the song \"Badlands\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = \"Heilo\" AND T3.title = \"Badlands\"", "question": "What instruments did the musician with the last name \"Heilo\" play in \"Badlands\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Badlands\"", "question": "How many instruments does the song \"Badlands\" use?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Badlands\"", "question": "How many different instruments are used in the song \"Badlands\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Badlands\"", "question": "What are the vocal types used in song \"Badlands\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Badlands\"", "question": "What types of vocals are used in the song \"Badlands\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Le Pop\"", "question": "Find the number of vocal types used in song \"Le Pop\"", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = \"Le Pop\"", "question": "How many vocal types are used in the song \"Le Pop\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = \"shared\"", "question": "How many songs have a shared vocal?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = \"shared\"", "question": "How many different songs have shared vocals?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = \"back\"", "question": "Find all the songs that do not have a back vocal.", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = \"back\"", "question": "What are the different names of all songs without back vocals?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = \"Solveig\" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1", "question": "Which vocal type has the band mate with first name \"Solveig\" played the most?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = \"Solveig\" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1", "question": "What are the types of vocals that the band member with the first name \"Solveig\" played the most?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.lastname = \"Heilo\" AND T2.title = \"Der Kapitan\"", "question": "Which vocal type did the musician with last name \"Heilo\" played in the song with title \"Der Kapitan\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.lastname = \"Heilo\" AND T2.title = \"Der Kapitan\"", "question": "What are the types of vocals that the musician with the last name \"Heilo\" played in \"Der Kapitan\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate = t2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY firstname ORDER BY count(*) DESC LIMIT 1", "question": "Find the first name of the band mate that has performed in most songs.", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate = t2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY firstname ORDER BY count(*) DESC LIMIT 1", "question": "What is the first name of the band mate who perfomed in the most songs?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = \"Marianne\" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1", "question": "Which vocal type has the band mate with first name \"Marianne\" played the most?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = \"Marianne\" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1", "question": "What is the vocal type of the band mate whose first name is \"Marianne\" played the most?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = \"Der Kapitan\" AND T1.StagePosition = \"back\"", "question": "Who is performing in the back stage position for the song \"Der Kapitan\"? Show the first name and last name.", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = \"Der Kapitan\" AND T1.StagePosition = \"back\"", "question": "What is the first and last name of the artist who performed back stage for the song \"Der Kapitan\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = \"back\"", "question": "Find the name of songs that does not have a back vocal.", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = \"back\"", "question": "What are the names of the songs that do not have back vocals?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE T1.title = \"A Kiss Before You Go: Live in Hamburg\"", "question": "What are the songs in album \"A Kiss Before You Go: Live in Hamburg\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE T1.title = \"A Kiss Before You Go: Live in Hamburg\"", "question": "What are the song titles on the album \"A Kiss Before You Go: Live in Hamburg\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.label = \"Universal Music Group\"", "question": "What are all the songs in albums under label \"Universal Music Group\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.label = \"Universal Music Group\"", "question": "What are the names of all the songs whose album is under the label of \"Universal Music Group\"?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(DISTINCT T3.title) FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.type = \"Studio\"", "question": "Find the number of songs in all the studio albums.", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT count(DISTINCT T3.title) FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.type = \"Studio\"", "question": "How many songs appear in studio albums?", "schema": "Songs: SongId (INTEGER), Title (TEXT)\nAlbums: AId (INTEGER), Title (TEXT), Year (INTEGER), Label (TEXT), Type (TEXT)\nBand: Id (INTEGER), Firstname (TEXT), Lastname (TEXT)\nInstruments: SongId (INTEGER), BandmateId (INTEGER), Instrument (TEXT)\nPerformance: SongId (INTEGER), Bandmate (INTEGER), StagePosition (TEXT)\nTracklists: AlbumId (INTEGER), Position (INTEGER), SongId (INTEGER)\nVocals: SongId (INTEGER), Bandmate (INTEGER), Type (TEXT)" }, { "query": "SELECT founder FROM manufacturers WHERE name = 'Sony'", "question": "Who is the founder of Sony?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT founder FROM manufacturers WHERE name = 'Sony'", "question": "Return the founder of Sony.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT headquarter FROM manufacturers WHERE founder = 'James'", "question": "Where is the headquarter of the company founded by James?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT headquarter FROM manufacturers WHERE founder = 'James'", "question": "What is the headquarter of the company whose founder is James?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name , headquarter FROM manufacturers ORDER BY revenue DESC", "question": "Find all manufacturers' names and their headquarters, sorted by the ones with highest revenue first.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name , headquarter FROM manufacturers ORDER BY revenue DESC", "question": "What are the names and headquarters of all manufacturers, ordered by revenue descending?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT avg(revenue) , max(revenue) , sum(revenue) FROM manufacturers", "question": "What are the average, maximum and total revenues of all companies?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT avg(revenue) , max(revenue) , sum(revenue) FROM manufacturers", "question": "Return the average, maximum, and total revenues across all manufacturers.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT count(*) FROM manufacturers WHERE founder = 'Andy'", "question": "How many companies were created by Andy?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT count(*) FROM manufacturers WHERE founder = 'Andy'", "question": "Return the number of companies created by Andy.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT sum(revenue) FROM manufacturers WHERE headquarter = 'Austin'", "question": "Find the total revenue created by the companies whose headquarter is located at Austin.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT sum(revenue) FROM manufacturers WHERE headquarter = 'Austin'", "question": "What is the sum of revenue from companies with headquarters in Austin?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT DISTINCT headquarter FROM manufacturers", "question": "What are the different cities listed?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT DISTINCT headquarter FROM manufacturers", "question": "Give the distinct headquarters of manufacturers.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT count(*) FROM manufacturers WHERE headquarter = 'Tokyo' OR headquarter = 'Beijing'", "question": "Find the number of manufactures that are based in Tokyo or Beijing.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT count(*) FROM manufacturers WHERE headquarter = 'Tokyo' OR headquarter = 'Beijing'", "question": "How many manufacturers have headquarters in either Tokyo or Beijing?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT founder FROM manufacturers WHERE name LIKE 'S%'", "question": "Find the founder of the company whose name begins with the letter 'S'.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT founder FROM manufacturers WHERE name LIKE 'S%'", "question": "Who is the founders of companies whose first letter is S?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150", "question": "Find the name of companies whose revenue is between 100 and 150.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150", "question": "What are the names of companies with revenue between 100 and 150?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT sum(revenue) FROM manufacturers WHERE Headquarter = 'Tokyo' OR Headquarter = 'Taiwan'", "question": "What is the total revenue of all companies whose main office is at Tokyo or Taiwan?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT sum(revenue) FROM manufacturers WHERE Headquarter = 'Tokyo' OR Headquarter = 'Taiwan'", "question": "Return the total revenue of companies with headquarters in Tokyo or Taiwan.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony'", "question": "Find the name of product that is produced by both companies Creative Labs and Sony.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony'", "question": "What are the names of products produced by both Creative Labs and Sony?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name , headquarter , founder FROM manufacturers ORDER BY revenue DESC LIMIT 1", "question": "Find the name, headquarter and founder of the manufacturer that has the highest revenue.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name , headquarter , founder FROM manufacturers ORDER BY revenue DESC LIMIT 1", "question": "What are the names, headquarters and founders of the company with the highest revenue?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name , headquarter , revenue FROM manufacturers ORDER BY revenue DESC", "question": "Find the name, headquarter and revenue of all manufacturers sorted by their revenue in the descending order.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name , headquarter , revenue FROM manufacturers ORDER BY revenue DESC", "question": "What are the names, headquarters and revenues for manufacturers, sorted by revenue descending?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name FROM manufacturers WHERE revenue > (SELECT avg(revenue) FROM manufacturers)", "question": "Find the name of companies whose revenue is greater than the average revenue of all companies.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name FROM manufacturers WHERE revenue > (SELECT avg(revenue) FROM manufacturers)", "question": "What are the names of manufacturers with revenue greater than the average of all revenues?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name FROM manufacturers WHERE revenue < (SELECT min(revenue) FROM manufacturers WHERE headquarter = 'Austin')", "question": "Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name FROM manufacturers WHERE revenue < (SELECT min(revenue) FROM manufacturers WHERE headquarter = 'Austin')", "question": "What are the names of companies with revenue less than the lowest revenue of any manufacturer in Austin?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT sum(revenue) FROM manufacturers WHERE revenue > (SELECT min(revenue) FROM manufacturers WHERE headquarter = 'Austin')", "question": "Find the total revenue of companies whose revenue is larger than the revenue of some companies based in Austin.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT sum(revenue) FROM manufacturers WHERE revenue > (SELECT min(revenue) FROM manufacturers WHERE headquarter = 'Austin')", "question": "What is the total revenue of companies with revenue greater than the lowest revenue of any manufacturer in Austin?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT sum(revenue) , founder FROM manufacturers GROUP BY founder", "question": "Find the total revenue of companies of each founder.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT sum(revenue) , founder FROM manufacturers GROUP BY founder", "question": "What is the total revenue of companies started by founder?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name , max(revenue) , Headquarter FROM manufacturers GROUP BY Headquarter", "question": "Find the name and revenue of the company that earns the highest revenue in each city.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name , max(revenue) , Headquarter FROM manufacturers GROUP BY Headquarter", "question": "What are the names and revenues of the companies with the highest revenues in each headquarter city?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT sum(revenue) , name FROM manufacturers GROUP BY name", "question": "Find the total revenue for each manufacturer.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT sum(revenue) , name FROM manufacturers GROUP BY name", "question": "What is the total revenue of each manufacturer?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT avg(T1.price) , T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name", "question": "Find the average prices of all products from each manufacture, and list each company's name.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT avg(T1.price) , T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name", "question": "What are the average prices of products for each manufacturer?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT count(DISTINCT T1.name) , T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.Headquarter", "question": "Find the number of different products that are produced by companies at different headquarter cities.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT count(DISTINCT T1.name) , T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.Headquarter", "question": "How many different products are produced in each headquarter city?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony')", "question": "Find number of products which Sony does not make.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony')", "question": "How many products are not made by Sony?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T1.name = 'DVD drive'", "question": "Find the name of companies that do not make DVD drive.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T1.name = 'DVD drive'", "question": "What are the names of companies that do not make DVD drives?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT count(*) , T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name", "question": "Find the number of products for each manufacturer, showing the name of each company.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT count(*) , T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name", "question": "How many products are there for each manufacturer?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT Name FROM Products", "question": "Select the names of all the products in the store.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT Name FROM Products", "question": "What are the names of all products?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name , price FROM products", "question": "Select the names and the prices of all the products in the store.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name , price FROM products", "question": "What are the names and prices of all products in the store?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name FROM products WHERE price <= 200", "question": "Select the name of the products with a price less than or equal to $200.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name FROM products WHERE price <= 200", "question": "What are the names of products with price at most 200?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT * FROM products WHERE price BETWEEN 60 AND 120", "question": "Find all information of all the products with a price between $60 and $120.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT * FROM products WHERE price BETWEEN 60 AND 120", "question": "What is all the information of all the products that have a price between 60 and 120?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT avg(price) FROM products", "question": "Compute the average price of all the products.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT avg(price) FROM products", "question": "What is the average price across all products?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT avg(price) FROM products WHERE Manufacturer = 2", "question": "Compute the average price of all products with manufacturer code equal to 2.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT avg(price) FROM products WHERE Manufacturer = 2", "question": "What is the average price of products with manufacturer codes equal to 2?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT count(*) FROM products WHERE price >= 180", "question": "Compute the number of products with a price larger than or equal to $180.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT count(*) FROM products WHERE price >= 180", "question": "How many products have prices of at least 180?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name , price FROM products WHERE price >= 180 ORDER BY price DESC , name ASC", "question": "Select the name and price of all products with a price larger than or equal to $180, and sort first by price (in descending order), and then by name (in ascending order).", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name , price FROM products WHERE price >= 180 ORDER BY price DESC , name ASC", "question": "What are the names and prices of products that cost at least 180, sorted by price decreasing and name ascending?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT * FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code", "question": "Select all the data from the products and each product's manufacturer.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT * FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code", "question": "What is all the product data, as well as each product's manufacturer?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT AVG(Price) , Manufacturer FROM Products GROUP BY Manufacturer", "question": "Select the average price of each manufacturer's products, showing only the manufacturer's code.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT AVG(Price) , Manufacturer FROM Products GROUP BY Manufacturer", "question": "What are the average prices of products, grouped by manufacturer code?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT avg(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name", "question": "Select the average price of each manufacturer's products, showing the manufacturer's name.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT avg(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name", "question": "What are the average prices of products, grouped by manufacturer name?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT avg(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name HAVING avg(T1.price) >= 150", "question": "Select the names of manufacturer whose products have an average price higher than or equal to $150.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT avg(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name HAVING avg(T1.price) >= 150", "question": "What are the names and average prices of products for manufacturers whose products cost on average 150 or more?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name , price FROM Products ORDER BY price ASC LIMIT 1", "question": "Select the name and price of the cheapest product.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT name , price FROM Products ORDER BY price ASC LIMIT 1", "question": "What is the name and price of the cheapest product?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT T1.Name , max(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name", "question": "Select the name of each manufacturer along with the name and price of its most expensive product.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT T1.Name , max(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name", "question": "For each manufacturer name, what are the names and prices of their most expensive product?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT code , name , min(price) FROM products GROUP BY name", "question": "Select the code of the product that is cheapest in each product category.", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT code , name , min(price) FROM products GROUP BY name", "question": "What are the codes and names of the cheapest products in each category?", "schema": "Manufacturers: Code (INTEGER), Name (VARCHAR(255)), Headquarter (VARCHAR(255)), Founder (VARCHAR(255)), Revenue (REAL)\nProducts: Code (INTEGER), Name (VARCHAR(255)), Price (DECIMAL), Manufacturer (INTEGER)" }, { "query": "SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1", "question": "What is the id of the problem log that is created most recently?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1", "question": "Which problem log was created most recently? Give me the log id.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT problem_log_id , problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1", "question": "What is the oldest log id and its corresponding problem id?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT problem_log_id , problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1", "question": "Find the oldest log id and its corresponding problem id.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT problem_log_id , log_entry_date FROM problem_log WHERE problem_id = 10", "question": "Find all the ids and dates of the logs for the problem whose id is 10.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT problem_log_id , log_entry_date FROM problem_log WHERE problem_id = 10", "question": "For the problem with id 10, return the ids and dates of its problem logs.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT problem_log_id , log_entry_description FROM problem_log", "question": "List all the log ids and their descriptions from the problem logs.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT problem_log_id , log_entry_description FROM problem_log", "question": "What are the log id and entry description of each problem?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT DISTINCT staff_first_name , staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1", "question": "List the first and last names of all distinct staff members who are assigned to the problem whose id is 1.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT DISTINCT staff_first_name , staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1", "question": "Which staff members are assigned to the problem with id 1? Give me their first and last names.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT DISTINCT T2.problem_id , T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = \"Rylan\" AND T1.staff_last_name = \"Homenick\"", "question": "List the problem id and log id which are assigned to the staff named Rylan Homenick.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT DISTINCT T2.problem_id , T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = \"Rylan\" AND T1.staff_last_name = \"Homenick\"", "question": "Which problem id and log id are assigned to the staff named Rylan Homenick?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = \"voluptatem\"", "question": "How many problems are there for product voluptatem?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = \"voluptatem\"", "question": "How many problems did the product called \"voluptatem\" have in record?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT count(*) , T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY count(*) DESC LIMIT 1", "question": "How many problems does the product with the most problems have? List the number of the problems and product name.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT count(*) , T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY count(*) DESC LIMIT 1", "question": "Which product has the most problems? Give me the number of problems and the product name.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Christop\"", "question": "Give me a list of descriptions of the problems that are reported by the staff whose first name is Christop.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Christop\"", "question": "Which problems are reported by the staff with first name \"Christop\"? Show the descriptions of the problems.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = \"Bosco\"", "question": "Find the ids of the problems that are reported by the staff whose last name is Bosco.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = \"Bosco\"", "question": "Which problems are reported by the staff with last name \"Bosco\"? Show the ids of the problems.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT problem_id FROM problems WHERE date_problem_reported > \"1978-06-26\"", "question": "What are the ids of the problems which are reported after 1978-06-26?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT problem_id FROM problems WHERE date_problem_reported > \"1978-06-26\"", "question": "Find the ids of the problems reported after 1978-06-26.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT problem_id FROM problems WHERE date_problem_reported < \"1978-06-26\"", "question": "What are the ids of the problems which are reported before 1978-06-26?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT problem_id FROM problems WHERE date_problem_reported < \"1978-06-26\"", "question": "Which problems are reported before 1978-06-26? Give me the ids of the problems.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT count(*) , T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id", "question": "For each product which has problems, what are the number of problems and the product id?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT count(*) , T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id", "question": "For each product with some problems, list the count of problems and the product id.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT count(*) , T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > \"1986-11-13\" GROUP BY T2.product_id", "question": "For each product that has problems, find the number of problems reported after 1986-11-13 and the product id?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT count(*) , T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > \"1986-11-13\" GROUP BY T2.product_id", "question": "What are the products that have problems reported after 1986-11-13? Give me the product id and the count of problems reported after 1986-11-13.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT DISTINCT product_name FROM product ORDER BY product_name", "question": "List the names of all the distinct product names in alphabetical order?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT DISTINCT product_name FROM product ORDER BY product_name", "question": "Sort all the distinct product names in alphabetical order.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT DISTINCT product_name FROM product ORDER BY product_id", "question": "List all the distinct product names ordered by product id?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT DISTINCT product_name FROM product ORDER BY product_id", "question": "What is the list of distinct product names sorted by product id?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Dameon\" AND T2.staff_last_name = \"Frami\" UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Jolie\" AND T2.staff_last_name = \"Weber\"", "question": "What are the id of problems reported by the staff named Dameon Frami or Jolie Weber?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Dameon\" AND T2.staff_last_name = \"Frami\" UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Jolie\" AND T2.staff_last_name = \"Weber\"", "question": "Which problems were reported by the staff named Dameon Frami or Jolie Weber? Give me the ids of the problems.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Christop\" AND T2.staff_last_name = \"Berge\" INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Ashley\" AND T2.staff_last_name = \"Medhurst\"", "question": "What are the product ids for the problems reported by Christop Berge with closure authorised by Ashley Medhurst?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Christop\" AND T2.staff_last_name = \"Berge\" INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Ashley\" AND T2.staff_last_name = \"Medhurst\"", "question": "For which product was there a problem reported by Christop Berge, with closure authorised by Ashley Medhurst? Return the product ids.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported < ( SELECT min(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = \"Lysanne\" AND T4.staff_last_name = \"Turcotte\" )", "question": "What are the ids of the problems reported before the date of any problem reported by Lysanne Turcotte?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported < ( SELECT min(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = \"Lysanne\" AND T4.staff_last_name = \"Turcotte\" )", "question": "Which problems were reported before the date of any problem reported by the staff Lysanne Turcotte? Give me the ids of the problems.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported > ( SELECT max(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = \"Rylan\" AND T4.staff_last_name = \"Homenick\" )", "question": "What are the ids of the problems reported after the date of any problems reported by Rylan Homenick?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported > ( SELECT max(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = \"Rylan\" AND T4.staff_last_name = \"Homenick\" )", "question": "Find the ids of the problems reported after the date of any problems reported by the staff Rylan Homenick.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY count(*) DESC LIMIT 3", "question": "Find the top 3 products which have the largest number of problems?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY count(*) DESC LIMIT 3", "question": "What are the three products that have the most problems?s", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = \"voluptatem\" AND T1.date_problem_reported > \"1995\"", "question": "List the ids of the problems from the product \"voluptatem\" that are reported after 1995?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = \"voluptatem\" AND T1.date_problem_reported > \"1995\"", "question": "What are the ids of the problems that are from the product \"voluptatem\" and are reported after 1995?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = \"rem\" EXCEPT SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = \"aut\"", "question": "Find the first and last name of the staff members who reported problems from the product \"rem\" but not \"aut\"?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = \"rem\" EXCEPT SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = \"aut\"", "question": "Which staff members who reported problems from the product \"rem\" but not \"aut\"? Give me their first and last names.", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = \"Lacey\" AND T3.staff_last_name = \"Bosco\" INTERSECT SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = \"Kenton\" AND T3.staff_last_name = \"Champlin\"", "question": "Find the products which have problems reported by both Lacey Bosco and Kenton Champlin?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = \"Lacey\" AND T3.staff_last_name = \"Bosco\" INTERSECT SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = \"Kenton\" AND T3.staff_last_name = \"Champlin\"", "question": "Which products have problems reported by both the staff named Lacey Bosco and the staff named Kenton Champlin?", "schema": "Problem_Category_Codes: problem_category_code (VARCHAR(20)), problem_category_description (VARCHAR(80))\nProblem_Log: problem_log_id (INTEGER), assigned_to_staff_id (INTEGER), problem_id (INTEGER), problem_category_code (VARCHAR(20)), problem_status_code (VARCHAR(20)), log_entry_date (DATETIME), log_entry_description (VARCHAR(255)), log_entry_fix (VARCHAR(255)), other_log_details (VARCHAR(255))\nProblem_Status_Codes: problem_status_code (VARCHAR(20)), problem_status_description (VARCHAR(80))\nProduct: product_id (INTEGER), product_name (VARCHAR(80)), product_details (VARCHAR(255))\nStaff: staff_id (INTEGER), staff_first_name (VARCHAR(80)), staff_last_name (VARCHAR(80)), other_staff_details (VARCHAR(255))\nProblems: problem_id (INTEGER), product_id (INTEGER), closure_authorised_by_staff_id (INTEGER), reported_by_staff_id (INTEGER), date_problem_reported (DATETIME), date_problem_closed (DATETIME), problem_description (VARCHAR(255)), other_problem_details (VARCHAR(255))" }, { "query": "SELECT count(*) FROM branch WHERE membership_amount > (SELECT avg(membership_amount) FROM branch)", "question": "How many branches where have more than average number of memberships are there?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT count(*) FROM branch WHERE membership_amount > (SELECT avg(membership_amount) FROM branch)", "question": "What is the number of branches that have more than the average number of memberships?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT name , address_road , city FROM branch ORDER BY open_year", "question": "Show name, address road, and city for all branches sorted by open year.", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT name , address_road , city FROM branch ORDER BY open_year", "question": "What are the names, address roads, and cities of the branches ordered by opening year?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3", "question": "What are names for top three branches with most number of membership?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3", "question": "What are the names for the 3 branches that have the most memberships?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT DISTINCT city FROM branch WHERE membership_amount >= 100", "question": "Show all distinct city where branches with at least 100 memberships are located.", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT DISTINCT city FROM branch WHERE membership_amount >= 100", "question": "What are the different cities that have more than 100 memberships?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT open_year FROM branch GROUP BY open_year HAVING count(*) >= 2", "question": "List all open years when at least two shops are opened.", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT open_year FROM branch GROUP BY open_year HAVING count(*) >= 2", "question": "What are the opening years in which at least two shops opened?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT min(membership_amount) , max(membership_amount) FROM branch WHERE open_year = 2011 OR city = 'London'", "question": "Show minimum and maximum amount of memberships for all branches opened in 2011 or located at city London.", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT min(membership_amount) , max(membership_amount) FROM branch WHERE open_year = 2011 OR city = 'London'", "question": "What are the minimum and maximum membership amounts for all branches that either opened in 2011 or are located in London?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT city , count(*) FROM branch WHERE open_year < 2010 GROUP BY city", "question": "Show the city and the number of branches opened before 2010 for each city.", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT city , count(*) FROM branch WHERE open_year < 2010 GROUP BY city", "question": "For each city, how many branches opened before 2010?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT count(DISTINCT LEVEL) FROM member", "question": "How many different levels do members have?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT count(DISTINCT LEVEL) FROM member", "question": "What are the different membership levels?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT card_number , name , hometown FROM member ORDER BY LEVEL DESC", "question": "Show card number, name, and hometown for all members in a descending order of level.", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT card_number , name , hometown FROM member ORDER BY LEVEL DESC", "question": "What are the card numbers, names, and hometowns of every member ordered by descending level?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT LEVEL FROM member GROUP BY LEVEL ORDER BY count(*) DESC LIMIT 1", "question": "Show the membership level with most number of members.", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT LEVEL FROM member GROUP BY LEVEL ORDER BY count(*) DESC LIMIT 1", "question": "What is the membership level with the most people?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT T3.name , T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id ORDER BY T1.register_year", "question": "Show all member names and registered branch names sorted by register year.", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT T3.name , T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id ORDER BY T1.register_year", "question": "What are the names of the members and branches at which they are registered sorted by year of registration?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT T2.name , count(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year > 2015 GROUP BY T2.branch_id", "question": "Show all branch names with the number of members in each branch registered after 2015.", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT T2.name , count(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year > 2015 GROUP BY T2.branch_id", "question": "For each branch id, what are the names of the branches that were registered after 2015?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT name FROM member WHERE member_id NOT IN (SELECT member_id FROM membership_register_branch)", "question": "Show member names without any registered branch.", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT name FROM member WHERE member_id NOT IN (SELECT member_id FROM membership_register_branch)", "question": "What are the names of the members that have never registered at any branch?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT name , city FROM branch WHERE branch_id NOT IN (SELECT branch_id FROM membership_register_branch)", "question": "List the branch name and city without any registered members.", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT name , city FROM branch WHERE branch_id NOT IN (SELECT branch_id FROM membership_register_branch)", "question": "What are the names and cities of the branches that do not have any registered members?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT T2.name , T2.open_year FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year = 2016 GROUP BY T2.branch_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the name and open year for the branch with most number of memberships registered in 2016?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT T2.name , T2.open_year FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year = 2016 GROUP BY T2.branch_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the name and opening year for the branch that registered the most members in 2016?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT T2.name , T2.hometown FROM membership_register_branch AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T1.register_year = 2016", "question": "Show the member name and hometown who registered a branch in 2016.", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT T2.name , T2.hometown FROM membership_register_branch AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T1.register_year = 2016", "question": "What are the member names and hometowns of those who registered at a branch in 2016?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100", "question": "Show all city with a branch opened in 2001 and a branch with more than 100 membership.", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100", "question": "What are the cities that have a branch that opened in 2001 and a branch with more than 100 members?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount > 100", "question": "Show all cities without a branch having more than 100 memberships.", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount > 100", "question": "What are the cities that do not have any branches with more than 100 members?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT sum(total_pounds) FROM purchase AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T2.city = 'London' AND T1.year = 2018", "question": "What is the sum of total pounds of purchase in year 2018 for all branches in London?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT sum(total_pounds) FROM purchase AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T2.city = 'London' AND T1.year = 2018", "question": "How many total pounds were purchased in the year 2018 at all London branches?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT count(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6", "question": "What is the total number of purchases for members with level 6?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT count(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6", "question": "What are the total purchases for members rated at level 6?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Louisville , Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Hiram , Georgia'", "question": "Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia.", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Louisville , Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Hiram , Georgia'", "question": "What are the names of the branches that have some members with a hometown in Louisville, Kentucky and also those from Hiram, Goergia?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT card_number FROM member WHERE Hometown LIKE \"%Kentucky%\"", "question": "list the card number of all members whose hometown address includes word \"Kentucky\".", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT card_number FROM member WHERE Hometown LIKE \"%Kentucky%\"", "question": "What are the card numbers of members from Kentucky?", "schema": "member: Member_ID (INT), Card_Number (TEXT), Name (TEXT), Hometown (TEXT), Level (INT)\nbranch: Branch_ID (INT), Name (TEXT), Open_year (TEXT), Address_road (TEXT), City (TEXT), membership_amount (TEXT)\nmembership_register_branch: Member_ID (INT), Branch_ID (TEXT), Register_Year (TEXT)\npurchase: Member_ID (INT), Branch_ID (TEXT), Year (TEXT), Total_pounds (REAL)" }, { "query": "SELECT count(*) FROM STUDENT", "question": "Find the number of students in total.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT count(*) FROM STUDENT", "question": "How many students are there in total?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT count(*) FROM VOTING_RECORD", "question": "Find the number of voting records in total.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT count(*) FROM VOTING_RECORD", "question": "How many voting records do we have?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT count(DISTINCT President_Vote) FROM VOTING_RECORD", "question": "Find the distinct number of president votes.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT count(DISTINCT President_Vote) FROM VOTING_RECORD", "question": "How many distinct president votes are recorded?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT max(Age) FROM STUDENT", "question": "Find the maximum age of all the students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT max(Age) FROM STUDENT", "question": "What is the oldest age among the students?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT LName FROM STUDENT WHERE Major = 50", "question": "Find the last names of students with major 50.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT LName FROM STUDENT WHERE Major = 50", "question": "What are the last names of students studying major 50?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Fname FROM STUDENT WHERE Age > 22", "question": "Find the first names of students with age above 22.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Fname FROM STUDENT WHERE Age > 22", "question": "What are the first names of all the students aged above 22?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Major FROM STUDENT WHERE Sex = \"M\"", "question": "What are the majors of male (sex is M) students?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Major FROM STUDENT WHERE Sex = \"M\"", "question": "List the major of each male student.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT avg(Age) FROM STUDENT WHERE Sex = \"F\"", "question": "What is the average age of female (sex is F) students?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT avg(Age) FROM STUDENT WHERE Sex = \"F\"", "question": "Find the average age of female students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT max(Age) , min(Age) FROM STUDENT WHERE Major = 600", "question": "What are the maximum and minimum age of students with major 600?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT max(Age) , min(Age) FROM STUDENT WHERE Major = 600", "question": "Tell me the ages of the oldest and youngest students studying major 600.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Advisor FROM STUDENT WHERE city_code = \"BAL\"", "question": "Who are the advisors for students that live in a city with city code \"BAL\"?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Advisor FROM STUDENT WHERE city_code = \"BAL\"", "question": "Show the advisors of the students whose city of residence has city code \"BAL\".", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = \"Fall\"", "question": "What are the distinct secretary votes in the fall election cycle?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = \"Fall\"", "question": "Return all the distinct secretary votes made in the fall election cycle.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date = \"08/30/2015\"", "question": "What are the distinct president votes on 08/30/2015?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date = \"08/30/2015\"", "question": "Show all the distinct president votes made on 08/30/2015.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT Registration_Date , Election_Cycle FROM VOTING_RECORD", "question": "Report the distinct registration date and the election cycle.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT Registration_Date , Election_Cycle FROM VOTING_RECORD", "question": "What are the distinct registration dates and the election cycles?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT President_Vote , VICE_President_Vote FROM VOTING_RECORD", "question": "Report the distinct president vote and the vice president vote.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT President_Vote , VICE_President_Vote FROM VOTING_RECORD", "question": "List all the distinct president votes and the vice president votes.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_President_VOTE", "question": "Find the distinct last names of the students who have class president votes.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_President_VOTE", "question": "What are the distinct last names of the students who have class president votes?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_Senator_VOTE", "question": "Find the distinct first names of the students who have class senator votes.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_Senator_VOTE", "question": "What are the distinct first names of the students who have class president votes?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Secretary_Vote WHERE T2.Election_Cycle = \"Fall\"", "question": "Find the distinct ages of students who have secretary votes in the fall election cycle.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Secretary_Vote WHERE T2.Election_Cycle = \"Fall\"", "question": "What are the distinct ages of students who have secretary votes in the fall election cycle?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.Advisor FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote WHERE T2.Election_Cycle = \"Spring\"", "question": "Find the distinct Advisor of students who have treasurer votes in the spring election cycle.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.Advisor FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote WHERE T2.Election_Cycle = \"Spring\"", "question": "Who served as an advisor for students who have treasurer votes in the spring election cycle?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote", "question": "Find the distinct majors of students who have treasurer votes.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote", "question": "What are the distinct majors that students with treasurer votes are studying?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.Fname , T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.President_VOTE WHERE T1.sex = \"F\"", "question": "Find the first and last names of all the female (sex is F) students who have president votes.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.Fname , T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.President_VOTE WHERE T1.sex = \"F\"", "question": "What are the first and last names of all the female students who have president votes?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.Fname , T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_President_VOTE WHERE T1.age = 18", "question": "Find the first and last name of all the students of age 18 who have vice president votes.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.Fname , T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_President_VOTE WHERE T1.age = 18", "question": "What are the first names and last names of the students who are 18 years old and have vice president votes.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT count(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.Sex = \"M\" AND T2.Election_Cycle = \"Fall\"", "question": "How many male (sex is M) students have class senator votes in the fall election cycle?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT count(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.Sex = \"M\" AND T2.Election_Cycle = \"Fall\"", "question": "Count the number of male students who had class senator votes in the fall election cycle.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT count(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.city_code = \"NYC\" AND T2.Election_Cycle = \"Spring\"", "question": "Find the number of students whose city code is NYC and who have class senator votes in the spring election cycle.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT count(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.city_code = \"NYC\" AND T2.Election_Cycle = \"Spring\"", "question": "Which students live in the city with code \"NYC\" and have class senator votes in the spring election cycle? Count the numbers.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT avg(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.city_code = \"NYC\" AND T2.Election_Cycle = \"Spring\"", "question": "Find the average age of students who live in the city with code \"NYC\" and have secretary votes in the spring election cycle.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT avg(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.city_code = \"NYC\" AND T2.Election_Cycle = \"Spring\"", "question": "What is the average age of students who have city code \"NYC\" and have secretary votes for the spring election cycle?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT avg(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.Sex = \"F\" AND T2.Election_Cycle = \"Spring\"", "question": "Find the average age of female (sex is F) students who have secretary votes in the spring election cycle.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT avg(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.Sex = \"F\" AND T2.Election_Cycle = \"Spring\"", "question": "What is the average age of the female students with secretary votes in the spring election cycle?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_PRESIDENT_Vote EXCEPT SELECT DISTINCT Fname FROM STUDENT WHERE city_code = \"PIT\"", "question": "Find the distinct first names of all the students who have vice president votes and whose city code is not PIT.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_PRESIDENT_Vote EXCEPT SELECT DISTINCT Fname FROM STUDENT WHERE city_code = \"PIT\"", "question": "What are the distinct first names of the students who have vice president votes and reside in a city whose city code is not PIT?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote EXCEPT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = \"2192\"", "question": "Find the distinct last names of all the students who have president votes and whose advisor is not 2192.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote EXCEPT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = \"2192\"", "question": "What are the distinct last names of the students who have president votes but do not have 2192 as the advisor?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote INTERSECT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = \"8741\"", "question": "Find the distinct last names of all the students who have president votes and whose advisor is 8741.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote INTERSECT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = \"8741\"", "question": "What are the distinct last names of the students who have president votes and have 8741 as the advisor?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Advisor , count(*) FROM STUDENT GROUP BY Advisor", "question": "For each advisor, report the total number of students advised by him or her.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Advisor , count(*) FROM STUDENT GROUP BY Advisor", "question": "How many students does each advisor have?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2", "question": "Report all advisors that advise more than 2 students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2", "question": "Which advisors have more than two students?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3", "question": "Report all majors that have less than 3 students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3", "question": "What are the majors only less than three students are studying?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Election_Cycle , count(*) FROM VOTING_RECORD GROUP BY Election_Cycle", "question": "For each election cycle, report the number of voting records.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Election_Cycle , count(*) FROM VOTING_RECORD GROUP BY Election_Cycle", "question": "Count the number of voting records for each election cycle.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Major FROM STUDENT GROUP BY major ORDER BY count(*) DESC LIMIT 1", "question": "Which major has the most students?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Major FROM STUDENT GROUP BY major ORDER BY count(*) DESC LIMIT 1", "question": "Find the major that is studied by the largest number of students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Major FROM STUDENT WHERE Sex = \"F\" GROUP BY major ORDER BY count(*) DESC LIMIT 1", "question": "What is the most common major among female (sex is F) students?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Major FROM STUDENT WHERE Sex = \"F\" GROUP BY major ORDER BY count(*) DESC LIMIT 1", "question": "Find the major that is studied by the most female students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY count(*) DESC LIMIT 1", "question": "What is the city_code of the city that the most students live in?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY count(*) DESC LIMIT 1", "question": "Return the code of the city that has the most students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING count(*) > 2", "question": "Report the distinct advisors who have more than 2 students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING count(*) > 2", "question": "Which advisors are advising more than 2 students?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVoting_record: StuID (INTEGER), Registration_Date (VARCHAR(12)), Election_Cycle (VARCHAR(12)), President_Vote (INTEGER), Vice_President_Vote (INTEGER), Secretary_Vote (INTEGER), Treasurer_Vote (INTEGER), Class_President_Vote (INTEGER), Class_Senator_Vote (INTEGER)" }, { "query": "SELECT count(*) FROM products", "question": "How many products are there?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products", "question": "Count the number of products.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM ref_colors", "question": "How many colors are there?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM ref_colors", "question": "Count the number of colors.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM CHARACTERISTICS", "question": "How many characteristics are there?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM CHARACTERISTICS", "question": "Count the number of characteristics.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT product_name , typical_buying_price FROM products", "question": "What are the names and buying prices of all the products?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT product_name , typical_buying_price FROM products", "question": "Return the names and typical buying prices for all products.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT color_description FROM ref_colors", "question": "List the description of all the colors.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT color_description FROM ref_colors", "question": "What are the descriptions for each color?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT DISTINCT characteristic_name FROM CHARACTERISTICS", "question": "Find the names of all the product characteristics.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT DISTINCT characteristic_name FROM CHARACTERISTICS", "question": "What are the different names of the product characteristics?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT product_name FROM products WHERE product_category_code = \"Spices\"", "question": "What are the names of products with category \"Spices\"?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT product_name FROM products WHERE product_category_code = \"Spices\"", "question": "Return the names of products in the category 'Spices'.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT T1.product_name , T2.color_description , T1.product_description FROM products AS T1 JOIN Ref_colors AS T2 ON T1.color_code = T2.color_code WHERE product_category_code = \"Herbs\"", "question": "List the names, color descriptions and product descriptions of products with category \"Herbs\".", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT T1.product_name , T2.color_description , T1.product_description FROM products AS T1 JOIN Ref_colors AS T2 ON T1.color_code = T2.color_code WHERE product_category_code = \"Herbs\"", "question": "What are the names, color descriptions, and product descriptions for products in the 'Herbs' category?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products WHERE product_category_code = \"Seeds\"", "question": "How many products are there under the category \"Seeds\"?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products WHERE product_category_code = \"Seeds\"", "question": "Count the number of products in the category 'Seeds'.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products WHERE product_category_code = \"Spices\" AND typical_buying_price > 1000", "question": "Find the number of products with category \"Spices\" and typically sold above 1000.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products WHERE product_category_code = \"Spices\" AND typical_buying_price > 1000", "question": "How many products are in the 'Spices' category and have a typical price of over 1000?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT product_category_code , typical_buying_price FROM products WHERE product_name = \"cumin\"", "question": "What is the category and typical buying price of the product with name \"cumin\"?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT product_category_code , typical_buying_price FROM products WHERE product_name = \"cumin\"", "question": "Return the category code and typical price of 'cumin'.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT product_category_code FROM products WHERE product_name = \"flax\"", "question": "Which category does the product named \"flax\" belong to?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT product_category_code FROM products WHERE product_name = \"flax\"", "question": "What is the code of the category that the product with the name 'flax' belongs to?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT T1.product_name FROM products AS T1 JOIN ref_colors AS T2 ON T1.color_code = T2.color_code WHERE T2.color_description = 'yellow'", "question": "What is the name of the product with the color description 'yellow'?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT T1.product_name FROM products AS T1 JOIN ref_colors AS T2 ON T1.color_code = T2.color_code WHERE T2.color_description = 'yellow'", "question": "Give the name of the products that have a color description 'yellow'.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%'", "question": "Find the category descriptions of the products whose descriptions include letter 't'.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%'", "question": "What are the descriptions of the categories that products with product descriptions that contain the letter t are in?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = \"catnip\"", "question": "What is the color description of the product with name \"catnip\"?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = \"catnip\"", "question": "Give the color description for the product 'catnip'.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t1.color_code , t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = \"chervil\"", "question": "What is the color code and description of the product named \"chervil\"?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t1.color_code , t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = \"chervil\"", "question": "Return the color code and description for the product with the name 'chervil'.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t1.product_id , t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code JOIN product_characteristics AS t3 ON t1.product_id = t3.product_id GROUP BY t1.product_id HAVING count(*) >= 2", "question": "Find the id and color description of the products with at least 2 characteristics.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t1.product_id , t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code JOIN product_characteristics AS t3 ON t1.product_id = t3.product_id GROUP BY t1.product_id HAVING count(*) >= 2", "question": "What are the product ids and color descriptions for products with two or more characteristics?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = \"white\"", "question": "List all the product names with the color description \"white\".", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = \"white\"", "question": "What are the names of products with 'white' as their color description?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t1.product_name , t1.typical_buying_price , t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = \"yellow\"", "question": "What are the name and typical buying and selling prices of the products that have color described as \"yellow\"?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t1.product_name , t1.typical_buying_price , t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = \"yellow\"", "question": "Return the names and typical buying and selling prices for products that have 'yellow' as their color description.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = \"sesame\"", "question": "How many characteristics does the product named \"sesame\" have?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = \"sesame\"", "question": "Count the number of characteristics the product 'sesame' has.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = \"sesame\"", "question": "How many distinct characteristic names does the product \"cumin\" have?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = \"sesame\"", "question": "Count the number of different characteristic names the product 'cumin' has.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = \"sesame\"", "question": "What are all the characteristic names of product \"sesame\"?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = \"sesame\"", "question": "Return the characteristic names of the 'sesame' product.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t3.characteristic_name , t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = \"cumin\"", "question": "List all the characteristic names and data types of product \"cumin\".", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t3.characteristic_name , t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = \"cumin\"", "question": "What are the names and data types of the characteristics of the 'cumin' product?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = \"sesame\" AND t3.characteristic_type_code = \"Grade\"", "question": "List all characteristics of product named \"sesame\" with type code \"Grade\".", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = \"sesame\" AND t3.characteristic_type_code = \"Grade\"", "question": "What are the names of the characteristics of the product 'sesame' that have the characteristic type code 'Grade'?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = \"laurel\"", "question": "How many characteristics does the product named \"laurel\" have?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = \"laurel\"", "question": "Count the number of characteristics of the product named 'laurel'.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = \"flax\"", "question": "Find the number of characteristics that the product \"flax\" has.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = \"flax\"", "question": "Count the number of characteristics of the 'flax' product.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = \"red\" AND t3.characteristic_name = \"fast\"", "question": "Find the name of the products that have the color description \"red\" and have the characteristic name \"fast\".", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = \"red\" AND t3.characteristic_name = \"fast\"", "question": "What are the names of the products that have a color description of 'red' and the 'fast' characteristic?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = \"hot\"", "question": "How many products have the characteristic named \"hot\"?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = \"hot\"", "question": "Count the number of products with the 'hot' charactersitic.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = \"warm\"", "question": "List the all the distinct names of the products with the characteristic name 'warm'.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = \"warm\"", "question": "What are the different product names for products that have the 'warm' characteristic:?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = \"red\" AND t3.characteristic_name = \"slow\"", "question": "Find the number of the products that have their color described as \"red\" and have a characteristic named \"slow\".", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = \"red\" AND t3.characteristic_name = \"slow\"", "question": "How many products have the color description 'red' and the characteristic name 'slow'?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = \"white\" OR t3.characteristic_name = \"hot\"", "question": "Count the products that have the color description \"white\" or have the characteristic name \"hot\".", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = \"white\" OR t3.characteristic_name = \"hot\"", "question": "How many products have their color described as 'white' or have a characteristic with the name 'hot'?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = \"Herbs\"", "question": "What is the unit of measuerment of the product category code \"Herbs\"?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = \"Herbs\"", "question": "Return the unit of measure for 'Herb' products.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT product_category_description FROM ref_product_categories WHERE product_category_code = \"Spices\"", "question": "Find the product category description of the product category with code \"Spices\".", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT product_category_description FROM ref_product_categories WHERE product_category_code = \"Spices\"", "question": "What is the description of the product category with the code 'Spices'?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT product_category_description , unit_of_measure FROM ref_product_categories WHERE product_category_code = \"Herbs\"", "question": "What is the product category description and unit of measurement of category \"Herbs\"?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT product_category_description , unit_of_measure FROM ref_product_categories WHERE product_category_code = \"Herbs\"", "question": "Return the description and unit of measurement for products in the 'Herbs' category.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = \"cumin\"", "question": "What is the unit of measurement of product named \"cumin\"?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = \"cumin\"", "question": "Give the unit of measure for the product with the name 'cumin'.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t2.unit_of_measure , t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = \"chervil\"", "question": "Find the unit of measurement and product category code of product named \"chervil\".", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t2.unit_of_measure , t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = \"chervil\"", "question": "What are the unit of measure and category code for the 'chervil' product?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = \"white\" AND t2.unit_of_measure != \"Handful\"", "question": "Find the product names that are colored 'white' but do not have unit of measurement \"Handful\".", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = \"white\" AND t2.unit_of_measure != \"Handful\"", "question": "What are the names of products that are not 'white' in color and are not measured by the unit 'Handful'?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY count(*) DESC LIMIT 1", "question": "What is the description of the color for most products?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY count(*) DESC LIMIT 1", "question": "Return the color description that is most common across all products.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY count(*) ASC LIMIT 1", "question": "What is the description of the color used by least products?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY count(*) ASC LIMIT 1", "question": "Give the color description that is least common across products.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY count(*) DESC LIMIT 1", "question": "What is the characteristic name used by most number of the products?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY count(*) DESC LIMIT 1", "question": "Return the name of the characteristic that is most common across all products.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT characteristic_name , other_characteristic_details , characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name , t1.other_characteristic_details , t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id", "question": "What are the names, details and data types of the characteristics which are never used by any product?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT characteristic_name , other_characteristic_details , characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name , t1.other_characteristic_details , t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id", "question": "Give the names, details, and data types of characteristics that are not found in any product.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING count(*) >= 2", "question": "What are characteristic names used at least twice across all products?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING count(*) >= 2", "question": "Give the names of characteristics that are in two or more products?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM Ref_colors WHERE color_code NOT IN ( SELECT color_code FROM products )", "question": "How many colors are never used by any product?", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM Ref_colors WHERE color_code NOT IN ( SELECT color_code FROM products )", "question": "Count the number of colors that are not used in any products.", "schema": "Ref_Characteristic_Types: characteristic_type_code (VARCHAR(15)), characteristic_type_description (VARCHAR(80))\nRef_Colors: color_code (VARCHAR(15)), color_description (VARCHAR(80))\nRef_Product_Categories: product_category_code (VARCHAR(15)), product_category_description (VARCHAR(80)), unit_of_measure (VARCHAR(20))\nCharacteristics: characteristic_id (INTEGER), characteristic_type_code (VARCHAR(15)), characteristic_data_type (VARCHAR(10)), characteristic_name (VARCHAR(80)), other_characteristic_details (VARCHAR(255))\nProducts: product_id (INTEGER), color_code (VARCHAR(15)), product_category_code (VARCHAR(15)), product_name (VARCHAR(80)), typical_buying_price (VARCHAR(20)), typical_selling_price (VARCHAR(20)), product_description (VARCHAR(255)), other_product_details (VARCHAR(255))\nProduct_Characteristics: product_id (INTEGER), characteristic_id (INTEGER), product_characteristic_value (VARCHAR(50))" }, { "query": "SELECT count(*) FROM event", "question": "How many events are there?", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT name FROM event ORDER BY YEAR DESC", "question": "List all the event names by year from the most recent to the oldest.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT name FROM event ORDER BY YEAR DESC LIMIT 1", "question": "What is the name of the event that happened in the most recent year?", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT count(*) FROM stadium", "question": "How many stadiums are there?", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT name FROM stadium ORDER BY capacity DESC LIMIT 1", "question": "Find the name of the stadium that has the maximum capacity.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT name FROM stadium WHERE capacity < (SELECT avg(capacity) FROM stadium)", "question": "Find the names of stadiums whose capacity is smaller than the average capacity.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT country FROM stadium GROUP BY country ORDER BY count(*) DESC LIMIT 1", "question": "Find the country that has the most stadiums.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT country FROM stadium GROUP BY country HAVING count(*) <= 3", "question": "Which country has at most 3 stadiums listed?", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT country FROM stadium WHERE capacity > 60000 INTERSECT SELECT country FROM stadium WHERE capacity < 50000", "question": "Which country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000?", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT count(DISTINCT city) FROM stadium WHERE opening_year < 2006", "question": "How many cities have a stadium that was opened before the year of 2006?", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT country , count(*) FROM stadium GROUP BY country", "question": "How many stadiums does each country have?", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year > 2006", "question": "Which countries do not have a stadium that was opened after 2006?", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT count(*) FROM stadium WHERE country != 'Russia'", "question": "How many stadiums are not in country \"Russia\"?", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT name FROM swimmer ORDER BY meter_100", "question": "Find the names of all swimmers, sorted by their 100 meter scores in ascending order.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT count(DISTINCT nationality) FROM swimmer", "question": "How many different countries are all the swimmers from?", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT nationality , count(*) FROM swimmer GROUP BY nationality HAVING count(*) > 1", "question": "List countries that have more than one swimmer.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT meter_200 , meter_300 FROM swimmer WHERE nationality = 'Australia'", "question": "Find all 200 meter and 300 meter results of swimmers with nationality \"Australia\".", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win'", "question": "Find the names of swimmers who has a result of \"win\".", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT t1.name FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the name of the stadium which held the most events?", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT t1.name , t1.capacity FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id WHERE t2.name = 'World Junior'", "question": "Find the name and capacity of the stadium where the event named \"World Junior\" happened.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT name FROM stadium WHERE id NOT IN (SELECT stadium_id FROM event)", "question": "Find the names of stadiums which have never had any event.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id ORDER BY count(*) DESC LIMIT 1", "question": "Find the name of the swimmer who has the most records.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id HAVING count(*) >= 2", "question": "Find the name of the swimmer who has at least 2 records.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT t1.name , t1.nationality FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' GROUP BY t2.swimmer_id HAVING count(*) > 1", "question": "Find the name and nationality of the swimmer who has won (i.e., has a result of \"win\") more than 1 time.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT name FROM swimmer WHERE id NOT IN (SELECT swimmer_id FROM record)", "question": "Find the names of the swimmers who have no record.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' INTERSECT SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Loss'", "question": "Find the names of the swimmers who have both \"win\" and \"loss\" results in the record.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT t4.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id JOIN event AS t3 ON t2.event_id = t3.id JOIN stadium AS t4 ON t4.id = t3.stadium_id WHERE t1.nationality = 'Australia'", "question": "Find the names of stadiums that some Australian swimmers have been to.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT t3.name FROM record AS t1 JOIN event AS t2 ON t1.event_id = t2.id JOIN stadium AS t3 ON t3.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY count(*) DESC LIMIT 1", "question": "Find the names of stadiums that the most swimmers have been to.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT * FROM swimmer", "question": "Find all details for each swimmer.", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT avg(capacity) FROM stadium WHERE opening_year = 2005", "question": "What is the average capacity of the stadiums that were opened in year 2005?", "schema": "swimmer: ID (INT), name (TEXT), Nationality (TEXT), meter_100 (REAL), meter_200 (TEXT), meter_300 (TEXT), meter_400 (TEXT), meter_500 (TEXT), meter_600 (TEXT), meter_700 (TEXT), Time (TEXT)\nstadium: ID (INT), name (TEXT), Capacity (INT), City (TEXT), Country (TEXT), Opening_year (INT)\nevent: ID (INT), Name (TEXT), Stadium_ID (INT), Year (TEXT)\nrecord: ID (INT), Result (TEXT), Swimmer_ID (INT), Event_ID (INT)" }, { "query": "SELECT count(*) FROM railway", "question": "How many railways are there?", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT Builder FROM railway ORDER BY Builder ASC", "question": "List the builders of railways in ascending alphabetical order.", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT Wheels , LOCATION FROM railway", "question": "List the wheels and locations of the railways.", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT max(LEVEL) FROM manager WHERE Country != \"Australia\t\"", "question": "What is the maximum level of managers in countries that are not \"Australia\"?", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT avg(Age) FROM manager", "question": "What is the average age for all managers?", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT Name FROM manager ORDER BY LEVEL ASC", "question": "What are the names of managers in ascending order of level?", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT Name , Arrival FROM train", "question": "What are the names and arrival times of trains?", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT Name FROM manager ORDER BY Age DESC LIMIT 1", "question": "What is the name of the oldest manager?", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT T2.Name , T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID", "question": "Show the names of trains and locations of railways they are in.", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID WHERE T2.Name = \"Andaman Exp\"", "question": "Show the builder of railways associated with the trains named \"Andaman Exp\".", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT T2.Railway_ID , T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID HAVING COUNT(*) > 1", "question": "Show id and location of railways that are associated with more than one train.", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT T2.Railway_ID , T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the id and builder of the railway that are associated with the most trains.", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT Builder , COUNT(*) FROM railway GROUP BY Builder", "question": "Show different builders of railways, along with the corresponding number of railways using each builder.", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT Builder FROM railway GROUP BY Builder ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the most common builder of railways.", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT LOCATION , COUNT(*) FROM railway GROUP BY LOCATION", "question": "Show different locations of railways along with the corresponding number of railways at each location.", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT LOCATION FROM railway GROUP BY LOCATION HAVING COUNT(*) > 1", "question": "Show the locations that have more than one railways.", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT ObjectNumber FROM railway WHERE Railway_ID NOT IN (SELECT Railway_ID FROM train)", "question": "List the object number of railways that do not have any trains.", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT Country FROM manager WHERE Age > 50 INTERSECT SELECT Country FROM manager WHERE Age < 46", "question": "Show the countries that have both managers of age above 50 and managers of age below 46.", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT DISTINCT Country FROM manager", "question": "Show the distinct countries of managers.", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT Working_year_starts FROM manager ORDER BY LEVEL DESC", "question": "Show the working years of managers in descending order of their level.", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT Country FROM manager WHERE Age > 50 OR Age < 46", "question": "Show the countries that have managers of age above 50 or below 46.", "schema": "railway: Railway_ID (INT), Railway (TEXT), Builder (TEXT), Built (TEXT), Wheels (TEXT), Location (TEXT), ObjectNumber (TEXT)\ntrain: Train_ID (INT), Train_Num (TEXT), Name (TEXT), From (TEXT), Arrival (TEXT), Railway_ID (INT)\nmanager: Manager_ID (INT), Name (TEXT), Country (TEXT), Working_year_starts (TEXT), Age (INT), Level (INT)\nrailway_manage: Railway_ID (INT), Manager_ID (INT), From_Year (TEXT)" }, { "query": "SELECT count(*) FROM addresses WHERE country = 'USA'", "question": "How many addresses are there in country USA?", "schema": "Addresses: address_id (INTEGER), line_1_number_building (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(15)), product_name (VARCHAR(80)), product_price (DOUBLE)\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(15)), customer_number (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nContacts: contact_id (INTEGER), customer_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(50)), contact_phone (VARCHAR(80))\nCustomer_Address_History: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_date (DATETIME), order_status_code (VARCHAR(15))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(80))" }, { "query": "SELECT DISTINCT city FROM addresses", "question": "Show all distinct cities in the address record.", "schema": "Addresses: address_id (INTEGER), line_1_number_building (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(15)), product_name (VARCHAR(80)), product_price (DOUBLE)\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(15)), customer_number (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nContacts: contact_id (INTEGER), customer_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(50)), contact_phone (VARCHAR(80))\nCustomer_Address_History: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_date (DATETIME), order_status_code (VARCHAR(15))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(80))" }, { "query": "SELECT state_province_county , count(*) FROM addresses GROUP BY state_province_county", "question": "Show each state and the number of addresses in each state.", "schema": "Addresses: address_id (INTEGER), line_1_number_building (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(15)), product_name (VARCHAR(80)), product_price (DOUBLE)\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(15)), customer_number (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nContacts: contact_id (INTEGER), customer_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(50)), contact_phone (VARCHAR(80))\nCustomer_Address_History: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_date (DATETIME), order_status_code (VARCHAR(15))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(80))" }, { "query": "SELECT customer_name , customer_phone FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM customer_address_history)", "question": "Show names and phones of customers who do not have address information.", "schema": "Addresses: address_id (INTEGER), line_1_number_building (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(15)), product_name (VARCHAR(80)), product_price (DOUBLE)\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(15)), customer_number (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nContacts: contact_id (INTEGER), customer_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(50)), contact_phone (VARCHAR(80))\nCustomer_Address_History: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_date (DATETIME), order_status_code (VARCHAR(15))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(80))" }, { "query": "SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1", "question": "Show the name of the customer who has the most orders.", "schema": "Addresses: address_id (INTEGER), line_1_number_building (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(15)), product_name (VARCHAR(80)), product_price (DOUBLE)\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(15)), customer_number (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nContacts: contact_id (INTEGER), customer_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(50)), contact_phone (VARCHAR(80))\nCustomer_Address_History: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_date (DATETIME), order_status_code (VARCHAR(15))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(80))" }, { "query": "SELECT product_type_code FROM products GROUP BY product_type_code HAVING count(*) >= 2", "question": "Show the product type codes which have at least two products.", "schema": "Addresses: address_id (INTEGER), line_1_number_building (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(15)), product_name (VARCHAR(80)), product_price (DOUBLE)\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(15)), customer_number (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nContacts: contact_id (INTEGER), customer_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(50)), contact_phone (VARCHAR(80))\nCustomer_Address_History: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_date (DATETIME), order_status_code (VARCHAR(15))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(80))" }, { "query": "SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Completed' INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Part'", "question": "Show the names of customers who have both an order in completed status and an order in part status.", "schema": "Addresses: address_id (INTEGER), line_1_number_building (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(15)), product_name (VARCHAR(80)), product_price (DOUBLE)\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(15)), customer_number (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nContacts: contact_id (INTEGER), customer_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(50)), contact_phone (VARCHAR(80))\nCustomer_Address_History: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_date (DATETIME), order_status_code (VARCHAR(15))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(80))" }, { "query": "SELECT customer_name , customer_phone , payment_method_code FROM customers ORDER BY customer_number DESC", "question": "Show the name, phone, and payment method code for all customers in descending order of customer number.", "schema": "Addresses: address_id (INTEGER), line_1_number_building (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(15)), product_name (VARCHAR(80)), product_price (DOUBLE)\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(15)), customer_number (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nContacts: contact_id (INTEGER), customer_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(50)), contact_phone (VARCHAR(80))\nCustomer_Address_History: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_date (DATETIME), order_status_code (VARCHAR(15))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(80))" }, { "query": "SELECT T1.product_name , sum(T2.order_quantity) FROM products AS T1 JOIN order_items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_id", "question": "Show the product name and total order quantity for each product.", "schema": "Addresses: address_id (INTEGER), line_1_number_building (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(15)), product_name (VARCHAR(80)), product_price (DOUBLE)\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(15)), customer_number (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nContacts: contact_id (INTEGER), customer_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(50)), contact_phone (VARCHAR(80))\nCustomer_Address_History: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_date (DATETIME), order_status_code (VARCHAR(15))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(80))" }, { "query": "SELECT min(product_price) , max(product_price) , avg(product_price) FROM products", "question": "Show the minimum, maximum, average price for all products.", "schema": "Addresses: address_id (INTEGER), line_1_number_building (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(15)), product_name (VARCHAR(80)), product_price (DOUBLE)\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(15)), customer_number (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nContacts: contact_id (INTEGER), customer_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(50)), contact_phone (VARCHAR(80))\nCustomer_Address_History: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_date (DATETIME), order_status_code (VARCHAR(15))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(80))" }, { "query": "SELECT count(*) FROM products WHERE product_price > (SELECT avg(product_price) FROM products)", "question": "How many products have a price higher than the average?", "schema": "Addresses: address_id (INTEGER), line_1_number_building (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(15)), product_name (VARCHAR(80)), product_price (DOUBLE)\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(15)), customer_number (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nContacts: contact_id (INTEGER), customer_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(50)), contact_phone (VARCHAR(80))\nCustomer_Address_History: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_date (DATETIME), order_status_code (VARCHAR(15))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(80))" }, { "query": "SELECT T2.customer_name , T3.city , T1.date_from , T1.date_to FROM customer_address_history AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id JOIN addresses AS T3 ON T1.address_id = T3.address_id", "question": "Show the customer name, customer address city, date from, and date to for each customer address history.", "schema": "Addresses: address_id (INTEGER), line_1_number_building (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(15)), product_name (VARCHAR(80)), product_price (DOUBLE)\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(15)), customer_number (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nContacts: contact_id (INTEGER), customer_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(50)), contact_phone (VARCHAR(80))\nCustomer_Address_History: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_date (DATETIME), order_status_code (VARCHAR(15))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(80))" }, { "query": "SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_method_code = 'Credit Card' GROUP BY T1.customer_id HAVING count(*) > 2", "question": "Show the names of customers who use Credit Card payment method and have more than 2 orders.", "schema": "Addresses: address_id (INTEGER), line_1_number_building (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(15)), product_name (VARCHAR(80)), product_price (DOUBLE)\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(15)), customer_number (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nContacts: contact_id (INTEGER), customer_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(50)), contact_phone (VARCHAR(80))\nCustomer_Address_History: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_date (DATETIME), order_status_code (VARCHAR(15))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(80))" }, { "query": "SELECT T1.customer_name , T1.customer_phone FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T3.order_id = T2.order_id GROUP BY T1.customer_id ORDER BY sum(T3.order_quantity) DESC LIMIT 1", "question": "What are the name and phone of the customer with the most ordered product quantity?", "schema": "Addresses: address_id (INTEGER), line_1_number_building (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(15)), product_name (VARCHAR(80)), product_price (DOUBLE)\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(15)), customer_number (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nContacts: contact_id (INTEGER), customer_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(50)), contact_phone (VARCHAR(80))\nCustomer_Address_History: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_date (DATETIME), order_status_code (VARCHAR(15))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(80))" }, { "query": "SELECT product_type_code , product_name FROM products WHERE product_price > 1000 OR product_price < 500", "question": "Show the product type and name for the products with price higher than 1000 or lower than 500.", "schema": "Addresses: address_id (INTEGER), line_1_number_building (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50))\nProducts: product_id (INTEGER), product_type_code (VARCHAR(15)), product_name (VARCHAR(80)), product_price (DOUBLE)\nCustomers: customer_id (INTEGER), payment_method_code (VARCHAR(15)), customer_number (VARCHAR(20)), customer_name (VARCHAR(80)), customer_address (VARCHAR(255)), customer_phone (VARCHAR(80)), customer_email (VARCHAR(80))\nContacts: contact_id (INTEGER), customer_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(50)), contact_phone (VARCHAR(80))\nCustomer_Address_History: customer_id (INTEGER), address_id (INTEGER), date_from (DATETIME), date_to (DATETIME)\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_date (DATETIME), order_status_code (VARCHAR(15))\nOrder_Items: order_item_id (INTEGER), order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(80))" }, { "query": "SELECT dorm_name FROM dorm WHERE gender = 'F'", "question": "Find the name of dorms only for female (F gender).", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT dorm_name FROM dorm WHERE gender = 'F'", "question": "What are the names of the all-female dorms?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT dorm_name FROM dorm WHERE student_capacity > 300", "question": "Find the name of dorms that can accommodate more than 300 students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT dorm_name FROM dorm WHERE student_capacity > 300", "question": "What are the names of all the dorms that can accomdate more than 300 students?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) FROM student WHERE sex = 'F' AND age < 25", "question": "How many female students (sex is F) whose age is below 25?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) FROM student WHERE sex = 'F' AND age < 25", "question": "How many girl students who are younger than 25?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT fname FROM student WHERE age > 20", "question": "Find the first name of students who is older than 20.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT fname FROM student WHERE age > 20", "question": "What are the first names of all students who are older than 20?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT fname FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25", "question": "Find the first name of students living in city PHL whose age is between 20 and 25.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT fname FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25", "question": "What is the first name of the students who are in age 20 to 25 and living in PHL city?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) FROM dorm", "question": "How many dorms are there?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) FROM dorm", "question": "How many dorms are in the database?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) FROM dorm_amenity", "question": "Find the number of distinct amenities.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) FROM dorm_amenity", "question": "How many diffrent dorm amenities are there?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT sum(student_capacity) FROM dorm", "question": "Find the total capacity of all dorms.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT sum(student_capacity) FROM dorm", "question": "What is the total student capacity of all dorms?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) FROM student", "question": "How many students are there?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) FROM student", "question": "How many students exist?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT avg(age) , city_code FROM student GROUP BY city_code", "question": "Find the average age of all students living in the each city.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT avg(age) , city_code FROM student GROUP BY city_code", "question": "What is the average age for each city and what are those cities?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT avg(student_capacity) , sum(student_capacity) FROM dorm WHERE gender = 'X'", "question": "Find the average and total capacity of dorms for the students with gender X.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT avg(student_capacity) , sum(student_capacity) FROM dorm WHERE gender = 'X'", "question": "What is the average and total capacity for all dorms who are of gender X?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(DISTINCT dormid) FROM has_amenity", "question": "Find the number of dorms that have some amenity.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(DISTINCT dormid) FROM has_amenity", "question": "How many dorms have amenities?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT dorm_name FROM dorm WHERE dormid NOT IN (SELECT dormid FROM has_amenity)", "question": "Find the name of dorms that do not have any amenity", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT dorm_name FROM dorm WHERE dormid NOT IN (SELECT dormid FROM has_amenity)", "question": "What are the names of all the dorms that don't have any amenities?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(DISTINCT gender) FROM dorm", "question": "Find the number of distinct gender for dorms.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(DISTINCT gender) FROM dorm", "question": "How many different genders are there in the dorms?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT student_capacity , gender FROM dorm WHERE dorm_name LIKE '%Donor%'", "question": "Find the capacity and gender type of the dorm whose name has substring \u2018Donor\u2019.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT student_capacity , gender FROM dorm WHERE dorm_name LIKE '%Donor%'", "question": "What is the student capacity and type of gender for the dorm whose name as the phrase Donor in it?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT dorm_name , gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100", "question": "Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT dorm_name , gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100", "question": "What are the names and types of the dorms that have a capacity greater than 300 or less than 100?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(DISTINCT major) , count(DISTINCT city_code) FROM student", "question": "Find the numbers of different majors and cities.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(DISTINCT major) , count(DISTINCT city_code) FROM student", "question": "How many different majors are there and how many different city codes are there for each student?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'", "question": "Find the name of dorms which have both TV Lounge and Study Room as amenities.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'", "question": "What is the name of the dorm with both a TV Lounge and Study Room listed as amenities?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'", "question": "Find the name of dorms which have TV Lounge but no Study Room as amenity.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'", "question": "What is the name of each dorm that has a TV Lounge but no study rooms?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT lname FROM student WHERE sex = 'F' AND city_code = 'BAL' UNION SELECT lname FROM student WHERE sex = 'M' AND age < 20", "question": "Find the last name of students who is either female (sex is F) and living in the city of code BAL or male (sex is M) and in age of below 20.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT lname FROM student WHERE sex = 'F' AND city_code = 'BAL' UNION SELECT lname FROM student WHERE sex = 'M' AND age < 20", "question": "What is the last name of every student who is either female or living in a city with the code BAL or male and under 20?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1", "question": "Find the name of the dorm with the largest capacity.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1", "question": "What are the names of the dorm with the largest capacity?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name", "question": "List in alphabetic order all different amenities.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name", "question": "What are the different dorm amenity names in alphabetical order?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT city_code FROM student GROUP BY city_code ORDER BY count(*) DESC LIMIT 1", "question": "Find the code of city where most of students are living in.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT city_code FROM student GROUP BY city_code ORDER BY count(*) DESC LIMIT 1", "question": "What is the code of the city with the most students?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT fname , lname FROM student WHERE age < (SELECT avg(age) FROM student)", "question": "Find the first and last name of students whose age is younger than the average age.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT fname , lname FROM student WHERE age < (SELECT avg(age) FROM student)", "question": "What is the first and last name of all students who are younger than average?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT fname , lname FROM student WHERE city_code != 'HKG' ORDER BY age", "question": "List the first and last name of students who are not living in the city with code HKG, and sorted the results by their ages.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT fname , lname FROM student WHERE city_code != 'HKG' ORDER BY age", "question": "What are the first and last names of all students who are not living in the city HKG and order the results by age?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid = T1.amenid JOIN dorm AS T3 ON T2.dormid = T3.dormid WHERE T3.dorm_name = 'Anonymous Donor Hall' ORDER BY T1.amenity_name", "question": "List name of all amenities which Anonymous Donor Hall has, and sort the results in alphabetic order.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid = T1.amenid JOIN dorm AS T3 ON T2.dormid = T3.dormid WHERE T3.dorm_name = 'Anonymous Donor Hall' ORDER BY T1.amenity_name", "question": "What are the amenities in alphabetical order that Anonymous Donor Hall has?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , sum(student_capacity) , gender FROM dorm GROUP BY gender", "question": "Find the number of dorms and total capacity for each gender.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , sum(student_capacity) , gender FROM dorm GROUP BY gender", "question": "How many dorms are there and what is the total capacity for each gender?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT avg(age) , max(age) , sex FROM student GROUP BY sex", "question": "Find the average and oldest age for students with different sex.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT avg(age) , max(age) , sex FROM student GROUP BY sex", "question": "What is the average and oldest age for each gender of student?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , major FROM student GROUP BY major", "question": "Find the number of students in each major.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , major FROM student GROUP BY major", "question": "How many students are there in each major?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , avg(age) , city_code FROM student GROUP BY city_code", "question": "Find the number and average age of students living in each city.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , avg(age) , city_code FROM student GROUP BY city_code", "question": "How many students live in each city and what are their average ages?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , avg(age) , city_code FROM student WHERE sex = 'M' GROUP BY city_code", "question": "Find the average age and number of male students (with sex M) from each city.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , avg(age) , city_code FROM student WHERE sex = 'M' GROUP BY city_code", "question": "What is the average age and how many male students are there in each city?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , city_code FROM student GROUP BY city_code HAVING count(*) > 1", "question": "Find the number of students for the cities where have more than one student.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , city_code FROM student GROUP BY city_code HAVING count(*) > 1", "question": "How many students are from each city, and which cities have more than one cities?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT fname , lname FROM student WHERE major != (SELECT major FROM student GROUP BY major ORDER BY count(*) DESC LIMIT 1)", "question": "Find the first and last name of students who are not in the largest major.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT fname , lname FROM student WHERE major != (SELECT major FROM student GROUP BY major ORDER BY count(*) DESC LIMIT 1)", "question": "What is the first and last name of the students who are not in the largest major?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , sex FROM student WHERE age > (SELECT avg(age) FROM student) GROUP BY sex", "question": "Find the number of students whose age is older than the average age for each gender.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , sex FROM student WHERE age > (SELECT avg(age) FROM student) GROUP BY sex", "question": "How many students are older than average for each gender?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT avg(T1.age) , T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name", "question": "Find the average age of students living in each dorm and the name of dorm.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT avg(T1.age) , T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name", "question": "What is the average age for each dorm and what are the names of each dorm?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid", "question": "Find the number of amenities for each of the dorms that can accommodate more than 100 students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid", "question": "For each dorm, how many amenities does it have?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name", "question": "Find the number of students who is older than 20 in each dorm.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) , T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name", "question": "How many students are older than 20 in each dorm?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall'", "question": "Find the first name of students who are living in the Smith Hall.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall'", "question": "What are the first names of all students in Smith Hall?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT avg(T1.age) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.student_capacity = (SELECT max(student_capacity) FROM dorm)", "question": "Find the average age of students who are living in the dorm with the largest capacity.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT avg(T1.age) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.student_capacity = (SELECT max(student_capacity) FROM dorm)", "question": "What is the average age of students who are living in the dorm with the largest capacity?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M'", "question": "Find the total number of students living in the male dorm (with gender M).", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M'", "question": "What are the total number of students who are living in a male dorm?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' AND T1.sex = 'F'", "question": "Find the number of female students (with F sex) living in Smith Hall", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' AND T1.sex = 'F'", "question": "How many female students live in Smith Hall?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall'", "question": "Find the name of amenities Smith Hall dorm have.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall'", "question": "What are the names of the amenities that Smith Hall has?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name", "question": "Find the name of amenities Smith Hall dorm have. ordered the results by amenity names.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name", "question": "What amenities does Smith Hall have in alphabetical order?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY count(*) DESC LIMIT 1", "question": "Find the name of amenity that is most common in all dorms.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY count(*) DESC LIMIT 1", "question": "What is the most common amenity in the dorms?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid = T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid = T5.amenid GROUP BY T3.dormid ORDER BY count(*) DESC LIMIT 1)", "question": "Find the first name of students who are living in the dorm that has most number of amenities.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid = T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid = T5.amenid GROUP BY T3.dormid ORDER BY count(*) DESC LIMIT 1)", "question": "What are the first names of all students who live in the dorm with the most amenities?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.dorm_name , T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid GROUP BY T2.dormid ORDER BY count(*) LIMIT 1", "question": "Find the name and capacity of the dorm with least number of amenities.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.dorm_name , T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid GROUP BY T2.dormid ORDER BY count(*) LIMIT 1", "question": "What is the name and capacity of the dorm with the fewest amount of amenities?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT dorm_name FROM dorm EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge'", "question": "Find the name of dorms that do not have amenity TV Lounge.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT dorm_name FROM dorm EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge'", "question": "What are the names of the dorm that does not have a TV Lounge?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.fname , T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')", "question": "Find the first and last name of students who are living in the dorms that have amenity TV Lounge.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.fname , T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')", "question": "What are the first and last names of all students who are living in a dorm with a TV Lounge?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.fname , T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid NOT IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')", "question": "Find the first name and age of students who are living in the dorms that do not have amenity TV Lounge.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T1.fname , T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid NOT IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')", "question": "What is the first name and age of every student who lives in a dorm with a TV Lounge?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid JOIN lives_in AS T4 ON T4.dormid = T1.dormid JOIN student AS T5 ON T5.stuid = T4.stuid WHERE T5.lname = 'Smith'", "question": "Find the name of amenities of the dorm where the student with last name Smith is living in.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid JOIN lives_in AS T4 ON T4.dormid = T1.dormid JOIN student AS T5 ON T5.stuid = T4.stuid WHERE T5.lname = 'Smith'", "question": "What are the amenities in the dorm that a student who has the last name of Smith lives in?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nDorm: dormid (INTEGER), dorm_name (VARCHAR(20)), student_capacity (INTEGER), gender (VARCHAR(1))\nDorm_amenity: amenid (INTEGER), amenity_name (VARCHAR(25))\nHas_amenity: dormid (INTEGER), amenid (INTEGER)\nLives_in: stuid (INTEGER), dormid (INTEGER), room_number (INTEGER)" }, { "query": "SELECT count(*) FROM customers", "question": "How many customers are there?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT count(*) FROM customers", "question": "Count the number of customers.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT email_address , phone_number FROM customers ORDER BY email_address , phone_number", "question": "Find the emails and phone numbers of all the customers, ordered by email address and phone number.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT email_address , phone_number FROM customers ORDER BY email_address , phone_number", "question": "What are the emails and phone numbers of all customers, sorted by email address and phone number?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT town_city FROM customers WHERE customer_type_code = \"Good Credit Rating\" GROUP BY town_city ORDER BY count(*) LIMIT 1", "question": "Which city has the least number of customers whose type code is \"Good Credit Rating\"?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT town_city FROM customers WHERE customer_type_code = \"Good Credit Rating\" GROUP BY town_city ORDER BY count(*) LIMIT 1", "question": "Return the city with the customer type code \"Good Credit Rating\" that had the fewest customers.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT t1.product_name , count(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name", "question": "List the name of all products along with the number of complaints that they have received.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT t1.product_name , count(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name", "question": "What are all the different product names, and how many complains has each received?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY count(*) LIMIT 1", "question": "Find the emails of customers who has filed a complaints of the product with the most complaints.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY count(*) LIMIT 1", "question": "What are the emails of customers who have filed complaints on the product which has had the greatest number of complaints?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id JOIN customers AS t3 GROUP BY t3.customer_id ORDER BY count(*) LIMIT 1", "question": "Which products has been complained by the customer who has filed least amount of complaints?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id JOIN customers AS t3 GROUP BY t3.customer_id ORDER BY count(*) LIMIT 1", "question": "Return the names of products that have had complaints filed by the customer who has filed the fewest complaints.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1", "question": "What is the phone number of the customer who has filed the most recent complaint?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1", "question": "Return the phone number of the customer who filed the complaint that was raised most recently.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT email_address , phone_number FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM complaints)", "question": "Find the email and phone number of the customers who have never filed a complaint before.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT email_address , phone_number FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM complaints)", "question": "What are the emails and phone numbers of custoemrs who have never filed a complaint?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT phone_number FROM customers UNION SELECT phone_number FROM staff", "question": "Find the phone number of all the customers and staff.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT phone_number FROM customers UNION SELECT phone_number FROM staff", "question": "What are the phone numbers of all customers and all staff members?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT product_description FROM products WHERE product_name = \"Chocolate\"", "question": "What is the description of the product named \"Chocolate\"?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT product_description FROM products WHERE product_name = \"Chocolate\"", "question": "Return the description of the product called \"Chocolate\".", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT product_name , product_category_code FROM products ORDER BY product_price DESC LIMIT 1", "question": "Find the name and category of the most expensive product.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT product_name , product_category_code FROM products ORDER BY product_price DESC LIMIT 1", "question": "What is the name and category code of the product with the highest price?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT product_price FROM products WHERE product_id NOT IN (SELECT product_id FROM complaints)", "question": "Find the prices of products which has never received a single complaint.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT product_price FROM products WHERE product_id NOT IN (SELECT product_id FROM complaints)", "question": "What are the prices of products that have never gotten a complaint?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT avg(product_price) , product_category_code FROM products GROUP BY product_category_code", "question": "What is the average price of the products for each category?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT avg(product_price) , product_category_code FROM products GROUP BY product_category_code", "question": "Return the average price of products that have each category code.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id JOIN products AS t3 ON t2.product_id = t3.product_id ORDER BY t3.product_price LIMIT 1", "question": "Find the last name of the staff member who processed the complaint of the cheapest product.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id JOIN products AS t3 ON t2.product_id = t3.product_id ORDER BY t3.product_price LIMIT 1", "question": "What is the last name of the staff member in charge of the complaint on the product with the lowest price?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING count(*) > 3", "question": "Which complaint status has more than 3 records on file?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING count(*) > 3", "question": "Return complaint status codes have more than 3 corresponding complaints?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT last_name FROM staff WHERE email_address LIKE \"%wrau%\"", "question": "Find the last name of the staff whose email address contains \"wrau\".", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT last_name FROM staff WHERE email_address LIKE \"%wrau%\"", "question": "What are the last names of staff with email addressed containing the substring \"wrau\"?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT count(*) FROM customers GROUP BY customer_type_code ORDER BY count(*) DESC LIMIT 1", "question": "How many customers are there in the customer type with the most customers?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT count(*) FROM customers GROUP BY customer_type_code ORDER BY count(*) DESC LIMIT 1", "question": "Count the number of customers that have the customer type that is most common.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1", "question": "What is the last name of the staff who has handled the first ever complaint?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1", "question": "Return the last name of the staff member who handled the complaint with the earliest date raised.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT count(DISTINCT complaint_type_code) FROM complaints", "question": "How many distinct complaint type codes are there in the database?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT count(DISTINCT complaint_type_code) FROM complaints", "question": "Count the number of different complaint type codes.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT address_line_1 , address_line_2 FROM customers WHERE email_address = \"vbogisich@example.org\"", "question": "Find the address line 1 and 2 of the customer with email \"vbogisich@example.org\".", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT address_line_1 , address_line_2 FROM customers WHERE email_address = \"vbogisich@example.org\"", "question": "What are lines 1 and 2 of the addressed of the customer with the email \"vbogisich@example.org\"?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT complaint_status_code , count(*) FROM complaints WHERE complaint_type_code = \"Product Failure\" GROUP BY complaint_status_code", "question": "Find the number of complaints with Product Failure type for each complaint status.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT complaint_status_code , count(*) FROM complaints WHERE complaint_type_code = \"Product Failure\" GROUP BY complaint_status_code", "question": "Of complaints with the type code \"Product Failure\", how many had each different status code?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY count(*) LIMIT 5", "question": "What is first names of the top 5 staff who have handled the greatest number of complaints?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY count(*) LIMIT 5", "question": "Return the first names of the 5 staff members who have handled the most complaints.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT state FROM customers GROUP BY state ORDER BY count(*) LIMIT 1", "question": "Which state has the most customers?", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT state FROM customers GROUP BY state ORDER BY count(*) LIMIT 1", "question": "Give the state that has the most customers.", "schema": "Staff: staff_id (INTEGER), gender (VARCHAR(1)), first_name (VARCHAR(80)), last_name (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nCustomers: customer_id (INTEGER), customer_type_code (VARCHAR(20)), address_line_1 (VARCHAR(80)), address_line_2 (VARCHAR(80)), town_city (VARCHAR(80)), state (VARCHAR(80)), email_address (VARCHAR(255)), phone_number (VARCHAR(80))\nProducts: product_id (INTEGER), parent_product_id (INTEGER), product_category_code (VARCHAR(20)), date_product_first_available (DATETIME), date_product_discontinued (DATETIME), product_name (VARCHAR(80)), product_description (VARCHAR(255)), product_price (DECIMAL(194))\nComplaints: complaint_id (INTEGER), product_id (INTEGER), customer_id (INTEGER), complaint_outcome_code (VARCHAR(20)), complaint_status_code (VARCHAR(20)), complaint_type_code (VARCHAR(20)), date_complaint_raised (DATETIME), date_complaint_closed (DATETIME), staff_id (INTEGER)" }, { "query": "SELECT count(*) FROM submission", "question": "How many submissions are there?", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT count(*) FROM submission", "question": "Count the number of submissions.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT Author FROM submission ORDER BY Scores ASC", "question": "List the authors of submissions in ascending order of scores.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT Author FROM submission ORDER BY Scores ASC", "question": "Find the author for each submission and list them in ascending order of submission score.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT Author , College FROM submission", "question": "What are the authors of submissions and their colleges?", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT Author , College FROM submission", "question": "For each submission, show the author and their affiliated college.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT Author FROM submission WHERE College = \"Florida\" OR College = \"Temple\"", "question": "Show the names of authors from college \"Florida\" or \"Temple\"", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT Author FROM submission WHERE College = \"Florida\" OR College = \"Temple\"", "question": "Which authors with submissions are from college \"Florida\" or \"Temple\"?", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT avg(Scores) FROM submission", "question": "What is the average score of submissions?", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT avg(Scores) FROM submission", "question": "Compute the average score of submissions.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1", "question": "What is the author of the submission with the highest score?", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1", "question": "Find the author who achieved the highest score in a submission.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT College , COUNT(*) FROM submission GROUP BY College", "question": "Show different colleges along with the number of authors of submission from each college.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT College , COUNT(*) FROM submission GROUP BY College", "question": "For each college, return the college name and the count of authors with submissions from that college.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the most common college of authors of submissions.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1", "question": "Which college has the most authors with submissions?", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT College FROM submission WHERE Scores > 90 INTERSECT SELECT College FROM submission WHERE Scores < 80", "question": "Show the colleges that have both authors with submission score larger than 90 and authors with submission score smaller than 80.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT College FROM submission WHERE Scores > 90 INTERSECT SELECT College FROM submission WHERE Scores < 80", "question": "Which colleges have both authors with submission score above 90 and authors with submission score below 80?", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT T2.Author , T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID", "question": "Show the authors of submissions and the acceptance results of their submissions.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT T2.Author , T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID", "question": "For each submission, find its author and acceptance result.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1", "question": "Show the result of the submission with the highest score.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1", "question": "Which submission received the highest score in acceptance result. Show me the result.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT T2.Author , COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author", "question": "Show each author and the number of workshops they submitted to.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT T2.Author , COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author", "question": "How many workshops did each author submit to? Return the author name and the number of workshops.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id) > 1", "question": "Show the authors who have submissions to more than one workshop.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id) > 1", "question": "Which authors have submitted to more than one workshop?", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT Date , Venue FROM workshop ORDER BY Venue", "question": "Show the date and venue of each workshop in ascending alphabetical order of the venue.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT Date , Venue FROM workshop ORDER BY Venue", "question": "Sort the each workshop in alphabetical order of the venue. Return the date and venue of each workshop.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT Author FROM submission WHERE Submission_ID NOT IN (SELECT Submission_ID FROM acceptance)", "question": "List the authors who do not have submission to any workshop.", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT Author FROM submission WHERE Submission_ID NOT IN (SELECT Submission_ID FROM acceptance)", "question": "Which authors did not submit to any workshop?", "schema": "workshop: Workshop_ID (INT), Date (TEXT), Venue (TEXT), Name (TEXT)\nsubmission: Submission_ID (INT), Scores (REAL), Author (TEXT), College (TEXT)\nAcceptance: Submission_ID (INT), Workshop_ID (INT), Result (TEXT)" }, { "query": "SELECT count(*) FROM INVESTORS", "question": "Find the number of investors in total.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT Investor_details FROM INVESTORS", "question": "Show all investor details.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT DISTINCT lot_details FROM LOTS", "question": "Show all distinct lot details.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT max(amount_of_transaction) FROM TRANSACTIONS", "question": "Show the maximum amount of transaction.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT date_of_transaction , share_count FROM TRANSACTIONS", "question": "Show all date and share count of transactions.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT sum(share_count) FROM TRANSACTIONS", "question": "What is the total share of transactions?", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT transaction_id FROM TRANSACTIONS WHERE transaction_type_code = 'PUR'", "question": "Show all transaction ids with transaction code 'PUR'.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT date_of_transaction FROM TRANSACTIONS WHERE transaction_type_code = \"SALE\"", "question": "Show all dates of transactions whose type code is \"SALE\".", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT avg(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = \"SALE\"", "question": "Show the average amount of transactions with type code \"SALE\".", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT transaction_type_description FROM Ref_Transaction_Types WHERE transaction_type_code\t = \"PUR\"", "question": "Show the description of transaction type with code \"PUR\".", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT min(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = \"PUR\" AND share_count > 50", "question": "Show the minimum amount of transactions whose type code is \"PUR\" and whose share count is bigger than 50.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT max(share_count) FROM TRANSACTIONS WHERE amount_of_transaction < 10000", "question": "Show the maximum share count of transactions where the amount is smaller than 10000", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count > 100 OR amount_of_transaction > 1000", "question": "Show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT T1.transaction_type_description , T2.date_of_transaction FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10", "question": "Show the transaction type descriptions and dates if the share count is smaller than 10.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.share_count > 100", "question": "Show details of all investors if they make any transaction with share count greater than 100.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT COUNT(DISTINCT transaction_type_code) FROM TRANSACTIONS", "question": "How many distinct transaction types are used in the transactions?", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT lot_details , investor_id FROM LOTS", "question": "Return the lot details and investor ids.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT T2.lot_details FROM INVESTORS AS T1 JOIN LOTS AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = \"l\"", "question": "Return the lot details of lots that belong to investors with details \"l\"?", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT T1.purchase_details FROM PURCHASES AS T1 JOIN TRANSACTIONS AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000", "question": "What are the purchase details of transactions with amount bigger than 10000?", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT T1.sales_details , T2.date_of_transaction FROM SALES AS T1 JOIN TRANSACTIONS AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000", "question": "What are the sale details and dates of transactions with amount smaller than 3000?", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count < 50", "question": "What are the lot details of lots associated with transactions with share count smaller than 50?", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count > 100 AND T3.transaction_type_code = \"PUR\"", "question": "What are the lot details of lots associated with transactions whose share count is bigger than 100 and whose type code is \"PUR\"?", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT transaction_type_code , avg(amount_of_transaction) FROM TRANSACTIONS GROUP BY transaction_type_code", "question": "Show the average transaction amount for different transaction types.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT transaction_type_code , max(share_count) , min(share_count) FROM TRANSACTIONS GROUP BY transaction_type_code", "question": "Show the maximum and minimum share count of different transaction types.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT investor_id , avg(share_count) FROM TRANSACTIONS GROUP BY investor_id", "question": "Show the average share count of transactions for different investors.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT investor_id , avg(share_count) FROM TRANSACTIONS GROUP BY investor_id ORDER BY avg(share_count)", "question": "Show the average share count of transactions each each investor, ordered by average share count.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT investor_id , avg(amount_of_transaction) FROM TRANSACTIONS GROUP BY investor_id", "question": "Show the average amount of transactions for different investors.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT T2.lot_id , avg(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id", "question": "Show the average amount of transactions for different lots.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT T2.lot_id , avg(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id ORDER BY avg(amount_of_transaction)", "question": "Show the average amount of transactions for different lots, ordered by average amount of transactions.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT investor_id , COUNT(*) FROM TRANSACTIONS WHERE transaction_type_code = \"SALE\" GROUP BY investor_id", "question": "Show the number of transactions with transaction type code \"SALE\" for different investors if it is larger than 0.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT investor_id , COUNT(*) FROM TRANSACTIONS GROUP BY investor_id", "question": "Show the number of transactions for different investors.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) ASC LIMIT 1", "question": "Show the transaction type code that occurs the fewest times.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the transaction type code that occurs the most frequently.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT T1.transaction_type_description FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code GROUP BY T1.transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the description of the transaction type that occurs most frequently.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT T2.investor_id , T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the id and details of the investor that has the largest number of transactions.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT T2.investor_id , T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3", "question": "Show the id and details for the investors who have the top 3 number of transactions.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT T2.investor_id FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id HAVING COUNT(*) >= 2", "question": "Show the ids of the investors who have at least two transactions.", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT T2.investor_id , T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = \"SALE\" GROUP BY T2.investor_id HAVING COUNT(*) >= 2", "question": "Show the ids and details of the investors who have at least two transactions with type code \"SALE\".", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count >= 100 OR amount_of_transaction >= 100", "question": "What are the dates of transactions with at least 100 share count or amount bigger than 100?", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT sales_details FROM sales UNION SELECT purchase_details FROM purchases", "question": "What are the details of all sales and purchases?", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT lot_details FROM Lots EXCEPT SELECT T1.lot_details FROM Lots AS T1 JOIN transactions_lots AS T2 ON T1.lot_id = T2.lot_id", "question": "What are the details of the lots which are not used in any transactions?", "schema": "Investors: investor_id (INTEGER), Investor_details (VARCHAR(255))\nLots: lot_id (INTEGER), investor_id (INTEGER), lot_details (VARCHAR(255))\nRef_Transaction_Types: transaction_type_code (VARCHAR(10)), transaction_type_description (VARCHAR(80))\nTransactions: transaction_id (INTEGER), investor_id (INTEGER), transaction_type_code (VARCHAR(10)), date_of_transaction (DATETIME), amount_of_transaction (DECIMAL(194)), share_count (VARCHAR(40)), other_details (VARCHAR(255))\nSales: sales_transaction_id (INTEGER), sales_details (VARCHAR(255))\nPurchases: purchase_transaction_id (INTEGER), purchase_details (VARCHAR(255))\nTransactions_Lots: transaction_id (INTEGER), lot_id (INTEGER)" }, { "query": "SELECT count(*) FROM HOTELS", "question": "How many available hotels are there in total?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT count(*) FROM HOTELS", "question": "Find the total number of available hotels.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT price_range FROM HOTELS", "question": "What are the price ranges of hotels?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT price_range FROM HOTELS", "question": "Tell me the price ranges for all the hotels.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT DISTINCT Location_Name FROM LOCATIONS", "question": "Show all distinct location names.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT DISTINCT Location_Name FROM LOCATIONS", "question": "What are the distinct location names?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT Name , Other_Details FROM Staff", "question": "Show the names and details of all the staff members.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT Name , Other_Details FROM Staff", "question": "What is the name and detail of each staff member?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT Tourist_Details FROM VISITORS", "question": "Show details of all visitors.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT Tourist_Details FROM VISITORS", "question": "What is the detail of each visitor?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT price_range FROM HOTELS WHERE star_rating_code = \"5\"", "question": "Show the price ranges of hotels with 5 star ratings.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT price_range FROM HOTELS WHERE star_rating_code = \"5\"", "question": "What are the price ranges of five star hotels?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT avg(price_range) FROM HOTELS WHERE star_rating_code = \"5\" AND pets_allowed_yn = 1", "question": "Show the average price range of hotels that have 5 star ratings and allow pets.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT avg(price_range) FROM HOTELS WHERE star_rating_code = \"5\" AND pets_allowed_yn = 1", "question": "What is the average price range of five star hotels that allow pets?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT Address FROM LOCATIONS WHERE Location_Name = \"UK Gallery\"", "question": "What is the address of the location \"UK Gallery\"?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT Address FROM LOCATIONS WHERE Location_Name = \"UK Gallery\"", "question": "Find the address of the location named \"UK Gallery\".", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT Other_Details FROM LOCATIONS WHERE Location_Name = \"UK Gallery\"", "question": "What is the detail of the location UK Gallery?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT Other_Details FROM LOCATIONS WHERE Location_Name = \"UK Gallery\"", "question": "Return the detail of the location named \"UK Gallery\".", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT Location_Name FROM LOCATIONS WHERE Location_Name LIKE \"%film%\"", "question": "Which location names contain the word \"film\"?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT Location_Name FROM LOCATIONS WHERE Location_Name LIKE \"%film%\"", "question": "Find all the locations whose names contain the word \"film\".", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT count(DISTINCT Name) FROM PHOTOS", "question": "How many distinct names are associated with all the photos?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT count(DISTINCT Name) FROM PHOTOS", "question": "Count the number of distinct names associated with the photos.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT DISTINCT Visit_Date FROM VISITS", "question": "What are the distinct visit dates?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT DISTINCT Visit_Date FROM VISITS", "question": "Find all the distinct visit dates.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT Name FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = \"bus\"", "question": "What are the names of the tourist attractions that can be accessed by bus?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT Name FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = \"bus\"", "question": "Which tourist attractions can we get to by bus? Tell me the names of the attractions.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT Name , Opening_Hours FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = \"bus\" OR How_to_Get_There = \"walk\"", "question": "What are the names and opening hours of the tourist attractions that can be accessed by bus or walk?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT Name , Opening_Hours FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = \"bus\" OR How_to_Get_There = \"walk\"", "question": "Find the names and opening hours of the tourist attractions that we get to by bus or walk.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T2.star_rating_description FROM HOTELS AS T1 JOIN Ref_Hotel_Star_Ratings AS T2 ON T1.star_rating_code = T2.star_rating_code WHERE T1.price_range > 10000", "question": "What are the star rating descriptions of the hotels with price above 10000?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T2.star_rating_description FROM HOTELS AS T1 JOIN Ref_Hotel_Star_Ratings AS T2 ON T1.star_rating_code = T2.star_rating_code WHERE T1.price_range > 10000", "question": "Give me the star rating descriptions of the hotels that cost more than 10000.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Museum_Details , T2.Opening_Hours FROM MUSEUMS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Museum_ID = T2.Tourist_Attraction_ID", "question": "What are the details and opening hours of the museums?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Museum_Details , T2.Opening_Hours FROM MUSEUMS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Museum_ID = T2.Tourist_Attraction_ID", "question": "Give me the detail and opening hour for each museum.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T2.Name FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = \"game1\"", "question": "What is the name of the tourist attraction that is associated with the photo \"game1\"?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T2.Name FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = \"game1\"", "question": "Which tourist attraction is associated with the photo \"game1\"? Return its name.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name , T1.Description FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = \"film festival\"", "question": "What are the names and descriptions of the photos taken at the tourist attraction \"film festival\"?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name , T1.Description FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = \"film festival\"", "question": "Find the names and descriptions of the photos taken at the tourist attraction called \"film festival\".", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Royal_Family_Details , T2.How_to_Get_There FROM ROYAL_FAMILY AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Royal_Family_ID = T2.Tourist_Attraction_ID", "question": "What are the details and ways to get to tourist attractions related to royal family?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Royal_Family_Details , T2.How_to_Get_There FROM ROYAL_FAMILY AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Royal_Family_ID = T2.Tourist_Attraction_ID", "question": "Which tourist attractions are related to royal family? Tell me their details and how we can get there.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Shop_Details FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = \"walk\"", "question": "What are the details of the shops that can be accessed by walk?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Shop_Details FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = \"walk\"", "question": "Find the details of the shops that can be reached by walk.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name FROM STAFF AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = \"US museum\"", "question": "What is the name of the staff that is in charge of the attraction named \"US museum\"?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name FROM STAFF AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = \"US museum\"", "question": "Tell me the name of the staff in charge of the attraction called \"US museum\".", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Market_Details FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = \"walk\" OR T2.How_to_Get_There = \"bus\"", "question": "What are the details of the markets that can be accessed by walk or bus?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Market_Details FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = \"walk\" OR T2.How_to_Get_There = \"bus\"", "question": "Find the details of all the markets that are accessible by walk or bus.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T2.Visit_Date , T2.Visit_Details FROM VISITORS AS T1 JOIN VISITS AS T2 ON T1.Tourist_ID = T2.Tourist_ID WHERE T1.Tourist_Details = \"Vincent\"", "question": "What are the visit date and details of the visitor whose detail is 'Vincent'?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T2.Visit_Date , T2.Visit_Details FROM VISITORS AS T1 JOIN VISITS AS T2 ON T1.Tourist_ID = T2.Tourist_ID WHERE T1.Tourist_Details = \"Vincent\"", "question": "Find the visit date and details of the tourist whose detail is 'Vincent'", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID = T3.Tourist_ID WHERE T3.Tourist_Details = \"Vincent\"", "question": "Which tourist attractions does the visitor with detail 'Vincent' visit?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID = T3.Tourist_ID WHERE T3.Tourist_Details = \"Vincent\"", "question": "Show the tourist attractions visited by the tourist whose detail is 'Vincent'.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name , T3.Visit_Date FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = \"Vincent\" OR T2.Tourist_Details = \"Vivian\"", "question": "What are the names of the tourist attractions and the dates when the tourists named Vincent or Vivian visited there?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name , T3.Visit_Date FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = \"Vincent\" OR T2.Tourist_Details = \"Vivian\"", "question": "For each tourist attraction, return its name and the date when the tourists named Vincent or Vivian visited there.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT star_rating_code , avg(price_range) FROM HOTELS GROUP BY star_rating_code", "question": "Show the average price of hotels for each star rating code.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT star_rating_code , avg(price_range) FROM HOTELS GROUP BY star_rating_code", "question": "What is the average price range of hotels for each each star rating code?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT pets_allowed_yn , avg(price_range) FROM HOTELS GROUP BY pets_allowed_yn", "question": "Show the average price of hotels for different pet policy.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT pets_allowed_yn , avg(price_range) FROM HOTELS GROUP BY pets_allowed_yn", "question": "What are the average prices of hotels grouped by their pet policy.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT hotel_id , star_rating_code FROM HOTELS ORDER BY price_range ASC", "question": "Show the id and star rating of each hotel, ordered by its price from low to high.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT hotel_id , star_rating_code FROM HOTELS ORDER BY price_range ASC", "question": "Find the id and star rating of each hotel and sort them in increasing order of price.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3", "question": "Show the details of the top 3 most expensive hotels.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3", "question": "What are the details of the three most expensive hotels?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT other_hotel_details , star_rating_code FROM HOTELS ORDER BY price_range ASC LIMIT 3", "question": "Show the details and star ratings of the 3 least expensive hotels.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT other_hotel_details , star_rating_code FROM HOTELS ORDER BY price_range ASC LIMIT 3", "question": "What are the details and star ratings of the three hotels with the lowest price ranges?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the transportation method most people choose to get to tourist attractions.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1", "question": "Which transportation method is used the most often to get to tourist attractions?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Attraction_Type_Description , T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code = T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1", "question": "Show the description and code of the attraction type most tourist attractions belong to.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Attraction_Type_Description , T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code = T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1", "question": "Which attraction type does the most tourist attractions belong to? Tell me its attraction type description and code.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT How_to_Get_There , COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There", "question": "Show different ways to get to attractions and the number of attractions that can be accessed in the corresponding way.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT How_to_Get_There , COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There", "question": "List all the possible ways to get to attractions, together with the number of attractions accessible by these methods.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name , T2.Tourist_Attraction_ID , COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID", "question": "Show different tourist attractions' names, ids, and the corresponding number of visits.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name , T2.Tourist_Attraction_ID , COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID", "question": "What are the name, id and the corresponding number of visits for each tourist attraction?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name , T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*) >= 2", "question": "Show the names and ids of tourist attractions that are visited at least two times.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name , T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*) >= 2", "question": "Which tourist attractions are visited at least twice? Give me their names and ids.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name , T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*) <= 1", "question": "Show the names and ids of tourist attractions that are visited at most once.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name , T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*) <= 1", "question": "What are the names and ids of the tourist attractions that are visited at most once?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = \"660 Shea Crescent\" OR T2.How_to_Get_There = \"walk\"", "question": "What are the names of tourist attractions that can be reached by walk or is at address 660 Shea Crescent?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = \"660 Shea Crescent\" OR T2.How_to_Get_There = \"walk\"", "question": "Find the names of the tourist attractions that is either accessible by walk or at address 660 Shea Crescent.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'shopping'", "question": "What are the names of the tourist attractions that have parking or shopping as their feature details?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'shopping'", "question": "Find the tourist attractions that have parking or shopping as their feature details. What are the names of the attractions?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = \"254 Ottilie Junction\" OR T2.How_to_Get_There = \"bus\"", "question": "What are the names of tourist attractions that can be reached by bus or is at address 254 Ottilie Junction?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = \"254 Ottilie Junction\" OR T2.How_to_Get_There = \"bus\"", "question": "Find the names of the tourist attractions that is either accessible by bus or at address 254 Ottilie Junction.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = \"Vincent\" INTERSECT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = \"Marcelle\"", "question": "What are the names of the tourist attractions Vincent and Marcelle visit?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = \"Vincent\" INTERSECT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = \"Marcelle\"", "question": "Which tourist attractions do the tourists Vincent and Marcelle visit? Tell me the names of the attractions.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = \"Alison\" EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = \"Rosalind\"", "question": "What are the names of tourist attraction that Alison visited but Rosalind did not visit?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = \"Alison\" EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = \"Rosalind\"", "question": "Find the the names of the tourist attractions that the tourist named Alison visited but Rosalind did not visit.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT count(*) FROM Visitors WHERE Tourist_ID NOT IN ( SELECT Tourist_ID FROM Visits )", "question": "How many tourists did not make any visit?", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT count(*) FROM Visitors WHERE Tourist_ID NOT IN ( SELECT Tourist_ID FROM Visits )", "question": "Count the number of tourists who did not visit any place.", "schema": "Ref_Hotel_Star_Ratings: star_rating_code (CHAR(15)), star_rating_description (VARCHAR(80))\nLocations: Location_ID (INTEGER), Location_Name (VARCHAR(255)), Address (VARCHAR(255)), Other_Details (VARCHAR(255))\nRef_Attraction_Types: Attraction_Type_Code (CHAR(15)), Attraction_Type_Description (VARCHAR(255))\nVisitors: Tourist_ID (INTEGER), Tourist_Details (VARCHAR(255))\nFeatures: Feature_ID (INTEGER), Feature_Details (VARCHAR(255))\nHotels: hotel_id (INTEGER), star_rating_code (CHAR(15)), pets_allowed_yn (CHAR(1)), price_range (REAL), other_hotel_details (VARCHAR(255))\nTourist_Attractions: Tourist_Attraction_ID (INTEGER), Attraction_Type_Code (CHAR(15)), Location_ID (INTEGER), How_to_Get_There (VARCHAR(255)), Name (VARCHAR(255)), Description (VARCHAR(255)), Opening_Hours (VARCHAR(255)), Other_Details (VARCHAR(255))\nStreet_Markets: Market_ID (INTEGER), Market_Details (VARCHAR(255))\nShops: Shop_ID (INTEGER), Shop_Details (VARCHAR(255))\nMuseums: Museum_ID (INTEGER), Museum_Details (VARCHAR(255))\nRoyal_Family: Royal_Family_ID (INTEGER), Royal_Family_Details (VARCHAR(255))\nTheme_Parks: Theme_Park_ID (INTEGER), Theme_Park_Details (VARCHAR(255))\nVisits: Visit_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Tourist_ID (INTEGER), Visit_Date (DATETIME), Visit_Details (VARCHAR(40))\nPhotos: Photo_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(255)), Description (VARCHAR(255)), Filename (VARCHAR(255)), Other_Details (VARCHAR(255))\nStaff: Staff_ID (INTEGER), Tourist_Attraction_ID (INTEGER), Name (VARCHAR(40)), Other_Details (VARCHAR(255))\nTourist_Attraction_Features: Tourist_Attraction_ID (INTEGER), Feature_ID (INTEGER)" }, { "query": "SELECT count(*) FROM Video_games", "question": "How many video games exist?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT count(*) FROM Video_games", "question": "How many video games do you have?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT count(DISTINCT gtype) FROM Video_games", "question": "How many video game types exist?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT count(DISTINCT gtype) FROM Video_games", "question": "What is the count of different game types?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT DISTINCT gtype FROM Video_games", "question": "Show all video game types.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT DISTINCT gtype FROM Video_games", "question": "What are the different types of video games?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gname , gtype FROM Video_games ORDER BY gname", "question": "Show all video games and their types in the order of their names.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gname , gtype FROM Video_games ORDER BY gname", "question": "What are the names of all the video games and their types in alphabetical order?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gname FROM Video_games WHERE gtype = \"Collectible card game\"", "question": "Show all video games with type Collectible card game.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gname FROM Video_games WHERE gtype = \"Collectible card game\"", "question": "What are the names of all video games that are collectible cards?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gtype FROM Video_games WHERE gname = \"Call of Destiny\"", "question": "What is the type of video game Call of Destiny.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gtype FROM Video_games WHERE gname = \"Call of Destiny\"", "question": "What type of game is Call of Destiny?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT count(*) FROM Video_games WHERE gtype = \"Massively multiplayer online game\"", "question": "How many video games have type Massively multiplayer online game?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT count(*) FROM Video_games WHERE gtype = \"Massively multiplayer online game\"", "question": "Count the number of video games with Massively multiplayer online game type .", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gtype , count(*) FROM Video_games GROUP BY gtype", "question": "Show all video game types and the number of video games in each type.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gtype , count(*) FROM Video_games GROUP BY gtype", "question": "What are the types of video games and how many are in each type?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC LIMIT 1", "question": "Which game type has most number of games?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC LIMIT 1", "question": "What type has the most games?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1", "question": "Which game type has least number of games?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1", "question": "What is the type with the fewest games?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Student WHERE city_code = \"CHI\"", "question": "Show ids for all students who live in CHI.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Student WHERE city_code = \"CHI\"", "question": "What are the ids of all students who live in CHI?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Student WHERE Advisor = 1121", "question": "Show ids for all students who have advisor 1121.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Student WHERE Advisor = 1121", "question": "What are the ids of all students who have advisor number 1121?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT Fname FROM Student WHERE Major = 600", "question": "Show first name for all students with major 600.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT Fname FROM Student WHERE Major = 600", "question": "What are the first names for all students who are from the major numbered 600?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT major , avg(age) , min(age) , max(age) FROM Student GROUP BY major", "question": "Show the average, minimum, and maximum age for different majors.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT major , avg(age) , min(age) , max(age) FROM Student GROUP BY major", "question": "What are the average, minimum, and max ages for each of the different majors?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT advisor FROM Student GROUP BY advisor HAVING count(*) >= 2", "question": "Show all advisors who have at least two students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT advisor FROM Student GROUP BY advisor HAVING count(*) >= 2", "question": "What are the advisors", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT count(DISTINCT sportname) FROM Sportsinfo", "question": "How many sports do we have?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT count(DISTINCT sportname) FROM Sportsinfo", "question": "How many different types of sports do we offer?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT count(DISTINCT StuID) FROM Sportsinfo", "question": "How many students play sports?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT count(DISTINCT StuID) FROM Sportsinfo", "question": "How many different students are involved in sports?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'", "question": "List ids for all student who are on scholarship.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'", "question": "What are the ids for all sporty students who are on scholarship?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y'", "question": "Show last names for all student who are on scholarship.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y'", "question": "What are the last names for all scholarship students?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT sum(gamesplayed) FROM Sportsinfo", "question": "How many games are played for all students?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT sum(gamesplayed) FROM Sportsinfo", "question": "What is the total number of games played?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT sum(gamesplayed) FROM Sportsinfo WHERE sportname = \"Football\" AND onscholarship = 'Y'", "question": "How many games are played for all football games by students on scholarship?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT sum(gamesplayed) FROM Sportsinfo WHERE sportname = \"Football\" AND onscholarship = 'Y'", "question": "What is the total number of all football games played by scholarship students?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT sportname , count(*) FROM Sportsinfo GROUP BY sportname", "question": "Show all sport name and the number of students.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT sportname , count(*) FROM Sportsinfo GROUP BY sportname", "question": "How many students play each sport?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID , count(*) , sum(gamesplayed) FROM Sportsinfo GROUP BY StuID", "question": "Show all student IDs with the number of sports and total number of games played", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID , count(*) , sum(gamesplayed) FROM Sportsinfo GROUP BY StuID", "question": "What are the ids of all students along with how many sports and games did they play?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING sum(hoursperweek) > 10", "question": "Show all student IDs with more than total 10 hours per week on all sports played.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING sum(hoursperweek) > 10", "question": "What are the student IDs for everybody who worked for more than 10 hours per week on all sports?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT T2.Fname , T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1", "question": "What is the first name and last name of the student who have most number of sports?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT T2.Fname , T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1", "question": "What is the first and last name of the student who played the most sports?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY count(*) DESC LIMIT 1", "question": "Which sport has most number of students on scholarship?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY count(*) DESC LIMIT 1", "question": "What is the sport with the most scholarship students?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo", "question": "Show student ids who don't have any sports.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo", "question": "What are the ids of all students who don't play sports?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Student WHERE major = 600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'", "question": "Show student ids who are on scholarship and have major 600.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Student WHERE major = 600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'", "question": "What are the student ids for those on scholarship in major number 600?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Student WHERE sex = 'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname = \"Football\"", "question": "Show student ids who are female and play football.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Student WHERE sex = 'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname = \"Football\"", "question": "What are the ids of all female students who play football?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = \"Football\"", "question": "Show all male student ids who don't play football.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = \"Football\"", "question": "What are the ids of all male students who do not play football?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT sum(hoursperweek) , sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = \"David\" AND T2.Lname = \"Shieber\"", "question": "Show total hours per week and number of games played for student David Shieber.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT sum(hoursperweek) , sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = \"David\" AND T2.Lname = \"Shieber\"", "question": "What is the total number of hours per work and number of games played by David Shieber?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT sum(hoursperweek) , sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20", "question": "Show total hours per week and number of games played for students under 20.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT sum(hoursperweek) , sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20", "question": "What is the total number of hours per week and number of games played by students under 20?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT count(DISTINCT StuID) FROM Plays_games", "question": "How many students play video games?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT count(DISTINCT StuID) FROM Plays_games", "question": "How many different students play games?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games", "question": "Show ids of students who don't play video game.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games", "question": "What are the ids of all students who are not video game players?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games", "question": "Show ids of students who play video game and play sports.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games", "question": "What are the ids of all students who played video games and sports?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gameid , sum(hours_played) FROM Plays_games GROUP BY gameid", "question": "Show all game ids and the number of hours played.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gameid , sum(hours_played) FROM Plays_games GROUP BY gameid", "question": "What are ids and total number of hours played for each game?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT Stuid , sum(hours_played) FROM Plays_games GROUP BY Stuid", "question": "Show all student ids and the number of hours played.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT Stuid , sum(hours_played) FROM Plays_games GROUP BY Stuid", "question": "What are the ids of all students and number of hours played?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY sum(hours_played) DESC LIMIT 1", "question": "Show the game name that has most number of hours played.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY sum(hours_played) DESC LIMIT 1", "question": "What is the name of the game that has been played the most?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING sum(hours_played) >= 1000", "question": "Show all game names played by at least 1000 hours.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING sum(hours_played) >= 1000", "question": "What are the names of all the games that have been played for at least 1000 hours?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid JOIN Student AS T3 ON T3.Stuid = T1.Stuid WHERE T3.Lname = \"Smith\" AND T3.Fname = \"Linda\"", "question": "Show all game names played by Linda Smith", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid JOIN Student AS T3 ON T3.Stuid = T1.Stuid WHERE T3.Lname = \"Smith\" AND T3.Fname = \"Linda\"", "question": "What are the names of all games played by Linda Smith?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT T2.lname , T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.SportName = \"Football\" OR T1.SportName = \"Lacrosse\"", "question": "Find the last and first name of students who are playing Football or Lacrosse.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT T2.lname , T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.SportName = \"Football\" OR T1.SportName = \"Lacrosse\"", "question": "What is the first and last name of all students who play Football or Lacrosse?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT fname , age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName = \"Football\" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = \"Lacrosse\")", "question": "Find the first name and age of the students who are playing both Football and Lacrosse.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT fname , age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName = \"Football\" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = \"Lacrosse\")", "question": "What are the first names and ages of all students who are playing both Football and Lacrosse?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT lname , sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = \"Call of Destiny\" INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = \"Works of Widenius\")", "question": "Find the last name and gender of the students who are playing both Call of Destiny and Works of Widenius games.", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT lname , sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = \"Call of Destiny\" INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = \"Works of Widenius\")", "question": "what is the last name and gender of all students who played both Call of Destiny and Works of Widenius?", "schema": "Student: StuID (INTEGER), LName (VARCHAR(12)), Fname (VARCHAR(12)), Age (INTEGER), Sex (VARCHAR(1)), Major (INTEGER), Advisor (INTEGER), city_code (VARCHAR(3))\nVideo_Games: GameID (INTEGER), GName (VARCHAR(40)), GType (VARCHAR(40))\nPlays_Games: StuID (INTEGER), GameID (INTEGER), Hours_Played (INTEGER)\nSportsInfo: StuID (INTEGER), SportName (VARCHAR(32)), HoursPerWeek (INTEGER), GamesPlayed (INTEGER), OnScholarship (VARCHAR(1))" }, { "query": "SELECT customer_name FROM customers", "question": "Find the name of all customers.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT customer_name FROM customers", "question": "What are the names of all the customers?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT count(*) FROM customers", "question": "How many customers are there?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT count(*) FROM customers", "question": "Return the total number of distinct customers.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT avg(order_quantity) FROM order_items", "question": "What is the average amount of items ordered in each order?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT avg(order_quantity) FROM order_items", "question": "Find the average order quantity per order.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT customer_name FROM customers WHERE payment_method = \"Cash\"", "question": "What are the names of customers who use payment method \"Cash\"?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT customer_name FROM customers WHERE payment_method = \"Cash\"", "question": "Which customers use \"Cash\" for payment method? Return the customer names.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20", "question": "Find the \"date became customers\" of the customers whose ID is between 10 and 20.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20", "question": "What are the dates when customers with ids between 10 and 20 became customers?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT payment_method FROM customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1", "question": "Which payment method is used by most customers?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT payment_method FROM customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1", "question": "Find the payment method that is used most frequently.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT customer_name FROM customers WHERE payment_method = (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1)", "question": "What are the names of customers using the most popular payment method?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT customer_name FROM customers WHERE payment_method = (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1)", "question": "Find the name of the customers who use the most frequently used payment method.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT DISTINCT payment_method FROM customers", "question": "What are all the payment methods?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT DISTINCT payment_method FROM customers", "question": "Return all the distinct payment methods used by customers.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT DISTINCT product_details FROM products", "question": "What are the details of all products?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT DISTINCT product_details FROM products", "question": "Return the the details of all products.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT customer_name FROM customers WHERE customer_name LIKE \"%Alex%\"", "question": "Find the name of all customers whose name contains \"Alex\".", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT customer_name FROM customers WHERE customer_name LIKE \"%Alex%\"", "question": "Which customer's name contains \"Alex\"? Find the full name.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT product_details FROM products WHERE product_details LIKE \"%Latte%\" OR product_details LIKE \"%Americano%\"", "question": "Find the detail of products whose detail contains the word \"Latte\" or the word \"Americano\"", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT product_details FROM products WHERE product_details LIKE \"%Latte%\" OR product_details LIKE \"%Americano%\"", "question": "Which product's detail contains the word \"Latte\" or \"Americano\"? Return the full detail.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t3.address_content FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t1.customer_name = \"Maudie Kertzmann\"", "question": "What is the address content of the customer named \"Maudie Kertzmann\"?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t3.address_content FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t1.customer_name = \"Maudie Kertzmann\"", "question": "Return the address content for the customer whose name is \"Maudie Kertzmann\".", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT count(*) FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.city = \"Lake Geovannyton\"", "question": "How many customers are living in city \"Lake Geovannyton\"?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT count(*) FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.city = \"Lake Geovannyton\"", "question": "Find the number of customers who live in the city called Lake Geovannyton.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = \"Colorado\"", "question": "Find the name of customers who are living in Colorado?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = \"Colorado\"", "question": "What are the names of customers who live in Colorado state?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT city FROM addresses WHERE city NOT IN ( SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id)", "question": "Find the list of cities that no customer is living in.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT city FROM addresses WHERE city NOT IN ( SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id)", "question": "What are the cities no customers live in?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id GROUP BY t3.city ORDER BY count(*) DESC LIMIT 1", "question": "Which city has the most customers living in?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id GROUP BY t3.city ORDER BY count(*) DESC LIMIT 1", "question": "Find the city where the most customers live.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT DISTINCT city FROM addresses", "question": "Retrieve the list of all cities.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT DISTINCT city FROM addresses", "question": "List all the distinct cities", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT city FROM addresses WHERE zip_postcode = 255", "question": "Find the city with post code 255.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT city FROM addresses WHERE zip_postcode = 255", "question": "Which city is post code 255 located in?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT state_province_county , country FROM addresses WHERE zip_postcode LIKE \"4%\"", "question": "Find the state and country of all cities with post code starting with 4.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT state_province_county , country FROM addresses WHERE zip_postcode LIKE \"4%\"", "question": "What are the state and country of all the cities that have post codes starting with 4.\\", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT country FROM addresses GROUP BY country HAVING count(address_id) > 4", "question": "List the countries having more than 4 addresses listed.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT country FROM addresses GROUP BY country HAVING count(address_id) > 4", "question": "For which countries are there more than four distinct addresses listed?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT channel_code FROM customer_contact_channels GROUP BY channel_code HAVING count(customer_id) < 5", "question": "List all the contact channel codes that were used less than 5 times.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT channel_code FROM customer_contact_channels GROUP BY channel_code HAVING count(customer_id) < 5", "question": "Which contact channel codes were used less than 5 times?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = \"Tillman Ernser\"", "question": "Which contact channel has been used by the customer with name \"Tillman Ernser\"?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = \"Tillman Ernser\"", "question": "Find the contact channel code that was used by the customer named \"Tillman Ernser\".", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT max(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = \"Tillman Ernser\"", "question": "What is the \"active to date\" of the latest contact channel used by \"Tillman Ernser\"?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT max(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = \"Tillman Ernser\"", "question": "Return the the \"active to date\" of the latest contact channel used by the customer named \"Tillman Ernser\".", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT avg(active_to_date - active_from_date) FROM customer_contact_channels", "question": "What is the average time span of contact channels in the database?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT avg(active_to_date - active_from_date) FROM customer_contact_channels", "question": "Compute the average active time span of contact channels.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT channel_code , contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)", "question": "What is the channel code and contact number of the customer contact channel that was active for the longest time?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT channel_code , contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)", "question": "Return the channel code and contact number of the customer contact channel whose active duration was the longest.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.customer_name , t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email'", "question": "Find the name and active date of the customer that use email as the contact channel.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.customer_name , t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email'", "question": "What are the name and active date of the customers whose contact channel code is email?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = ( SELECT max(order_quantity) FROM order_items)", "question": "What is the name of the customer that made the order with the largest quantity?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = ( SELECT max(order_quantity) FROM order_items)", "question": "Find the name of the customer who made the order of the largest amount of goods.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY sum(t3.order_quantity) DESC LIMIT 1", "question": "What is the name of the customer that has purchased the most items?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY sum(t3.order_quantity) DESC LIMIT 1", "question": "Give me the name of the customer who ordered the most items in total.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY sum(t3.order_quantity) LIMIT 1", "question": "What is the payment method of the customer that has purchased the least quantity of items?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY sum(t3.order_quantity) LIMIT 1", "question": "Tell me the payment method used by the customer who ordered the least amount of goods in total.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT count(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = \"Rodrick Heaney\"", "question": "How many types of products have Rodrick Heaney bought in total?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT count(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = \"Rodrick Heaney\"", "question": "Find the number of distinct products Rodrick Heaney has bought so far.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT sum(t3.order_quantity) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = \"Rodrick Heaney\"", "question": "What is the total quantity of products purchased by \"Rodrick Heaney\"?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT sum(t3.order_quantity) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = \"Rodrick Heaney\"", "question": "Tell me the total quantity of products bought by the customer called \"Rodrick Heaney\".", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT count(DISTINCT customer_id) FROM customer_orders WHERE order_status = \"Cancelled\"", "question": "How many customers have at least one order with status \"Cancelled\"?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT count(DISTINCT customer_id) FROM customer_orders WHERE order_status = \"Cancelled\"", "question": "Return the number of customers who have at least one order with \"Cancelled\" status.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT count(*) FROM customer_orders WHERE order_details = \"Second time\"", "question": "How many orders have detail \"Second time\"?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT count(*) FROM customer_orders WHERE order_details = \"Second time\"", "question": "Tell me the number of orders with \"Second time\" as order detail.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.customer_name , t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = \"Delivered\"", "question": "Find the customer name and date of the orders that have the status \"Delivered\".", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.customer_name , t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = \"Delivered\"", "question": "What are the customer name and date of the orders whose status is \"Delivered\".", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT sum(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = \"Cancelled\"", "question": "What is the total number of products that are in orders with status \"Cancelled\"?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT sum(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = \"Cancelled\"", "question": "Find the total quantity of products associated with the orders in the \"Cancelled\" status.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT sum(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < \"2018-03-17 07:13:53\"", "question": "Find the total amount of products ordered before 2018-03-17 07:13:53.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT sum(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < \"2018-03-17 07:13:53\"", "question": "What is the total amount of products purchased before 2018-03-17 07:13:53?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1", "question": "Who made the latest order?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1", "question": "Find the name of the customer who made an order most recently.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY count(*) DESC LIMIT 1", "question": "Which product has been ordered most number of times?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY count(*) DESC LIMIT 1", "question": "What is the most frequently ordered product? Tell me the detail of the product", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t2.product_details , t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY sum(t1.order_quantity) LIMIT 1", "question": "Find the name and ID of the product whose total order quantity is the largest.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t2.product_details , t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY sum(t1.order_quantity) LIMIT 1", "question": "What are the name and ID of the product bought the most.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT address_content FROM addresses WHERE city = \"East Julianaside\" AND state_province_county = \"Texas\" UNION SELECT address_content FROM addresses WHERE city = \"Gleasonmouth\" AND state_province_county = \"Arizona\"", "question": "Find all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT address_content FROM addresses WHERE city = \"East Julianaside\" AND state_province_county = \"Texas\" UNION SELECT address_content FROM addresses WHERE city = \"Gleasonmouth\" AND state_province_county = \"Arizona\"", "question": "What are all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT customer_name FROM customers WHERE payment_method != 'Cash'", "question": "Find the name of customers who did not pay with Cash.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT customer_name FROM customers WHERE payment_method != 'Cash'", "question": "What is the name of customers who do not use Cash as payment method.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte'", "question": "Find the names of customers who never ordered product Latte.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte'", "question": "What are names of customers who never ordered product Latte.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id", "question": "Find the names of customers who never placed an order.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id", "question": "What are the names of customers who never made an order.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Americano'", "question": "Find the names of customers who ordered both products Latte and Americano.", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Americano'", "question": "What are the names of customers who have purchased both products Latte and Americano?", "schema": "Addresses: address_id (INTEGER), address_content (VARCHAR(80)), city (VARCHAR(50)), zip_postcode (VARCHAR(20)), state_province_county (VARCHAR(50)), country (VARCHAR(50)), other_address_details (VARCHAR(255))\nProducts: product_id (INTEGER), product_details (VARCHAR(255))\nCustomers: customer_id (INTEGER), payment_method (VARCHAR(15)), customer_name (VARCHAR(80)), date_became_customer (DATETIME), other_customer_details (VARCHAR(255))\nCustomer_Addresses: customer_id (INTEGER), address_id (INTEGER), date_address_from (DATETIME), address_type (VARCHAR(15)), date_address_to (DATETIME)\nCustomer_Contact_Channels: customer_id (INTEGER), channel_code (VARCHAR(15)), active_from_date (DATETIME), active_to_date (DATETIME), contact_number (VARCHAR(50))\nCustomer_Orders: order_id (INTEGER), customer_id (INTEGER), order_status (VARCHAR(15)), order_date (DATETIME), order_details (VARCHAR(255))\nOrder_Items: order_id (INTEGER), product_id (INTEGER), order_quantity (VARCHAR(15))" }, { "query": "SELECT count(*) FROM artist", "question": "How many artists are there?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT count(*) FROM artist", "question": "Count the number of artists.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Age FROM artist", "question": "List the age of all music artists.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Age FROM artist", "question": "What are the ages of all music artists?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT avg(Age) FROM artist", "question": "What is the average age of all artists?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT avg(Age) FROM artist", "question": "Return the average age across all artists.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Famous_Title FROM artist WHERE Artist = \"Triumfall\"", "question": "What are the famous titles of the artist \"Triumfall\"?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Famous_Title FROM artist WHERE Artist = \"Triumfall\"", "question": "Return the famous titles of the artist called \"Triumfall\".", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT distinct(Famous_Release_date) FROM artist", "question": "What are the distinct Famous release dates?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT distinct(Famous_Release_date) FROM artist", "question": "Give the distinct famous release dates for all artists.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Date_of_ceremony , RESULT FROM music_festival", "question": "Return the dates of ceremony and the results of all music festivals", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Date_of_ceremony , RESULT FROM music_festival", "question": "What are the dates of ceremony and results for each music festival?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Category FROM music_festival WHERE RESULT = \"Awarded\"", "question": "What are the category of music festivals with result \"Awarded\"?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Category FROM music_festival WHERE RESULT = \"Awarded\"", "question": "Return the categories of music festivals that have the result \"Awarded\".", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT max(Weeks_on_Top) , min(Weeks_on_Top) FROM volume", "question": "What are the maximum and minimum week on top of all volumes?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT max(Weeks_on_Top) , min(Weeks_on_Top) FROM volume", "question": "Give the maximum and minimum weeks on top across all volumes.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Song FROM volume WHERE Weeks_on_Top > 1", "question": "What are the songs in volumes with more than 1 week on top?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Song FROM volume WHERE Weeks_on_Top > 1", "question": "Give the songs included in volumes that have more than 1 week on top.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Song FROM volume ORDER BY Song", "question": "Please list all songs in volumes in ascending alphabetical order.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Song FROM volume ORDER BY Song", "question": "What are the the songs in volumes, listed in ascending order?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT COUNT(DISTINCT Artist_ID) FROM volume", "question": "How many distinct artists do the volumes associate to?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT COUNT(DISTINCT Artist_ID) FROM volume", "question": "Count the number of distinct artists who have volumes.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2", "question": "Please show the date of ceremony of the volumes that last more than 2 weeks on top.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2", "question": "What are the dates of ceremony at music festivals corresponding to volumes that lasted more than 2 weeks on top?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1.Result = \"Nominated\"", "question": "Please show the songs that have result \"nominated\" at music festivals.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1.Result = \"Nominated\"", "question": "What are the songs in volumes that have resulted in a nomination at music festivals?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = \"Gorgoroth\"", "question": "What are the issue dates of volumes associated with the artist \"Gorgoroth\"?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = \"Gorgoroth\"", "question": "Return the issue dates of volumes that are by the artist named Gorgoroth.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age >= 32", "question": "What are the songs in volumes associated with the artist aged 32 or older?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age >= 32", "question": "Return names of songs in volumes that are by artists that are at least 32 years old.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT avg(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 25", "question": "What is the average weeks on top of volumes associated with the artist aged 25 or younger?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT avg(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 25", "question": "Return the average number of weeks on top for volumes by artists that are at most 25 years old.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2", "question": "What are the famous title of the artists associated with volumes with more than 2 weeks on top?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2", "question": "Return the famous titles for artists that have volumes that lasted more than 2 weeks on top.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Famous_Title , Age FROM artist ORDER BY Age DESC", "question": "Please list the age and famous title of artists in descending order of age.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Famous_Title , Age FROM artist ORDER BY Age DESC", "question": "What are the famous titles and ages of each artist, listed in descending order by age?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1", "question": "What is the famous release date of the artist with the oldest age?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1", "question": "Return the famous release date for the oldest artist.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Category , COUNT(*) FROM music_festival GROUP BY Category", "question": "Please show the categories of the music festivals and the count.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Category , COUNT(*) FROM music_festival GROUP BY Category", "question": "Return the number of music festivals of each category.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1", "question": "What is the most common result of the music festival?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1", "question": "Return the result that is most frequent at music festivals.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*) > 1", "question": "Please show the categories of the music festivals with count more than 1.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*) > 1", "question": "What are the categories of music festivals for which there have been more than 1 music festival?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1", "question": "What is the song in the volume with the maximum weeks on top?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1", "question": "Return the song in the volume that has spent the most weeks on top?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Famous_Title FROM artist WHERE Artist_ID NOT IN(SELECT Artist_ID FROM volume)", "question": "Find the famous titles of artists that do not have any volume.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Famous_Title FROM artist WHERE Artist_ID NOT IN(SELECT Artist_ID FROM volume)", "question": "What are the famous titles of artists who do not have any volumes?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2", "question": "Show the famous titles of the artists with both volumes that lasted more than 2 weeks on top and volumes that lasted less than 2 weeks on top.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2", "question": "What are the famous titles of artists who have not only had volumes that spent more than 2 weeks on top but also volumes that spent less than 2 weeks on top?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Date_of_ceremony FROM music_festival WHERE Category = \"Best Song\" AND RESULT = \"Awarded\"", "question": "What are the date of ceremony of music festivals with category \"Best Song\" and result \"Awarded\"?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Date_of_ceremony FROM music_festival WHERE Category = \"Best Song\" AND RESULT = \"Awarded\"", "question": "Return the dates of ceremony corresponding to music festivals that had the category \"Best Song\" and result \"Awarded\".", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC LIMIT 1", "question": "What is the issue date of the volume with the minimum weeks on top?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC LIMIT 1", "question": "Return the issue date of the volume that has spent the fewest weeks on top.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT COUNT(DISTINCT Artist_ID) FROM volume", "question": "How many distinct artists have volumes?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT COUNT(DISTINCT Artist_ID) FROM volume", "question": "Count the number of artists who have had volumes.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT RESULT , COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC", "question": "Please show the results of music festivals and the number of music festivals that have had each, ordered by this count.", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT RESULT , COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC", "question": "How many music festivals have had each kind of result, ordered descending by count?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 23", "question": "What are the issue dates of volumes associated with the artist aged 23 or younger?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 23", "question": "Return the issue dates of volumes by artists who are at most 23 years old?", "schema": "artist: Artist_ID (INT), Artist (TEXT), Age (INT), Famous_Title (TEXT), Famous_Release_date (TEXT)\nvolume: Volume_ID (INT), Volume_Issue (TEXT), Issue_Date (TEXT), Weeks_on_Top (REAL), Song (TEXT), Artist_ID (INT)\nmusic_festival: ID (INT), Music_Festival (TEXT), Date_of_ceremony (TEXT), Category (TEXT), Volume (INT), Result (TEXT)" }, { "query": "SELECT count(*) FROM roller_coaster", "question": "How many roller coasters are there?", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT Name FROM roller_coaster ORDER BY LENGTH ASC", "question": "List the names of roller coasters by ascending order of length.", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT LENGTH , Height FROM roller_coaster", "question": "What are the lengths and heights of roller coasters?", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT Name FROM country WHERE Languages != \"German\"", "question": "List the names of countries whose language is not \"German\".", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100", "question": "Show the statuses of roller coasters longer than 3300 or higher than 100.", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1", "question": "What are the speeds of the longest roller coaster?", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT avg(Speed) FROM roller_coaster", "question": "What is the average speed of roller coasters?", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT Status , COUNT(*) FROM roller_coaster GROUP BY Status", "question": "Show the different statuses and the numbers of roller coasters for each status.", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1", "question": "Please show the most common status of roller coasters.", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2", "question": "List the status shared by more than two roller coaster.", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1", "question": "Show the park of the roller coaster with the highest speed.", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT T2.Name , T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID", "question": "Show the names of roller coasters and names of country they are in.", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name HAVING COUNT(*) > 1", "question": "Show the names of countries that have more than one roller coaster.", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT T1.Name , T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID ORDER BY T2.Height DESC LIMIT 1", "question": "Show the name and population of the country that has the highest roller coaster.", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT T1.Name , avg(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name", "question": "Show the names of countries and the average speed of roller coasters from each country.", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH > 3000 )", "question": "How many countries do not have an roller coaster longer than 3000?", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT T1.name , T1.area , T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID WHERE T2.speed > 60 INTERSECT SELECT T1.name , T1.area , T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID WHERE T2.speed < 55", "question": "What are the country names, area and population which has both roller coasters with speed higher", "schema": "roller_coaster: Roller_Coaster_ID (INT), Name (TEXT), Park (TEXT), Country_ID (INT), Length (REAL), Height (REAL), Speed (TEXT), Opened (TEXT), Status (TEXT)\ncountry: Country_ID (INT), Name (TEXT), Population (INT), Area (INT), Languages (TEXT)" }, { "query": "SELECT count(DISTINCT rank) FROM captain", "question": "How many different captain ranks are there?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT count(DISTINCT rank) FROM captain", "question": "Count the number of different ranks of captain.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT count(*) , rank FROM captain GROUP BY rank", "question": "How many captains are in each rank?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT count(*) , rank FROM captain GROUP BY rank", "question": "Count the number of captains that have each rank.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT count(*) , rank FROM captain WHERE age < 50 GROUP BY rank", "question": "How many captains with younger than 50 are in each rank?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT count(*) , rank FROM captain WHERE age < 50 GROUP BY rank", "question": "Count the number of captains younger than 50 of each rank.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT name FROM captain ORDER BY age DESC", "question": "Sort all captain names by their ages from old to young.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT name FROM captain ORDER BY age DESC", "question": "What are the names of captains, sorted by age descending?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT name , CLASS , rank FROM captain", "question": "Find the name, class and rank of all captains.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT name , CLASS , rank FROM captain", "question": "What are the names, classes, and ranks of all captains?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1", "question": "Which rank is the most common among captains?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1", "question": "Return the rank for which there are the fewest captains.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*) > 2", "question": "Which classes have more than two captains?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*) > 2", "question": "Give the classes that have more than two captains.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'", "question": "Find the name of captains whose rank are either Midshipman or Lieutenant.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'", "question": "What are the names of captains that have either the rank Midshipman or Lieutenant?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT avg(age) , min(age) , CLASS FROM captain GROUP BY CLASS", "question": "What are the average and minimum age of captains in different class?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT avg(age) , min(age) , CLASS FROM captain GROUP BY CLASS", "question": "Return the average and minimum age of captains in each class.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'", "question": "Find the captain rank that has some captains in both Cutter and Armed schooner classes.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'", "question": "What are the ranks of captains that are both in the Cutter and Armed schooner classes?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'", "question": "Find the captain rank that has no captain in Third-rate ship of the line class.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'", "question": "What are the ranks of captains that have no captain that are in the Third-rate ship of the line class?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT name FROM captain ORDER BY age LIMIT 1", "question": "What is the name of the youngest captain?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT name FROM captain ORDER BY age LIMIT 1", "question": "Return the name of the youngest captain.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT count(*) FROM ship", "question": "how many ships are there?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT count(*) FROM ship", "question": "Count the number of ships.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT name , TYPE , flag FROM ship ORDER BY built_year DESC LIMIT 1", "question": "Find the name, type, and flag of the ship that is built in the most recent year.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT name , TYPE , flag FROM ship ORDER BY built_year DESC LIMIT 1", "question": "What is the name, type, and flag of the ship that was built in the most recent year?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT count(*) , flag FROM ship GROUP BY flag", "question": "Group by ships by flag, and return number of ships that have each flag.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT count(*) , flag FROM ship GROUP BY flag", "question": "What are the different ship flags, and how many ships have each?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1", "question": "Which flag is most widely used among all ships?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1", "question": "Return the flag that is most common among all ships.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT name FROM ship ORDER BY built_year , CLASS", "question": "List all ship names in the order of built year and class.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT name FROM ship ORDER BY built_year , CLASS", "question": "What are the names of ships, ordered by year they were built and their class?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'", "question": "Find the ship type that are used by both ships with Panama and Malta flags.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'", "question": "What types of ships have both ships that have Panama Flags and Malta flags?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT built_year FROM ship GROUP BY built_year ORDER BY count(*) DESC LIMIT 1", "question": "In which year were most of ships built?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT built_year FROM ship GROUP BY built_year ORDER BY count(*) DESC LIMIT 1", "question": "What is the year in which most ships were built?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING count(*) > 1", "question": "Find the name of the ships that have more than one captain.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING count(*) > 1", "question": "What are the names of ships that have more than one captain?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT name , CLASS FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain)", "question": "what are the names and classes of the ships that do not have any captain yet?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT name , CLASS FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain)", "question": "Return the names and classes of ships that do not have a captain?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1", "question": "Find the name of the ship that is steered by the youngest captain.", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" }, { "query": "SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1", "question": "What is the name of the ship that is commanded by the youngest captain?", "schema": "captain: Captain_ID (INT), Name (TEXT), Ship_ID (INT), age (TEXT), Class (TEXT), Rank (TEXT)\nShip: Ship_ID (INT), Name (TEXT), Type (TEXT), Built_Year (REAL), Class (TEXT), Flag (TEXT)" } ]