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: Define the bounding box of the object sample no. 7 on image no. 42.
Evidence: bounding box of the object refers to (X, Y, W, H); sample no.7 on image no.42 refers to IMG_ID = 42 and OBJ_SAMPLE_ID = 7
SQL: SELECT X, Y, W, H FROM IMG_OBJ WHERE IMG_ID = 42 AND OBJ_SAMPLE_ID = 7
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: On image no. 99 identify the percentage of objects that are described as white.
Evidence: image no. 99 refers to IMG_ID = 99; described as white refers to ATT_CLASS = 'white'; percentage = divide(count(OBJ_SAMPLE_ID) where ATT_CLASS = 'white', count(OBJ_SAMPLE_ID)) as percentage
SQL: SELECT CAST(SUM(CASE WHEN T2.ATT_CLASS = 'white' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(OBJ_SAMPLE_ID) FROM IMG_OBJ_ATT AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.IMG_ID = 99
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 attribute classes are there for image id 5?
Evidence: attribute classes refer to ATT_CLASS_ID; image id 5 refers to IMG_ID = 5;
SQL: SELECT COUNT(ATT_CLASS_ID) FROM IMG_OBJ_ATT WHERE IMG_ID = 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: State the explanation about object class 10.
Evidence: explanation about object class 10 refers to OBJ_CLASS where OBJ_CLASS_ID = 10;
SQL: SELECT OBJ_CLASS FROM OBJ_CLASSES 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: Name the object class of the image with a bounding (422, 63, 77, 363).
Evidence: image with a bounding (422, 63, 77, 363) refers to OBJ_CLASS_ID where X = 422 and Y = 63 and W = 77 and H = 363;
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 = 422 AND T1.Y = 63 AND T1.W = 77 AND T1.H = 363
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 caption for the prediction class id 12?
Evidence: caption for the prediction class id 12 refers to PRED_CLASS where PRED_CLASS_ID = 12;
SQL: SELECT PRED_CLASS FROM PRED_CLASSES WHERE PRED_CLASS_ID = 12
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: Indicate the bounding box of the image 8.
Evidence: bounding box refers to X, Y, W, H from IMG_OBJ; image 8 refers to IMG_ID = 8;
SQL: SELECT X, Y, W, H FROM IMG_OBJ WHERE IMG_ID = 8
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.908 are in the class of tip?
Evidence: object samples in the class of "tip" refer to OBJ_CLASS_ID where OBJ_CLASS = 'tip'; image no.5 refers to IMG_ID = 5;
SQL: SELECT SUM(CASE WHEN T2.OBJ_CLASS = 'tip' 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 T1.IMG_ID = 908
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 out the number of object samples in image no.41 which are in the class of "kitchen"?
Evidence: object samples in the class of "kitchen" refer to OBJ_CLASS_ID where OBJ_CLASS = 'kitchen'; image no.41 refers to IMG_ID = 41 ;
SQL: SELECT SUM(CASE WHEN T2.OBJ_CLASS = 'kitchen' 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 T1.IMG_ID = 41
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: Count the image numbers that contain the "paint" object.
Evidence: image numbers that contain the "paint" object refer to IMG_ID where OBJ_CLASS = 'paint';
SQL: SELECT COUNT(DISTINCT 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 = 'paint'
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 samples of clouds are there in the image no.2315533?
Evidence: samples of clouds refer to IMG_ID where OBJ_CLASS = 'cloud'; image no.2315533 refers to IMG_ID = 2315533;
SQL: SELECT SUM(CASE WHEN T1.IMG_ID = 2315533 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 = 'clouds'
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: Which object classes belong to the onion category?
Evidence: onion category refers to OBJ_CLASS = 'onion';
SQL: SELECT OBJ_CLASS_ID FROM OBJ_CLASSES WHERE OBJ_CLASS = 'onion'
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 "spoon" in image id 1344?
Evidence: the bounding box refers to X, Y, W, H from IMG_OBJ; image id 1344 refers to IMG_ID = 1344; "spoon" refers to OBJ_CLASS = 'spoon';
SQL: SELECT T1.X, T1.Y, 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 T1.IMG_ID = 1344 AND T2.OBJ_CLASS = 'spoon'
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 percentage of "surface" object samples in image No.2654?
Evidence: DIVIDE(SUM(OBJ_CLASS_ID where OBJ_CLASS = 'surface'), COUNT(OBJ_CLASS_ID)) as percentage where IMG_ID = 2654;
SQL: SELECT CAST(SUM(CASE WHEN T2.OBJ_CLASS = 'surface' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.OBJ_CLASS_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 2654
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 include the "wood" objects?
Evidence: images refer to IMG_ID; "wood" objects refer to OBJ_CLASS = 'wood';
SQL: SELECT COUNT(DISTINCT 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 = 'wood'
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 object class of the image with tallest bounding box.
Evidence: bounding box refers to X, Y, W, H from IMG_OBJ; tallest relates to the height of the bounding box which refers to MAX(H); object class refers to OBJ_CLASS;
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 ORDER BY T1.H 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: Calculate the percentage of "airplane" object class in the table.
Evidence: DIVIDE(SUM(OBJ_SAMPLE_ID where OBJ_CLASS = 'airplane'), COUNT(OBJ_CLASS)) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN T2.OBJ_CLASS = 'airplane' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.OBJ_CLASS) 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: How many samples of animal objects are there in image no.660?
Evidence: samples of animal objects refer to OBJ_SAMPLE_ID where OBJ_CLASS = 'animal'; image no.660 refers to IMG_ID = 660;
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 = 'animal' AND T1.IMG_ID = 660
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: Name number of samples of "bed" object are there in the image No.1098?
Evidence: samples of "bed" object refer to OBJ_SAMPLE_ID where OBJ_CLASS = 'bed'; image No.1098 refers to IMG_ID = 1098;
SQL: SELECT SUM(CASE WHEN T2.OBJ_CLASS = 'bed' 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 T1.IMG_ID = 1098
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: Name the object class of the image with lowest bounding box.
Evidence: bounding box refers to X, Y, W, H from IMG_OBJ; lowest relates to the height of the bounding box which refers to MIN(H);
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 ORDER BY T1.H 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: Indicating the bounding box of "kitchen" in image id 250.
Evidence: bounding box refers to X, Y, W, H from IMG_OBJ; "kitchen" in image id 250 refers to OBJ_CLASS = 'kitchen' where IMG_ID = 250;
SQL: SELECT T1.X, T1.Y, 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 T1.IMG_ID = 250 AND T2.OBJ_CLASS = 'kitchen'
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: Which images have more than 20 object samples?
Evidence: images have more than 20 object samples refer to IMG_ID where COUNT(OBJ_SAMPLE_ID) > 20;
SQL: SELECT IMG_ID FROM IMG_OBJ GROUP BY IMG_ID HAVING COUNT(IMG_ID) > 20
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: Which object in image 8 is the widest? State its object sample ID.
Evidence: widest relates to the width of the bounding
box of the object which refers to MAX(W); object in image 8 refers to OBJ_SAMPLE_ID where IMG_ID = 8;
SQL: SELECT OBJ_SAMPLE_ID FROM IMG_OBJ WHERE IMG_ID = 8 ORDER BY 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: Find the object in image 5 where the object with the coordinate of (634, 468).
Evidence: object in image 5 refers to OBJ_SAMPLE_ID where IMG_ID = 5; coordinates of (634, 468) refer to X and Y coordinates of the bounding box in which X = 634 and Y = 468;
SQL: SELECT OBJ_SAMPLE_ID FROM IMG_OBJ WHERE IMG_ID = 5 AND X = 634 AND Y = 468
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: Which object has the highest attribute classes?
Evidence: object has the highest attribute classes refers to OBJ_SAMPLE_ID where MAX(COUNT(OBJ_SAMPLE_ID));
SQL: SELECT OBJ_SAMPLE_ID FROM IMG_OBJ_ATT GROUP BY OBJ_SAMPLE_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: What is the ratio between the number of object samples in image 1 and the number of object samples in image 6?
Evidence: DIVIDE(SUM(OBJ_SAMPLE_ID where IMG_ID = 1), SUM(OBJ_SAMPLE_ID where IMG_ID = 6));
SQL: SELECT CAST(SUM(CASE WHEN IMG_ID = 1 THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN IMG_ID = 6 THEN 1 ELSE 0 END) FROM IMG_OBJ
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 of object samples for the image.
Evidence: DIVIDE(COUNT(OBJ_SAMPLE_ID), COUNT(IMG_ID));
SQL: SELECT CAST(COUNT(OBJ_SAMPLE_ID) AS REAL) / COUNT(DISTINCT IMG_ID) FROM IMG_OBJ
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 IDs of images that have objects with the attributes of 'wired'.
Evidence: IDs of images refer to IMG_ID; objects with the attributes of 'wired' refer to ATT_CLASS = 'wired';
SQL: SELECT DISTINCT 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 = 'wired'
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 in image 10.
Evidence: object classes refer to OBJ_CLASS; image 10 refers to IMG_ID = 10;
SQL: SELECT DISTINCT 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 = 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 attributes for object class 'tip' In image 1314.
Evidence: attributes for object refer to ATT_CLASS; class 'tip' in image 1314 refers to OBJ_CLASS = 'tip' where IMG_ID = 1314;
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 INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE T3.IMG_ID = 1314 AND T4.OBJ_CLASS = 'tip'
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 prediction class between object class 'chain' and 'label' in image 2360078?
Evidence: prediction class refers to PRED_CLASS; object class 'chain' refers to OBJ_CLASS = 'chain'; object class 'label' refers to OBJ_CLASS = 'label'; image 2360078 refers to IMG_ID = 2360078;
SQL: SELECT DISTINCT T2.PRED_CLASS FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T2.PRED_CLASS_ID = T1.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T1.IMG_ID = T3.IMG_ID AND T1.OBJ1_SAMPLE_ID = T3.OBJ_SAMPLE_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE T1.IMG_ID = 2360078 AND T1.OBJ1_SAMPLE_ID = 15 OR T1.OBJ2_SAMPLE_ID = 18
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 objects with the attributes of polka dot?
Evidence: attributes of polka dot refer to ATT_CLASS = 'polka dot'; images refer to IMG_ID;
SQL: SELECT COUNT(T2.OBJ_SAMPLE_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 = 'polka dot'