1sf/bird-sql-train-with-schema huggingface dataset:
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 are the attributes of the widest object in image 400?
Evidence: attributes refer to ATT_CLASS; the widest relates to the width of the bounding
box of the object which refers to MAX(W); image 400 refers to IMG_ID = 400;
SQL: SELECT T1.ATT_CLASS FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID WHERE T2.IMG_ID = 400 ORDER BY T3.W 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: State the name of the object class that has in most images.
Evidence: object class that has in most images refers to OBJ_CLASS where MAX(COUNT(OBJ_CLASS_ID));
SQL: SELECT OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID GROUP BY T2.OBJ_CLASS ORDER BY COUNT(T1.OBJ_CLASS_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: State the width and height of the object with the class of 'van' in image 1.
Evidence: The bounding box's W and H abbreviations stand for the object's width and height respectively; class of 'van' in image 1 refers to OBJ_CLASS = 'van' where IMG_ID = 1;
SQL: SELECT T1.H, T1.W FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 1 AND T2.OBJ_CLASS = 'van'
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: State the coordinate of X and Y for the object with the attribute of 'sparse' in image 1.
Evidence: coordinates of X and Y for the object refer to X and Y coordinates of the bounding box; attribute of 'sparse' in image 1 refers to IMG_ID = 1 where ATT_CLASS = 'sparse';
SQL: SELECT T3.OBJ_SAMPLE_ID, T3.X, T3.Y FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID WHERE T3.IMG_ID = 1 AND T1.ATT_CLASS = 'sparse'
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: Calculate the percentage of object samples that are related to street lights.
Evidence: DIVIDE(COUNT(OBJ_SAMPLE_ID where OBJ_CLASS = 'street lights'), COUNT(OBJ_SAMPLE_ID)) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN T2.OBJ_CLASS = 'street lights' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.OBJ_SAMPLE_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_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: Based on image 5, what is the percentage of images that belong windows object class?
Evidence: DIVIDE(COUNT(OBJ_SAMPLE_ID where OBJ_CLASS = 'windows' and IMG_ID = 5), COUNT(OBJ_SAMPLE_ID where IMG_ID = 5)) as percentage;
SQL: SELECT CAST(COUNT(T1.OBJ_SAMPLE_ID) AS REAL) * 100 / COUNT(CASE WHEN T1.IMG_ID = 5 THEN 1 ELSE 0 END) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'windows'
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 an x-coordinate of 5 and y-coordinate of 5?
Evidence: X and Y refer to coordinates of the bounding box where X = 5 and Y = 5; images refer to IMG_ID;
SQL: SELECT COUNT(IMG_ID) FROM IMG_OBJ WHERE X = 5 AND Y = 5
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 less than 15 object samples?
Evidence: images refer to IMG_ID; less than 15 object samples refer to COUNT(OBJ_SAMPLE_ID) < 15;
SQL: SELECT COUNT(IMG_ID) FROM IMG_OBJ WHERE OBJ_SAMPLE_ID < 15
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 a total of 10 attribute classes?
Evidence: images refer to IMG_ID; total of 10 attribute classes refers to COUNT(OBJ_CLASS_ID) = 10;
SQL: SELECT COUNT(IMG_ID) FROM IMG_OBJ WHERE OBJ_CLASS_ID = 10
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: List the ID of all images with objects that have multiple relations.
Evidence: ID of all images refer to IMG_ID; if two objects (OBJ1_SAMPLE_ID,
OBJ2_SAMPLE_ID) has
multiple PRED_CLASS_ID, it
means these two objects
have multiple relations;
SQL: SELECT IMG_ID FROM IMG_REL GROUP BY PRED_CLASS_ID HAVING COUNT(DISTINCT OBJ1_SAMPLE_ID) != 0 AND COUNT(DISTINCT OBJ2_SAMPLE_ID) != 0
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 "vegetable" and "fruits" as their object classes?
Evidence: images refer to IMG_ID; "vegetables" and "fruits" as object classes refer to OBJ_CLASS = 'vegetables' and OBJ_CLASS = 'fruits';
SQL: SELECT COUNT(T1.IMG_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'vegetables' OR T2.OBJ_CLASS = 'fruits'
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 image ID with a predicted class of "parked on"?
Evidence: predicted class of "parked on" refers to PRED_CLASS = 'parked on';
SQL: SELECT DISTINCT T1.IMG_ID FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.PRED_CLASS = 'parked on'
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: List all the object classes of the images that have a (5,5) coordinate.
Evidence: object classes refer to OBJ_CLASS; (5,5) coordinates refer to X and Y coordinates of the bounding box where X = 5 and Y = 5;
SQL: SELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.X = 5 AND T1.Y = 5
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 "keyboard" as their object class?
Evidence: images refer to IMG_ID; "keyboard" as object class refers to OBJ_CLASS = 'keyboard';
SQL: SELECT COUNT(T1.IMG_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'keyboard'
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 are the width and height of the bounding box of the object with "keyboard" as their object class and (5, 647) as their coordinate?
Evidence: The bounding box's W and H abbreviations stand for the object's width and height respectively; "keyboard" as object class refers to OBJ_CLASS = 'keyboard'; (5, 647) as coordinate refers to X and Y coordinates of the bounding box where X = 5 and Y = 647;
SQL: SELECT T1.W, T1.H FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'keyboard' AND T1.X = 5 AND T1.Y = 647
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: List all the ID of the images that have an attribute class of "horse".
Evidence: ID of all images refer to IMG_ID; attribute class of "horse" refers to ATT_CLASS = 'horse';
SQL: SELECT T2.IMG_ID FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.ATT_CLASS = 'horse'
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: Provide the x-coordinate and y-coordinate of the image with an attribute class of ''horse" and an object class of "fur".
Evidence: attribute class of "horse" refers to ATT_CLASS = 'horse'; object class of "fur" refers to OBJ_CLASS = 'fur';
SQL: SELECT T3.X, T3.Y FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE T1.ATT_CLASS = 'horse' AND T4.OBJ_CLASS = 'fur'
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: List all the attribute classes of the image ID "15".
Evidence: attribute classes of the image ID "15" refer to ATT_CLASS where IMG_ID = 15;
SQL: SELECT T1.ATT_CLASS FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.IMG_ID = 15
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: For those objects that have multiple relations, how many images have a prediction class of "reading"?
Evidence: prediction class of "reading" refers to PRED_CLASS = 'reading'; if two objects (OBJ1_SAMPLE_ID,
OBJ2_SAMPLE_ID) has
multiple PRED_CLASS_ID, it
means these two objects
have multiple relations;
SQL: SELECT COUNT(T1.IMG_ID) FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.PRED_CLASS = 'reading'
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 "picture" as their attribute class?
Evidence: images have "picture" as their attribute class refer to IMG_ID where ATT_CLASS = 'picture';
SQL: SELECT COUNT(T2.IMG_ID) FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.ATT_CLASS = 'picture'
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 "picture" as their attribute class and "bear" as their object class?
Evidence: "picture" as attribute class refers to ATT_CLASS = 'picture'; "bear" as object class refers to OBJ_CLASS = 'bear'; images refer to IMG_ID;
SQL: SELECT COUNT(T2.IMG_ID) FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE T1.ATT_CLASS = 'picture' AND T4.OBJ_CLASS = 'bear'
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: List all the attribute classes of the images that have a (5,5) coordinate.
Evidence: attribute classes refer to ATT_CLASS; (5,5) coordinate refers to X and Y coordinates of the bounding box where X = 5 and Y = 5;
SQL: SELECT T1.ATT_CLASS FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID WHERE T3.X = 5 AND T3.Y = 5
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: Calculate the average number of images with an attribute class of "keyboard".
Evidence: AVG(IMG_ID) where OBJ_CLASS = 'keyboard';
SQL: SELECT AVG(T1.IMG_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'keyboard'
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: Calculate the ratio of the total number of images with an object class of "man" and "person".
Evidence: DIVIDE(COUNT(IMG_ID where OBJ_CLASS = 'man'), COUNT(IMG_ID where OBJ_CLASS = 'person'));
SQL: SELECT CAST(COUNT(CASE WHEN T2.OBJ_CLASS = 'man' THEN 1 ELSE 0 END) AS REAL) / COUNT(CASE WHEN T2.OBJ_CLASS = 'person' THEN 1 ELSE 0 END) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_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: List the object sample IDs of image ID 17 with coordinates (0,0).
Evidence: object sample ID refers to OBJ_SAMPLE_ID; image ID 17 refers to IMG_ID = 17; coordinates (0,0) refer to X and Y coordinates of the bounding box where X = 0 and Y = 0;
SQL: SELECT OBJ_SAMPLE_ID FROM IMG_OBJ WHERE IMG_ID = 17 AND X = 0 AND Y = 0
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: List all bounding box widths and heights of object sample ID 2.
Evidence: The bounding box's W and H abbreviations stand for the object's width and height respectively; object sample ID 2 refers to OBJ_SAMPLE_ID = 2;
SQL: SELECT W, H FROM IMG_OBJ WHERE OBJ_SAMPLE_ID = 2
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: In the Y coordinate of image ID 12, how many are 0?
Evidence: Y coordinate many are 0 refers to Y coordinates of the bounding box where Y = 0; image ID 12 refers to IMG_ID = 12;
SQL: SELECT COUNT(IMG_ID) FROM IMG_OBJ WHERE IMG_ID = 12 AND Y = 0
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: List all the attribute classes of image ID 22.
Evidence: attribute classes of image ID 22 refer to ATT_CLASS where MG_ID = 22;
SQL: SELECT T1.ATT_CLASS FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.IMG_ID = 22
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: List the object classes of image ID 36 with coordinates (0,0).
Evidence: object classes of image ID 36 refers to OBJ_CLASS where IMG_ID = 36; coordinates (0,0) refer to X and Y coordinates of the bounding box where X = 0 and Y = 0;
SQL: SELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 36 AND T1.X = 0 AND T1.Y = 0
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: Write 10 coordinates with the object class "pizza."
Evidence: coordinates for the object refer to X, Y, W and H coordinates of the bounding box; object class "pizza" refers to OBJ_CLASS = 'pizza';
SQL: SELECT T1.IMG_ID, T1.X, T1.Y FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'pizza' LIMIT 10