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 is the relation between object sample no.8 and object sample no.4 in image no.1?
Evidence: relation refers to PRED_CLASS; object sample no.8 and object sample no.4 refers to OBJ1_SAMPLE_ID = 8 AND OBJ2_SAMPLE_ID = 4; image no.1 refers to IMG_ID = 1
SQL: SELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 1 AND T2.OBJ1_SAMPLE_ID = 8 AND T2.OBJ2_SAMPLE_ID = 4
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 pairs of object samples in image no.1 have the relation of "parked on"?
Evidence: pairs of object samples refers to OBJ1_SAMPLE_ID and OBJ2_SAMPLE_ID; image no.1 refers to IMG_ID = 1; relation of "parked on" refers to PRED_CLASS = 'parked on'
SQL: SELECT SUM(CASE WHEN T1.PRED_CLASS = 'parked on' THEN 1 ELSE 0 END) FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 1 AND T2.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: Please list all the predicted relation classes of object sample no.14 in image no.1.
Evidence: predicted relation classes refers to PRED_CLASS; object sample no.14 in image no.1 refers to OBJ1_SAMPLE_ID = 14 AND OBJ2_SAMPLE_ID = 14 and IMG_ID = 1
SQL: SELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.OBJ1_SAMPLE_ID = 14 AND T2.OBJ2_SAMPLE_ID = 14
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 pair of object samples with the relation "parked on"?
Evidence: How many images have at least one pair of object samples with the relation "parked on" refers to count(IMG_ID) where OBJ1_SAMPLE_ID ! = OBJ2_SAMPLE_ID and PRED_CLASS = 'parked on'
SQL: SELECT SUM(CASE WHEN T1.PRED_CLASS = 'parked on' THEN 1 ELSE 0 END) FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.OBJ1_SAMPLE_ID != T2.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: Please list the IDs of all the images with more than 2 pairs of object samples with the relation "parked on".
Evidence: IDs of all the images refers to IMG_ID; relation "parked on" refers to PRED_CLASS = 'parked on'; more than 2 pairs refers to count(IMG_ID) where OBJ1_SAMPLE_ID ! = OBJ2_SAMPLE_ID
SQL: SELECT T2.IMG_ID FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.PRED_CLASS = 'parked on' AND T2.OBJ1_SAMPLE_ID != T2.OBJ2_SAMPLE_ID GROUP BY T2.IMG_ID HAVING COUNT(T2.IMG_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: To which predicted relation class does the self-relation of the object sample in image no.5 belong?
Evidence: predicted relation class refers to PRED_CLASS; self-relations refers to OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID; image no.5 refers to IMG_ID = 5
SQL: SELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 5 AND T2.OBJ1_SAMPLE_ID = T2.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 are the bounding boxes of the object samples with a predicted relation class of "by" in image no.1?
Evidence: bounding boxes of the object samples refers to (x, y, W, H); predicted relation class of "by" refers to PRED_CLASS = 'by'; image no.1 refers to IMG_ID = 1
SQL: SELECT T3.X, T3.Y, T3.W, T3.H FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.OBJ1_SAMPLE_ID = T3.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 AND T1.PRED_CLASS = 'by'
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 average difference in the y coordinate of 2 object samples with the relation "parked on" in image no.1?
Evidence: relation "parked on" refers to PRED_CLASS = 'parked on'; image no.1 refers to IMG_ID = 1; average difference in the y coordinate = divide(sum(Y), count(PRED_CLASS)) where OBJ1_SAMPLE_ID ! = OBJ2_SAMPLE_ID
SQL: SELECT CAST(SUM(T3.Y) AS REAL) / COUNT(CASE WHEN T1.PRED_CLASS = 'parked on' THEN 1 ELSE NULL END) FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.OBJ1_SAMPLE_ID = T3.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 AND T2.OBJ1_SAMPLE_ID != T2.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 percentage of the object samples in the class of "man" in image no.1?
Evidence: object samples refers to OBJ_SAMPLE_ID; class of "man" refers to OBJ_CLASS = 'man'; image no.1 refers to IMG_ID = 1; percentage = divide(count(OBJ_SAMPLE_ID)when OBJ_CLASS = 'man', count(OBJ_SAMPLE_ID)) as percentage
SQL: SELECT CAST(COUNT(CASE WHEN T1.OBJ_CLASS = 'man' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.OBJ_CLASS_ID) 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: State the total number of the attribute classes.
Evidence: attribute classes refers to ATT_CLASS
SQL: SELECT COUNT(ATT_CLASS_ID) FROM ATT_CLASSES
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 classes are there in the database?
Evidence: object classes refers to OBJ_CLASS
SQL: SELECT COUNT(OBJ_CLASS_ID) FROM OBJ_CLASSES
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 number of predicted classes.
Evidence: predicted classes refers to PRED_CLASS
SQL: SELECT COUNT(PRED_CLASS_ID) FROM PRED_CLASSES
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: Give the bounding box of the kite in image no.2324765.
Evidence: bounding box refers to (x, y, W, H); kite refers to OBJ_CLASS = 'kite'; image no.2324765 refers to IMG_ID = 2324765
SQL: SELECT T2.X, T2.Y, T2.W, T2.H FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 2324765 AND T1.OBJ_CLASS = 'kite'
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 white objects are there in image no.2347915?
Evidence: white objects refers to ATT_CLASS = 'white'; image no.2347915 refers to IMG_ID = 2347915
SQL: SELECT SUM(CASE WHEN T2.ATT_CLASS = 'white' THEN 1 ELSE 0 END) 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 = 2347915
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: Give the number of samples in image no.2377985 whose attribute is electrical.
Evidence: number of samples refers to OBJ_SAMPLE_ID; image no.2377985 refers to IMG_ID = 2377985; attribute is electrical refers to ATT_CLASS = 'electrical'
SQL: SELECT SUM(CASE WHEN T2.ATT_CLASS = 'white' THEN 1 ELSE 0 END) 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 = 2347915
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 relationship between object sample no.12 and no.8 of image no.2345511?
Evidence: relationship refers to PRED_CLASS; object sample no.12 and no.8 of image no.2345511 refers to IMG_ID = 2345511 AND OBJ1_SAMPLE_ID = 12 AND OBJ2_SAMPLE_ID = 8
SQL: SELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 2345511 AND T2.OBJ1_SAMPLE_ID = 12 AND T2.OBJ2_SAMPLE_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: Give the object number of the sample which has the relationship of "lying on" with object sample no.1 from image no.2345524.
Evidence: object number of the sample refers to OBJ1_SAMPLE_ID; object sample no.1 from image no.2345524 refers to OBJ2_SAMPLE_ID = 1 and IMG_ID = 2345524
SQL: SELECT T2.OBJ1_SAMPLE_ID FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 2345524 AND T1.PRED_CLASS = 'lying on' AND T2.OBJ2_SAMPLE_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 samples of food object are there in image no.6?
Evidence: samples of food object refers to OBJ_CLASS = 'food'; image no.6 refers to IMG_ID = 6
SQL: SELECT COUNT(T2.OBJ_SAMPLE_ID) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 6 AND T1.OBJ_CLASS = 'food'
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: Give the number of images containing the object sample of "suit".
Evidence: number of images refers to IMG_ID; object sample of "suit" refers to OBJ_CLASS = 'suit'
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 = 'suit' 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: What is the relationship between "feathers" and "onion" in image no.2345528?
Evidence: relationship refers to PRED_CLASS; "feathers" and "onion" in image no.2345528 refers to IMG_ID = 2345528 and OBJ_CLASS = 'feathers' and OBJ_CLASS = 'onion'
SQL: SELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.OBJ1_SAMPLE_ID = T3.OBJ_SAMPLE_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE (T4.OBJ_CLASS = 'feathers' OR T4.OBJ_CLASS = 'onion') AND T2.IMG_ID = 2345528 GROUP BY T1.PRED_CLASS
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: Tell the attribute of the weeds in image no.2377988.
Evidence: attribute of the weeds refers to OBJ_CLASS = 'weeds'; image no.2377988 refers to IMG_ID = 2377988
SQL: SELECT T2.ATT_CLASS FROM IMG_OBJ_att AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T1.IMG_ID = T3.IMG_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE T4.OBJ_CLASS = 'weeds' AND T1.IMG_ID = 2377988
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 object whose attribute is blurry in image no.2377993? Give the explanation about the object.
Evidence: attribute is blurry refers to ATT_CLASS = 'blurry'; image no.2377993 refers to IMG_ID = 22377993; explanation about the object refers to OBJ_CLASS
SQL: SELECT T4.OBJ_CLASS_ID, T4.OBJ_CLASS FROM IMG_OBJ_att AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T1.IMG_ID = T3.IMG_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE T2.ATT_CLASS = 'blurry' AND T1.IMG_ID = 22377993
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 "wall" are there in image no.2353079?
Evidence: samples of "wall" refers to OBJ_SAMPLE_ID and OBJ_CLASS = 'wall' ; image no.2353079 refers to IMG_ID = 2353079
SQL: SELECT SUM(CASE WHEN T1.OBJ_CLASS = 'wall' 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 = 2353079
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 sample no.10 of image no.2320341.
Evidence: object class refers to OBJ_CLASS; sample no.10 refers to OBJ_SAMPLE_ID = 10; image no.2320341 refers to IMG_ID = 2320341
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 = 2320341 AND T2.OBJ_SAMPLE_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: How many times is the number of images containing "broccoli" than "tomato"?
Evidence: images refers to IMG_ID; "broccoli" refers to OBJ_CLASS = 'broccoli'; "tomato" refers to OBJ_CLASS = 'tomato' ; How many times = divide(count(OBJ_SAMPLE_ID) when OBJ_CLASS = 'broccoli', count(OBJ_SAMPLE_ID) when OBJ_CLASS = 'tomato')
SQL: SELECT CAST(COUNT(CASE WHEN T1.OBJ_CLASS = 'broccoli' THEN T2.OBJ_SAMPLE_ID ELSE NULL END) AS REAL) / COUNT(CASE WHEN T1.OBJ_CLASS = 'tomato' THEN T2.OBJ_SAMPLE_ID ELSE NULL END) times FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ 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 images have at least 25 attributes?
Evidence: images refers to IMG_ID; have at least 25 attributes refers to count(ATT_CLASS_ID) > = 25
SQL: SELECT COUNT(*) FROM ( SELECT IMG_ID FROM IMG_OBJ_att GROUP BY IMG_ID HAVING COUNT(ATT_CLASS_ID) > 25 ) 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: List all the ids of the images that have a self-relation relationship.
Evidence: ids of the images refers to IMG_ID; self-relations refers to OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID
SQL: SELECT DISTINCT IMG_ID 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: How many objects are there in the attribute class id with the highest number of objects?
Evidence: objects refers to OBJ_SAMPLE_ID; attribute class id with the highest number of objects refers to max(COUNT(ATT_CLASS_ID))
SQL: SELECT COUNT(ATT_CLASS_ID) FROM IMG_OBJ_att GROUP BY IMG_ID ORDER BY COUNT(ATT_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: What are the id of all the objects belonging to the transportation class?
Evidence: id of all the objects belonging to the transportation class refers to OBJ_CLASS_ID and OBJ_CLASS IN ('bus', 'train', 'aeroplane', 'car', 'etc.')
SQL: SELECT OBJ_CLASS_ID FROM OBJ_CLASSES WHERE OBJ_CLASS IN ('bus', 'train', 'aeroplane', 'car', 'etc')