Chinastark/bird_dataset huggingface dataset:
Database: image_and_language
Note: bounding box refers to (x, y, w, h); onion refers to obj_class = 'onion'; image no.285930 refers to img_id = 285930;
Question: Define the onion's bounding box on image no. 285930.
SQL: SELECT img_obj.x, img_obj.y, img_obj.w, img_obj.h FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE img_obj.img_id = 285930 AND obj_classes.obj_class = 'onion'
Database: image_and_language
Note: how many objects refers to obj_class_id; image no. 72 refers to img_id = 72; what objects refers to obj_class; bounding box represented as (341, 27, 42, 51) refers to x = 341 and y = 27 and w = 42 and h = 51;
Question: How many objects can you spot in image no. 72? What objects may be identified on the same image and within the bounding box represented as (341, 27, 42, 51)?
SQL: SELECT sum(iif(img_obj.img_id = 1, 1, 0)), sum(iif(img_obj.x = 341 AND img_obj.y = 27 AND img_obj.w = 42 AND img_obj.h = 51, 1, 0)) FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id
Database: image_and_language
Note: image no. 5 refers to img_id = 5; name the attributes refers to att_class; multiple objects refers to count(att_class) >= 2;
Question: On image no. 5, name the attributes that are composed of multiple objects.
SQL: SELECT att_classes.att_class FROM img_obj_att INNER JOIN att_classes ON img_obj_att.att_class_id = att_classes.att_class_id WHERE img_obj_att.img_id = 5 GROUP BY att_classes.att_class HAVING count(att_classes.att_class) > 2
Database: image_and_language
Note: what attributes refers to att_class; wall on image no. 27 refers to obj_class = 'wall' and img_id = 27;
Question: What attributes are used to describe the wall on image no. 27.
SQL: SELECT att_classes.att_class FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id INNER JOIN img_obj_att ON img_obj.img_id = img_obj_att.img_id INNER JOIN att_classes ON img_obj_att.att_class_id = att_classes.att_class_id WHERE obj_classes.obj_class = 'wall' AND img_obj.img_id = 27 GROUP BY att_classes.att_class
Database: image_and_language
Note: Name the object element refers to obj_class; scattered refers to att_class = 'scattered'; image no. 10 refers to img_id = 10;
Question: Name the object element that is described as being scattered on image no. 10.
SQL: SELECT obj_classes.obj_class FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id INNER JOIN img_obj_att ON img_obj.img_id = img_obj_att.img_id INNER JOIN att_classes ON img_obj_att.att_class_id = att_classes.att_class_id WHERE att_classes.att_class = 'scattered' AND img_obj.img_id = 10 GROUP BY obj_classes.obj_class
Database: image_and_language
Note: images refers to img_id; 'bridge' as an object element refers to obj_class = 'bridge';
Question: How many images contain 'bridge' as an object element?
SQL: SELECT count(DISTINCT img_obj.img_id) FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE obj_classes.obj_class = 'bridge'
Database: image_and_language
Note: object elements refers to obj_class_id; average = divide(count(obj_class_id), count(img_id));
Question: How many object elements are there on average in each image?
SQL: SELECT cast(count(obj_class_id) AS REAL) / count(DISTINCT img_id) FROM img_obj
Database: image_and_language
Note: colour refers to att_class; van refers to obj_class = 'van'; image no. 1 refers to img_id = 1;
Question: What colour is the van that can be spotted in image no. 1?
SQL: SELECT att_classes.att_class FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id INNER JOIN img_obj_att ON img_obj.img_id = img_obj_att.img_id INNER JOIN att_classes ON img_obj_att.att_class_id = att_classes.att_class_id WHERE obj_classes.obj_class = 'van' AND img_obj.img_id = 1 GROUP BY att_classes.att_class
Database: image_and_language
Note: objects refers to obj_class; attributes refers to att_class; relationships refers to pred_class; image no. 1 refers to img_id = 1; bounding box, represented as (388, 369, 48, 128) refers to x = 388 and y = 369 and w = 48 and h = 128;
Question: Describe the objects, their attributes, and the relationships that comprise the scene on image no. 1 within the bounding box, represented as (388, 369, 48, 128).
SQL: SELECT DISTINCT obj_classes.obj_class, att_classes.att_class, pred_classes.pred_class FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id INNER JOIN img_obj_att ON img_obj.img_id = img_obj_att.img_id INNER JOIN att_classes ON img_obj_att.att_class_id = att_classes.att_class_id INNER JOIN img_rel ON img_obj.img_id = img_rel.img_id INNER JOIN pred_classes ON img_rel.pred_class_id = pred_classes.pred_class_id WHERE img_obj.img_id = 1 AND img_obj.x = 388 AND img_obj.y = 369 AND img_obj.w = 48 AND img_obj.h = 128
Database: image_and_language
Note: relationship refers to pred_class; object sample no. 25 and object sample no. 2 refers to obj1_sample_id = 25 and obj2_sample_id = 2; image no. 1 refers to img_id = 1;
Question: What is the relationship between object sample no. 25 and object sample no. 2 on image no. 1?
SQL: SELECT pred_classes.pred_class FROM img_rel INNER JOIN pred_classes ON img_rel.pred_class_id = pred_classes.pred_class_id WHERE img_rel.img_id = 1 AND img_rel.obj1_sample_id = 25 AND img_rel.obj2_sample_id = 2
Database: image_and_language
Note: how many attributes refers to att_class_id; object sample no. 7 on image no. 4 refers to img_id = 4 and obj_sample_id = 7;
Question: How many attributes are related to the object sample no. 7 on image no. 4?
SQL: SELECT count(att_class_id) FROM img_obj_att WHERE img_id = 4 AND obj_sample_id = 7
Database: image_and_language
Note: how many object elements refers to obj_class_id; image no. 31 refers to img_id = 31;
Question: How many object elements can be detected on image no. 31?
SQL: SELECT count(obj_class_id) FROM img_obj WHERE img_id = 31
Database: image_and_language
Note: image no. 20 refers to img_id = 20; attribute ID refers to att_class_id; highest number of objects refers to max(count(att_class_id));
Question: On image no. 20, identify the attribute ID that is composed of the highest number of objects.
SQL: SELECT att_class_id FROM img_obj_att WHERE img_id = 20 GROUP BY att_class_id ORDER BY count(att_class_id) DESC LIMIT 1
Database: image_and_language
Note: 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;
Question: Define the bounding box of the object sample no. 7 on image no. 42.
SQL: SELECT x, y, w, h FROM img_obj WHERE img_id = 42 AND obj_sample_id = 7
Database: image_and_language
Note: 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;
Question: On image no. 99 identify the percentage of objects that are described as white.
SQL: SELECT cast(sum(CASE WHEN att_classes.att_class = 'white' THEN 1 ELSE 0 END) AS REAL) * 100 / count(obj_sample_id) FROM img_obj_att INNER JOIN att_classes ON img_obj_att.att_class_id = att_classes.att_class_id WHERE img_obj_att.img_id = 99
Database: image_and_language
Note: attribute classes refer to att_class_id; image id 5 refers to img_id = 5;
Question: How many attribute classes are there for image id 5?
SQL: SELECT count(att_class_id) FROM img_obj_att WHERE img_id = 5
Database: image_and_language
Note: explanation about object class 10 refers to obj_class where obj_class_id = 10;
Question: State the explanation about object class 10.
SQL: SELECT obj_class FROM obj_classes WHERE obj_class_id = 10
Database: image_and_language
Note: 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;
Question: Name the object class of the image with a bounding (422, 63, 77, 363).
SQL: SELECT obj_classes.obj_class FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE img_obj.x = 422 AND img_obj.y = 63 AND img_obj.w = 77 AND img_obj.h = 363
Database: image_and_language
Note: caption for the prediction class id 12 refers to pred_class where pred_class_id = 12;
Question: What is the caption for the prediction class id 12?
SQL: SELECT pred_class FROM pred_classes WHERE pred_class_id = 12
Database: image_and_language
Note: bounding box refers to x, y, w, h from img_obj; image 8 refers to img_id = 8;
Question: Indicate the bounding box of the image 8.
SQL: SELECT x, y, w, h FROM img_obj WHERE img_id = 8
Database: image_and_language
Note: object samples in the class of "tip" refer to obj_class_id where obj_class = 'tip'; image no.5 refers to img_id = 5;
Question: How many object samples in image no.908 are in the class of tip?
SQL: SELECT sum(CASE WHEN obj_classes.obj_class = 'tip' THEN 1 ELSE 0 END) FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE img_obj.img_id = 908
Database: image_and_language
Note: object samples in the class of "kitchen" refer to obj_class_id where obj_class = 'kitchen'; image no.41 refers to img_id = 41 ;
Question: List out the number of object samples in image no.41 which are in the class of "kitchen"?
SQL: SELECT sum(CASE WHEN obj_classes.obj_class = 'kitchen' THEN 1 ELSE 0 END) FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE img_obj.img_id = 41
Database: image_and_language
Note: image numbers that contain the "paint" object refer to img_id where obj_class = 'paint';
Question: Count the image numbers that contain the "paint" object.
SQL: SELECT count(DISTINCT img_obj.img_id) FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE obj_classes.obj_class = 'paint'
Database: image_and_language
Note: samples of clouds refer to img_id where obj_class = 'cloud'; image no.2315533 refers to img_id = 2315533;
Question: How many samples of clouds are there in the image no.2315533?
SQL: SELECT sum(CASE WHEN img_obj.img_id = 2315533 THEN 1 ELSE 0 END) FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE obj_classes.obj_class = 'clouds'
Database: image_and_language
Note: onion category refers to obj_class = 'onion';
Question: Which object classes belong to the onion category?
SQL: SELECT obj_class_id FROM obj_classes WHERE obj_class = 'onion'
Database: image_and_language
Note: 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';
Question: What is the bounding box of "spoon" in image id 1344?
SQL: SELECT img_obj.x, img_obj.y, img_obj.w, img_obj.h FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE img_obj.img_id = 1344 AND obj_classes.obj_class = 'spoon'
Database: image_and_language
Note: DIVIDE(SUM(obj_class_id where obj_class = 'surface'), COUNT(obj_class_id)) as percentage where img_id = 2654;
Question: What is the percentage of "surface" object samples in image No.2654?
SQL: SELECT cast(sum(CASE WHEN obj_classes.obj_class = 'surface' THEN 1 ELSE 0 END) AS REAL) * 100 / count(img_obj.obj_class_id) FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE img_obj.img_id = 2654
Database: image_and_language
Note: images refer to img_id; "wood" objects refer to obj_class = 'wood';
Question: How many images include the "wood" objects?
SQL: SELECT count(DISTINCT img_obj.img_id) FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE obj_classes.obj_class = 'wood'
Database: image_and_language
Note: 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;
Question: State the object class of the image with tallest bounding box.
SQL: SELECT obj_classes.obj_class FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id ORDER BY img_obj.h DESC LIMIT 1
Database: image_and_language
Note: DIVIDE(SUM(obj_sample_id where obj_class = 'airplane'), COUNT(obj_class)) as percentage;
Question: Calculate the percentage of "airplane" object class in the table.
SQL: SELECT cast(sum(CASE WHEN obj_classes.obj_class = 'airplane' THEN 1 ELSE 0 END) AS REAL) * 100 / count(obj_classes.obj_class) FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id
Database: image_and_language
Note: samples of animal objects refer to obj_sample_id where obj_class = 'animal'; image no.660 refers to img_id = 660;
Question: How many samples of animal objects are there in image no.660?
SQL: SELECT count(img_obj.img_id) FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE obj_classes.obj_class = 'animal' AND img_obj.img_id = 660
Database: image_and_language
Note: samples of "bed" object refer to obj_sample_id where obj_class = 'bed'; image No.1098 refers to img_id = 1098;
Question: Name number of samples of "bed" object are there in the image No.1098?
SQL: SELECT sum(CASE WHEN obj_classes.obj_class = 'bed' THEN 1 ELSE 0 END) FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE img_obj.img_id = 1098
Database: image_and_language
Note: 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);
Question: Name the object class of the image with lowest bounding box.
SQL: SELECT obj_classes.obj_class FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id ORDER BY img_obj.h LIMIT 1
Database: image_and_language
Note: 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;
Question: Indicating the bounding box of "kitchen" in image id 250.
SQL: SELECT img_obj.x, img_obj.y, img_obj.w, img_obj.h FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE img_obj.img_id = 250 AND obj_classes.obj_class = 'kitchen'
Database: image_and_language
Note: images have more than 20 object samples refer to img_id where COUNT(obj_sample_id) > 20;
Question: Which images have more than 20 object samples?
SQL: SELECT img_id FROM img_obj GROUP BY img_id HAVING count(img_id) > 20
Database: image_and_language
Note: 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;
Question: Which object in image 8 is the widest? State its object sample ID.
SQL: SELECT obj_sample_id FROM img_obj WHERE img_id = 8 ORDER BY w DESC LIMIT 1
Database: image_and_language
Note: 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;
Question: Find the object in image 5 where the object with the coordinate of (634, 468).
SQL: SELECT obj_sample_id FROM img_obj WHERE img_id = 5 AND x = 634 AND y = 468
Database: image_and_language
Note: object has the highest attribute classes refers to obj_sample_id where MAx(COUNT(obj_sample_id));
Question: Which object has the highest attribute classes?
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
Note: DIVIDE(SUM(obj_sample_id where img_id = 1), SUM(obj_sample_id where img_id = 6));
Question: What is the ratio between the number of object samples in image 1 and the number of object samples in image 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
Note: DIVIDE(COUNT(obj_sample_id), COUNT(img_id));
Question: Calculate the average of object samples for the image.
SQL: SELECT cast(count(obj_sample_id) AS REAL) / count(DISTINCT img_id) FROM img_obj
Database: image_and_language
Note: IDs of images refer to img_id; objects with the attributes of 'wired' refer to att_class = 'wired';
Question: List all the IDs of images that have objects with the attributes of 'wired'.
SQL: SELECT DISTINCT img_obj_att.img_id FROM att_classes INNER JOIN img_obj_att ON att_classes.att_class_id = img_obj_att.att_class_id WHERE att_classes.att_class = 'wired'
Database: image_and_language
Note: object classes refer to obj_class; image 10 refers to img_id = 10;
Question: List all the object classes in image 10.
SQL: SELECT DISTINCT obj_classes.obj_class FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE img_obj.img_id = 10
Database: image_and_language
Note: attributes for object refer to att_class; class 'tip' in image 1314 refers to obj_class = 'tip' where img_id = 1314;
Question: List attributes for object class 'tip' In image 1314.
SQL: SELECT att_classes.att_class FROM att_classes INNER JOIN img_obj_att ON att_classes.att_class_id = img_obj_att.att_class_id INNER JOIN img_obj ON img_obj_att.img_id = img_obj.img_id INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE img_obj.img_id = 1314 AND obj_classes.obj_class = 'tip'
Database: image_and_language
Note: 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;
Question: What is the prediction class between object class 'chain' and 'label' in image 2360078?
SQL: SELECT DISTINCT pred_classes.pred_class FROM img_rel INNER JOIN pred_classes ON pred_classes.pred_class_id = img_rel.pred_class_id INNER JOIN img_obj ON img_rel.img_id = img_obj.img_id AND img_rel.obj1_sample_id = img_obj.obj_sample_id INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE img_rel.img_id = 2360078 AND img_rel.obj1_sample_id = 15 OR img_rel.obj2_sample_id = 18
Database: image_and_language
Note: attributes of polka dot refer to att_class = 'polka dot'; images refer to img_id;
Question: How many images have objects with the attributes of polka dot?
SQL: SELECT count(img_obj_att.obj_sample_id) FROM att_classes INNER JOIN img_obj_att ON att_classes.att_class_id = img_obj_att.att_class_id WHERE att_classes.att_class = 'polka dot'
Database: image_and_language
Note: 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;
Question: What are the attributes of the widest object in image 400?
SQL: SELECT att_classes.att_class FROM att_classes INNER JOIN img_obj_att ON att_classes.att_class_id = img_obj_att.att_class_id INNER JOIN img_obj ON img_obj_att.img_id = img_obj.img_id WHERE img_obj_att.img_id = 400 ORDER BY img_obj.w DESC LIMIT 1
Database: image_and_language
Note: object class that has in most images refers to obj_class where MAx(COUNT(obj_class_id));
Question: State the name of the object class that has in most images.
SQL: SELECT obj_class FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id GROUP BY obj_classes.obj_class ORDER BY count(img_obj.obj_class_id) DESC LIMIT 1
Database: image_and_language
Note: 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;
Question: State the width and height of the object with the class of 'van' in image 1.
SQL: SELECT img_obj.h, img_obj.w FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE img_obj.img_id = 1 AND obj_classes.obj_class = 'van'
Database: image_and_language
Note: 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';
Question: State the coordinate of X and Y for the object with the attribute of 'sparse' in image 1.
SQL: SELECT img_obj.obj_sample_id, img_obj.x, img_obj.y FROM att_classes INNER JOIN img_obj_att ON att_classes.att_class_id = img_obj_att.att_class_id INNER JOIN img_obj ON img_obj_att.img_id = img_obj.img_id WHERE img_obj.img_id = 1 AND att_classes.att_class = 'sparse'
Database: image_and_language
Note: DIVIDE(COUNT(obj_sample_id where obj_class = 'street lights'), COUNT(obj_sample_id)) as percentage;
Question: Calculate the percentage of object samples that are related to street lights.
SQL: SELECT cast(sum(CASE WHEN obj_classes.obj_class = 'street lights' THEN 1 ELSE 0 END) AS REAL) * 100 / count(img_obj.obj_sample_id) FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id
Database: image_and_language
Note: DIVIDE(COUNT(obj_sample_id where obj_class = 'windows' and img_id = 5), COUNT(obj_sample_id where img_id = 5)) as percentage;
Question: Based on image 5, what is the percentage of images that belong windows object class?
SQL: SELECT cast(count(img_obj.obj_sample_id) AS REAL) * 100 / count(CASE WHEN img_obj.img_id = 5 THEN 1 ELSE 0 END) FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE obj_classes.obj_class = 'windows'
Database: image_and_language
Note: x and y refer to coordinates of the bounding box where x = 5 and y = 5; images refer to img_id;
Question: How many images have an x-coordinate of 5 and y-coordinate of 5?
SQL: SELECT count(img_id) FROM img_obj WHERE x = 5 AND y = 5
Database: image_and_language
Note: images refer to img_id; less than 15 object samples refer to COUNT(obj_sample_id) < 15;
Question: How many images have less than 15 object samples?
SQL: SELECT count(img_id) FROM img_obj WHERE obj_sample_id < 15
Database: image_and_language
Note: images refer to img_id; total of 10 attribute classes refers to COUNT(obj_class_id) = 10;
Question: How many images have a total of 10 attribute classes?
SQL: SELECT count(img_id) FROM img_obj WHERE obj_class_id = 10
Database: image_and_language
Note: 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;
Question: List the ID of all images with objects that 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
Note: images refer to img_id; "vegetables" and "fruits" as object classes refer to obj_class = 'vegetables' and obj_class = 'fruits';
Question: How many images have "vegetable" and "fruits" as their object classes?
SQL: SELECT count(img_obj.img_id) FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE obj_classes.obj_class = 'vegetables' OR obj_classes.obj_class = 'fruits'
Database: image_and_language
Note: predicted class of "parked on" refers to pred_class = 'parked on';
Question: What is the image ID with a predicted class of "parked on"?
SQL: SELECT DISTINCT img_rel.img_id FROM img_rel INNER JOIN pred_classes ON img_rel.pred_class_id = pred_classes.pred_class_id WHERE pred_classes.pred_class = 'parked on'
Database: image_and_language
Note: 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;
Question: List all the object classes of the images that have a (5,5) coordinate.
SQL: SELECT obj_classes.obj_class FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE img_obj.x = 5 AND img_obj.y = 5
Database: image_and_language
Note: images refer to img_id; "keyboard" as object class refers to obj_class = 'keyboard';
Question: How many images have "keyboard" as their object class?
SQL: SELECT count(img_obj.img_id) FROM img_obj INNER JOIN obj_classes ON img_obj.obj_class_id = obj_classes.obj_class_id WHERE obj_classes.obj_class = 'keyboard'