1sf/bird-sql-train-with-schema huggingface dataset:
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: Calculate the average weight in pounds of all players drafted by Arizona Coyotes.
Evidence: average weight in pounds = AVG(weight_in_lbs); weight in pounds refers to weight_in_lbs; players refers to PlayerName; drafted by Arizona Coyotes refers to overallby = 'Arizona Coyotes';
SQL: SELECT CAST(SUM(T1.weight_in_lbs) AS REAL) / COUNT(T2.ELITEID) FROM weight_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.weight_id = T2.weight WHERE T2.overallby = 'Arizona Coyotes'
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: Calculate the average height in centimeter of all players who played in Acadie-Bathurst Titan during regular season.
Evidence: average height in centimeter = AVG(height_in_cm); height in centimeter refers to height_in_cm; players refers to PlayerName; Acadie-Bathurst Titan refers to TEAM = 'Acadie-Bathurst Titan'; regular season refers to GAMETYPE = 'Regular Season';
SQL: SELECT CAST(SUM(T1.height_in_cm) AS REAL) / COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height INNER JOIN SeasonStatus AS T3 ON T2.ELITEID = T3.ELITEID WHERE T3.TEAM = 'Acadie-Bathurst Titan' AND T3.GAMETYPE = 'Regular Season'
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: How many games did Per Mars play in the 1997-1998 season?
Evidence: 1997-1998 season refers to SEASON = '1997-1998';
SQL: SELECT T2.GP FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.SEASON = '1997-1998' AND T1.PlayerName = 'Pavel Patera'
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: How heavy is Matthias Trattnig in kilograms?
Evidence: how heavy in kilograms refers to weight_in_kg;
SQL: SELECT T2.weight_in_kg FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.PlayerName = 'Pavel Patera'
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: List the name of players who have a height over 5'9.
Evidence: names of players refers to PlayerName; height over 5'9 refers to height_in_inch > '5''9"';
SQL: SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T2.height_in_inch > '5''9"'
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: What team did Niklas Eckerblom play in the 1997-1998 season?
Evidence: 1997-1998 season refers to SEASON = '1997-1998';
SQL: SELECT T2.TEAM FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.SEASON = '1997-1998' AND T1.PlayerName = 'Niko Kapanen'
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: Which team has the most Swedish?
Evidence: Swedish refers to nation = 'Sweden'; team with the most Swedish refers to MAX(TEAM WHERE nation = 'Sweden');
SQL: SELECT T.TEAM FROM ( SELECT T2.TEAM, COUNT(DISTINCT T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.nation = 'Sweden' GROUP BY T2.TEAM ORDER BY COUNT(DISTINCT T1.ELITEID) DESC LIMIT 1 ) AS T
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: How many playoffs did Per Mars participate in?
Evidence: playoffs refers to GAMETYPE = 'Playoffs';
SQL: SELECT SUM(T2.GP) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.PlayerName = 'Per Mars' AND T2.GAMETYPE = 'Playoffs'
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: Name the player who had the most goals for team Rimouski Oceanic in playoff.
Evidence: name of the player refers to PlayerName; most goals refers to MAX(G); team Rimouski Oceanic refers to TEAM = 'Rimouski Oceanic'; playoff refers to GAMETYPE = 'Playoffs';
SQL: SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.TEAM = 'Rimouski Oceanic' AND T2.GAMETYPE = 'Playoffs' ORDER BY T2.G DESC LIMIT 1
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: Which country do most players of team Plymouth Whalers come from?
Evidence: country and nation are synonyms; country where most players come from refers to MAX(COUNT(nation WHERE TEAM = 'Plymouth Whalers')); players refers to PlayerName; team Plymouth Whalers refers to TEAM = 'Plymouth Whalers';
SQL: SELECT T.nation FROM ( SELECT T1.nation, COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.TEAM = 'Plymouth Whalers' GROUP BY T1.nation ORDER BY COUNT(T1.ELITEID) DESC LIMIT 1 ) AS T
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: Who had the most assists of team Plymouth Whalers in the 1999-2000 season?
Evidence: who refers to PlayerName; most assists refers to MAX(A); team Plymouth Whalers refers to TEAM = 'Plymouth Whalers'; 1999-2000 season refers to SEASON = '1999-2000';
SQL: SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.TEAM = 'Plymouth Whalers' AND T2.SEASON = '1999-2000' ORDER BY T2.A DESC LIMIT 1
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: Indicate the height of all players from team Oshawa Generals in inches.
Evidence: height in inches refers to height_in_inch; players refers to PlayerName; team Oshawa Generals refers to TEAM = 'Oshawa Generals';
SQL: SELECT T3.height_in_inch FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN height_info AS T3 ON T1.height = T3.height_id WHERE T2.TEAM = 'Oshawa Generals'
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: Who is the oldest player that participated in OHL league in the 1997 - 2000 season?
Evidence: oldest player refers to MIN(birthdate); OHL league refers to LEAGUE = 'OHL'; 1997-2000 season refers to SEASON = '1997-2000';
SQL: SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.LEAGUE = 'OHL' AND T2.SEASON = '1999-2000' ORDER BY T1.birthdate LIMIT 1
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: Who is the tallest player in team USA U20?
Evidence: tallest refers to MAX(height_in_cm); 
player refers to PlayerName; team USA U20 refers to TEAM = 'USA U20';
SQL: SELECT T.PlayerName FROM ( SELECT T1.PlayerName, T3.height_in_cm FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN height_info AS T3 ON T1.height = T3.height_id WHERE T2.TEAM = 'USA U20' ORDER BY T3.height_in_cm DESC ) AS T WHERE T.height_in_cm = ( SELECT MAX(T3.height_in_cm) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN height_info AS T3 ON T1.height = T3.height_id WHERE T2.TEAM = 'USA U20' )
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: What is the percentage of Swedish players in playoffs games in the 1997 - 2000 season?
Evidence: percentage = MULTIPLY(DIVIDE(SUM(nation = 'Sweden'), COUNT(ELITEID) WHERE SEASON = '1997-2000'), 100); Swedish refers to nation = 'Sweden'; players refers to PlayerName; playoffs games refers to GAMETYPE = 'Playoffs'; 1997-2000 season refers to 3 consecutive SEASONs : '1997-1998', '1998-1999', '1999-2000';
SQL: SELECT DISTINCT CAST(COUNT(CASE WHEN T1.nation = 'Sweden' THEN T1.ELITEID ELSE NULL END) OVER (PARTITION BY T2.SEASON) AS REAL) * 100 / COUNT(T1.ELITEID) OVER (PARTITION BY T2.SEASON) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.SEASON IN ('1997-1998', '1998-1999', '1999-2000')
Database: ice_hockey_draft
Tables: height_info, weight_info, PlayerInfo, SeasonStatus
Columns (table index, column name): -1, *, 0, height_id, 0, height_in_cm, 0, height_in_inch, 1, weight_id, 1, weight_in_kg, 1, weight_in_lbs, 2, ELITEID, 2, PlayerName, 2, birthdate, 2, birthyear, 2, birthmonth, 2, birthday, 2, birthplace, 2, nation, 2, height, 2, weight, 2, position_info, 2, shoots, 2, draftyear, 2, draftround, 2, overall, 2, overallby, 2, CSS_rank, 2, sum_7yr_GP, 2, sum_7yr_TOI, 2, GP_greater_than_0, 3, ELITEID, 3, SEASON, 3, TEAM, 3, LEAGUE, 3, GAMETYPE, 3, GP, 3, G, 3, A, 3, P, 3, PIM, 3, PLUSMINUS
Question: Calculate the percentage of penalty minutes of Swedish players in OHL league among all players.
Evidence: percentage = MULTIPLY(DIVIDE(SUM(PIM WHERE nation = 'Sweden'), COUNT(ELITEID) WHERE LEAGUE = 'OHL'), 100); Swedish refers to nation = 'Sweden'; players refers to PlayerName; OHL league refers to LEAGUE = 'OHL';
SQL: SELECT CAST(COUNT(CASE WHEN T1.nation = 'Sweden' THEN T2.PIM ELSE NULL END) AS REAL) * 100 / COUNT(*) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.LEAGUE = 'OHL'
Database: image_and_language
Tables: ATT_CLASSES, OBJ_CLASSES, IMG_OBJ, IMG_OBJ_ATT, PRED_CLASSES, IMG_REL
Columns (table index, column name): -1, *, 0, ATT_CLASS_ID, 0, ATT_CLASS, 1, OBJ_CLASS_ID, 1, OBJ_CLASS, 2, IMG_ID, 2, OBJ_SAMPLE_ID, 2, OBJ_CLASS_ID, 2, X, 2, Y, 2, W, 2, H, 3, IMG_ID, 3, ATT_CLASS_ID, 3, OBJ_SAMPLE_ID, 4, PRED_CLASS_ID, 4, PRED_CLASS, 5, IMG_ID, 5, PRED_CLASS_ID, 5, OBJ1_SAMPLE_ID, 5, OBJ2_SAMPLE_ID
Question: How many object samples are there in image no.1?
Evidence: object samples refers to OBJ_SAMPLE_ID; image no.1 refers to IMG_ID = 1
SQL: SELECT COUNT(OBJ_SAMPLE_ID) FROM IMG_OBJ WHERE IMG_ID = 1
Database: image_and_language
Tables: ATT_CLASSES, OBJ_CLASSES, IMG_OBJ, IMG_OBJ_ATT, PRED_CLASSES, IMG_REL
Columns (table index, column name): -1, *, 0, ATT_CLASS_ID, 0, ATT_CLASS, 1, OBJ_CLASS_ID, 1, OBJ_CLASS, 2, IMG_ID, 2, OBJ_SAMPLE_ID, 2, OBJ_CLASS_ID, 2, X, 2, Y, 2, W, 2, H, 3, IMG_ID, 3, ATT_CLASS_ID, 3, OBJ_SAMPLE_ID, 4, PRED_CLASS_ID, 4, PRED_CLASS, 5, IMG_ID, 5, PRED_CLASS_ID, 5, OBJ1_SAMPLE_ID, 5, OBJ2_SAMPLE_ID
Question: How many images have over 20 object samples?
Evidence: over 20 object samples refers to COUNT(OBJ_SAMPLE_ID) > 20
SQL: SELECT COUNT(T1.IMG_ID) FROM ( SELECT IMG_ID FROM IMG_OBJ GROUP BY IMG_ID HAVING COUNT(OBJ_SAMPLE_ID) > 20 ) T1
Database: image_and_language
Tables: ATT_CLASSES, OBJ_CLASSES, IMG_OBJ, IMG_OBJ_ATT, PRED_CLASSES, IMG_REL
Columns (table index, column name): -1, *, 0, ATT_CLASS_ID, 0, ATT_CLASS, 1, OBJ_CLASS_ID, 1, OBJ_CLASS, 2, IMG_ID, 2, OBJ_SAMPLE_ID, 2, OBJ_CLASS_ID, 2, X, 2, Y, 2, W, 2, H, 3, IMG_ID, 3, ATT_CLASS_ID, 3, OBJ_SAMPLE_ID, 4, PRED_CLASS_ID, 4, PRED_CLASS, 5, IMG_ID, 5, PRED_CLASS_ID, 5, OBJ1_SAMPLE_ID, 5, OBJ2_SAMPLE_ID
Question: What is the ID of the image with the most number of object samples?
Evidence: ID of the image refers to IMG_ID; most number of object samples refers to max(count(OBJ_SAMPLE_ID))
SQL: SELECT IMG_ID FROM IMG_OBJ GROUP BY IMG_ID ORDER BY COUNT(OBJ_SAMPLE_ID) DESC LIMIT 1
Database: image_and_language
Tables: ATT_CLASSES, OBJ_CLASSES, IMG_OBJ, IMG_OBJ_ATT, PRED_CLASSES, IMG_REL
Columns (table index, column name): -1, *, 0, ATT_CLASS_ID, 0, ATT_CLASS, 1, OBJ_CLASS_ID, 1, OBJ_CLASS, 2, IMG_ID, 2, OBJ_SAMPLE_ID, 2, OBJ_CLASS_ID, 2, X, 2, Y, 2, W, 2, H, 3, IMG_ID, 3, ATT_CLASS_ID, 3, OBJ_SAMPLE_ID, 4, PRED_CLASS_ID, 4, PRED_CLASS, 5, IMG_ID, 5, PRED_CLASS_ID, 5, OBJ1_SAMPLE_ID, 5, OBJ2_SAMPLE_ID
Question: Please list the IDs of the object samples in class no. 297 in image no.1.
Evidence: IDs of the object samples refers to OBJ_SAMPLE_ID; class no. 297 in image no.1 refers to IMG_ID = 1 and OBJ_CLASS_ID = 297
SQL: SELECT OBJ_SAMPLE_ID FROM IMG_OBJ WHERE IMG_ID = 1 AND OBJ_CLASS_ID = 297
Database: image_and_language
Tables: ATT_CLASSES, OBJ_CLASSES, IMG_OBJ, IMG_OBJ_ATT, PRED_CLASSES, IMG_REL
Columns (table index, column name): -1, *, 0, ATT_CLASS_ID, 0, ATT_CLASS, 1, OBJ_CLASS_ID, 1, OBJ_CLASS, 2, IMG_ID, 2, OBJ_SAMPLE_ID, 2, OBJ_CLASS_ID, 2, X, 2, Y, 2, W, 2, H, 3, IMG_ID, 3, ATT_CLASS_ID, 3, OBJ_SAMPLE_ID, 4, PRED_CLASS_ID, 4, PRED_CLASS, 5, IMG_ID, 5, PRED_CLASS_ID, 5, OBJ1_SAMPLE_ID, 5, OBJ2_SAMPLE_ID
Question: How many self-relations are there between the object samples in image no.5?
Evidence: self-relations refers to OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID; image no.5 refers to IMG_ID = 5
SQL: SELECT SUM(CASE WHEN IMG_ID = 5 THEN 1 ELSE 0 END) FROM IMG_REL WHERE OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID
Database: image_and_language
Tables: ATT_CLASSES, OBJ_CLASSES, IMG_OBJ, IMG_OBJ_ATT, PRED_CLASSES, IMG_REL
Columns (table index, column name): -1, *, 0, ATT_CLASS_ID, 0, ATT_CLASS, 1, OBJ_CLASS_ID, 1, OBJ_CLASS, 2, IMG_ID, 2, OBJ_SAMPLE_ID, 2, OBJ_CLASS_ID, 2, X, 2, Y, 2, W, 2, H, 3, IMG_ID, 3, ATT_CLASS_ID, 3, OBJ_SAMPLE_ID, 4, PRED_CLASS_ID, 4, PRED_CLASS, 5, IMG_ID, 5, PRED_CLASS_ID, 5, OBJ1_SAMPLE_ID, 5, OBJ2_SAMPLE_ID
Question: What is the bounding box of the object sample in image no.5 that has a self-relation?
Evidence: bounding box of the object sample refers to (x, y, W, H); image no.5 refers to IMG_ID = 5; has a self-relation refers to OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID
SQL: SELECT T2.X, T2.Y, T2.W, T2.H FROM IMG_REL AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.IMG_ID = T2.IMG_ID WHERE T1.IMG_ID = 5 AND T1.OBJ1_SAMPLE_ID = T1.OBJ2_SAMPLE_ID
Database: image_and_language
Tables: ATT_CLASSES, OBJ_CLASSES, IMG_OBJ, IMG_OBJ_ATT, PRED_CLASSES, IMG_REL
Columns (table index, column name): -1, *, 0, ATT_CLASS_ID, 0, ATT_CLASS, 1, OBJ_CLASS_ID, 1, OBJ_CLASS, 2, IMG_ID, 2, OBJ_SAMPLE_ID, 2, OBJ_CLASS_ID, 2, X, 2, Y, 2, W, 2, H, 3, IMG_ID, 3, ATT_CLASS_ID, 3, OBJ_SAMPLE_ID, 4, PRED_CLASS_ID, 4, PRED_CLASS, 5, IMG_ID, 5, PRED_CLASS_ID, 5, OBJ1_SAMPLE_ID, 5, OBJ2_SAMPLE_ID
Question: How many object samples in image no.1 are in the class of "man"?
Evidence: object samples refers to OBJ_CLASS_ID; image no.1 refers to IMG_ID = 1; in the class of "man" refers to OBJ_CLASS = 'man'
SQL: SELECT SUM(CASE WHEN T1.OBJ_CLASS = 'man' THEN 1 ELSE 0 END) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 1
Database: image_and_language
Tables: ATT_CLASSES, OBJ_CLASSES, IMG_OBJ, IMG_OBJ_ATT, PRED_CLASSES, IMG_REL
Columns (table index, column name): -1, *, 0, ATT_CLASS_ID, 0, ATT_CLASS, 1, OBJ_CLASS_ID, 1, OBJ_CLASS, 2, IMG_ID, 2, OBJ_SAMPLE_ID, 2, OBJ_CLASS_ID, 2, X, 2, Y, 2, W, 2, H, 3, IMG_ID, 3, ATT_CLASS_ID, 3, OBJ_SAMPLE_ID, 4, PRED_CLASS_ID, 4, PRED_CLASS, 5, IMG_ID, 5, PRED_CLASS_ID, 5, OBJ1_SAMPLE_ID, 5, OBJ2_SAMPLE_ID
Question: How many images have at least one object sample in the class of "man"?
Evidence: have at least one object sample in the class of "man" refers to count(IMG_ID where OBJ_CLASS = 'man') > = 1
SQL: SELECT COUNT(T.IMG_ID) FROM ( SELECT T2.IMG_ID FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.OBJ_CLASS = 'man' GROUP BY T2.IMG_ID ) T
Database: image_and_language
Tables: ATT_CLASSES, OBJ_CLASSES, IMG_OBJ, IMG_OBJ_ATT, PRED_CLASSES, IMG_REL
Columns (table index, column name): -1, *, 0, ATT_CLASS_ID, 0, ATT_CLASS, 1, OBJ_CLASS_ID, 1, OBJ_CLASS, 2, IMG_ID, 2, OBJ_SAMPLE_ID, 2, OBJ_CLASS_ID, 2, X, 2, Y, 2, W, 2, H, 3, IMG_ID, 3, ATT_CLASS_ID, 3, OBJ_SAMPLE_ID, 4, PRED_CLASS_ID, 4, PRED_CLASS, 5, IMG_ID, 5, PRED_CLASS_ID, 5, OBJ1_SAMPLE_ID, 5, OBJ2_SAMPLE_ID
Question: Please list the classes of all the object samples in image no.1.
Evidence: classes of all the object samples refers to OBJ_CLASS; image no.1 refers to IMG_ID = 1
SQL: SELECT T1.OBJ_CLASS FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 GROUP BY T1.OBJ_CLASS