problem
stringlengths 121
422
| db_id
stringclasses 69
values | solution
stringlengths 23
804
|
---|---|---|
Write SQL query to solve given problem: What is the average pay rate of the employees who worked in the Engineering Departmentin 2007?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT AVG(T3.Rate) FROM EmployeeDepartmentHistory AS T1 INNER JOIN Department AS T2 ON T1.DepartmentID = T2.DepartmentID INNER JOIN EmployeePayHistory AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T2.Name = 'Engineering' AND STRFTIME('%Y', EndDate) > '2007' AND STRFTIME('%Y', T1.StartDate) < '2007' |
Write SQL query to solve given problem: How much more expensive in percentage is the product with the highest selling price from the product with the lowest selling price in the Clothing category?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT (MAX(T1.ListPrice) - MIN(T1.ListPrice)) * 100 / MIN(T1.ListPrice) FROM Product AS T1 INNER JOIN ProductSubcategory AS T2 ON T1.ProductSubcategoryID = T2.ProductSubcategoryID INNER JOIN ProductCategory AS T3 ON T2.ProductCategoryID = T3.ProductCategoryID WHERE T3.Name = 'Clothing' |
Write SQL query to solve given problem: Which product cost the least in 2013?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT ProductID FROM ProductCostHistory WHERE StartDate LIKE '2013%' ORDER BY StandardCost LIMIT 1 |
Write SQL query to solve given problem: What is the phone number of the person with id "12597"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT PhoneNumber FROM PersonPhone WHERE BusinessEntityID = 12597 |
Write SQL query to solve given problem: What is the price for the product with the id "912"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT ListPrice FROM ProductListPriceHistory WHERE ProductID = 912 |
Write SQL query to solve given problem: What is the thumbnail photo file for the product with the id "979"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T2.ThumbnailPhotoFileName FROM ProductProductPhoto AS T1 INNER JOIN ProductPhoto AS T2 ON T1.ProductPhotoID = T2.ProductPhotoID WHERE T1.ProductID = 979 |
Write SQL query to solve given problem: List all the names of the products with the price of more than 1000$.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT DISTINCT T2.Name FROM ProductListPriceHistory AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ListPrice > 1000 |
Write SQL query to solve given problem: What is the product with the most profit?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T1.ProductID FROM ProductListPriceHistory AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID ORDER BY T1.ListPrice - T2.StandardCost DESC LIMIT 1 |
Write SQL query to solve given problem: What is the name of the product stored in location 1 compartment L container 6?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T2.Name FROM ProductInventory AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.LocationID = 1 AND T1.Shelf = 'L' AND T1.Bin = 6 |
Write SQL query to solve given problem: What are locations of the work order "35493"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T2.Name FROM WorkOrderRouting AS T1 INNER JOIN Location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.WorkOrderID = 35493 |
Write SQL query to solve given problem: What are the products with a large photo?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T2.ProductID FROM ProductPhoto AS T1 INNER JOIN ProductProductPhoto AS T2 ON T1.ProductPhotoID = T2.ProductPhotoID WHERE T1.LargePhotoFileName LIKE '%large.gif' |
Write SQL query to solve given problem: With 100$, how many Cable Lock can you buy?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT 100 / T2.ListPrice FROM Product AS T1 INNER JOIN ProductListPriceHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Cable Lock' |
Write SQL query to solve given problem: What is the scrap reason for work order "57788"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T2.Name FROM WorkOrder AS T1 INNER JOIN ScrapReason AS T2 ON T1.ScrapReasonID = T2.ScrapReasonID WHERE T1.WorkOrderID = 57788 |
Write SQL query to solve given problem: How many products with the id "476" are stored in Metal Storage?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T2.Quantity FROM Location AS T1 INNER JOIN ProductInventory AS T2 ON T1.LocationID = T2.LocationID WHERE T2.ProductID = 476 AND T1.Name = 'Metal Storage' |
Write SQL query to solve given problem: What is the the percentage of profit for the product "858"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT (T1.ListPrice - T2.StandardCost) * 100 / T2.StandardCost FROM ProductListPriceHistory AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductID = 858 |
Write SQL query to solve given problem: How many products with a thumpnail photo?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT COUNT(ProductID) FROM ProductProductPhoto WHERE ProductPhotoID != 1 |
Write SQL query to solve given problem: How many days did it take to end the work order "425"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT 365 * (STRFTIME('%Y', ActualEndDate) - STRFTIME('%Y', ActualStartDate)) + 30 * (STRFTIME('%m', ActualEndDate) - STRFTIME('%m', ActualStartDate)) + STRFTIME('%d', ActualEndDate) - STRFTIME('%d', ActualStartDate) FROM WorkOrderRouting WHERE WorkOrderID = 425 |
Write SQL query to solve given problem: Which product has the highest price in 2012?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT ProductID FROM ProductListPriceHistory WHERE StartDate LIKE '2012%' ORDER BY ListPrice DESC LIMIT 1 |
Write SQL query to solve given problem: What is the cost for the product "847"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT StandardCost FROM ProductCostHistory WHERE ProductID = 847 |
Write SQL query to solve given problem: What is the cost and the product number of product with the id "888"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T2.StandardCost, T2.ProductNumber FROM ProductCostHistory AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductID = 888 |
Write SQL query to solve given problem: How many products using "roadster_black_small.gif" as the thumbnail photo?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT COUNT(DISTINCT T2.ProductID) FROM ProductPhoto AS T1 INNER JOIN ProductProductPhoto AS T2 ON T1.ProductPhotoID = T2.ProductPhotoID WHERE T1.LargePhotoFileName = 'roadster_black_large.gif' |
Write SQL query to solve given problem: List all the scraped work orders for handling damage reason.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T2.WorkOrderID FROM ScrapReason AS T1 INNER JOIN WorkOrder AS T2 ON T1.ScrapReasonID = T2.ScrapReasonID WHERE T1.Name = 'Handling damage' |
Write SQL query to solve given problem: What is the profit for the product "792"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T1.ListPrice - T2.StandardCost FROM ProductListPriceHistory AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductID = 792 |
Write SQL query to solve given problem: Who owns the email address "[email protected]"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T2.FirstName, T2.LastName FROM EmailAddress AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.EmailAddress = '[email protected]' |
Write SQL query to solve given problem: Where are the locations where the product "810" is stored?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T2.Name FROM ProductInventory AS T1 INNER JOIN Location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.ProductID = 810 |
Write SQL query to solve given problem: What is the name of the product the work order "2540" was making?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT T2.Name FROM WorkOrder AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.WorkOrderID = 2540 |
Write SQL query to solve given problem: What is the the average percentage of profit for the all the product?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT AVG((T1.ListPrice - T2.StandardCost) * 100 / T2.StandardCost) FROM ProductListPriceHistory AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID |
Write SQL query to solve given problem: What proportion of work order is in Subassembly?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | works_cycles | SELECT 100.0 * SUM(CASE WHEN T1.Name = 'Subassembly' THEN 1 ELSE 0 END) / COUNT(T2.WorkOrderID) FROM Location AS T1 INNER JOIN WorkOrderRouting AS T2 ON T1.LocationID = T2.LocationID |
Write SQL query to solve given problem: How many object samples are there in image no.1?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT COUNT(OBJ_SAMPLE_ID) FROM IMG_OBJ WHERE IMG_ID = 1 |
Write SQL query to solve given problem: How many images have over 20 object samples?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT COUNT(T1.IMG_ID) FROM ( SELECT IMG_ID FROM IMG_OBJ GROUP BY IMG_ID HAVING COUNT(OBJ_SAMPLE_ID) > 20 ) T1 |
Write SQL query to solve given problem: What is the ID of the image with the most number of object samples?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT IMG_ID FROM IMG_OBJ GROUP BY IMG_ID ORDER BY COUNT(OBJ_SAMPLE_ID) DESC LIMIT 1 |
Write SQL query to solve given problem: Please list the IDs of the object samples in class no. 297 in image no.1.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT OBJ_SAMPLE_ID FROM IMG_OBJ WHERE IMG_ID = 1 AND OBJ_CLASS_ID = 297 |
Write SQL query to solve given problem: How many self-relations are there between the object samples in image no.5?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT SUM(CASE WHEN IMG_ID = 5 THEN 1 ELSE 0 END) FROM IMG_REL WHERE OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID |
Write SQL query to solve given problem: What is the bounding box of the object sample in image no.5 that has a self-relation?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT T2.X, T2.Y, T2.W, T2.H FROM IMG_REL AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.IMG_ID = T2.IMG_ID WHERE T1.IMG_ID = 5 AND T1.OBJ1_SAMPLE_ID = T1.OBJ2_SAMPLE_ID |
Write SQL query to solve given problem: How many object samples in image no.1 are in the class of "man"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT SUM(CASE WHEN T1.OBJ_CLASS = 'man' THEN 1 ELSE 0 END) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 |
Write SQL query to solve given problem: How many images have at least one object sample in the class of "man"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT COUNT(T.IMG_ID) FROM ( SELECT T2.IMG_ID FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.OBJ_CLASS = 'man' GROUP BY T2.IMG_ID ) T |
Write SQL query to solve given problem: Please list the classes of all the object samples in image no.1.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT T1.OBJ_CLASS FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 GROUP BY T1.OBJ_CLASS |
Write SQL query to solve given problem: What is the relation between object sample no.8 and object sample no.4 in image no.1?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: How many pairs of object samples in image no.1 have the relation of "parked on"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: Please list all the predicted relation classes of object sample no.14 in image no.1.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: How many images have at least one pair of object samples with the relation "parked on"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: Please list the IDs of all the images with more than 2 pairs of object samples with the relation "parked on".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: To which predicted relation class does the self-relation of the object sample in image no.5 belong?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: What are the bounding boxes of the object samples with a predicted relation class of "by" in image no.1?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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' |
Write SQL query to solve given problem: What is the average difference in the y coordinate of 2 object samples with the relation "parked on" in image no.1?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: What is the percentage of the object samples in the class of "man" in image no.1?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: Give the bounding box of the kite in image no.2324765.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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' |
Write SQL query to solve given problem: How many white objects are there in image no.2347915?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: Give the number of samples in image no.2377985 whose attribute is electrical.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: What is the relationship between object sample no.12 and no.8 of image no.2345511?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: Give the object number of the sample which has the relationship of "lying on" with object sample no.1 from image no.2345524.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: How many samples of food object are there in image no.6?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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' |
Write SQL query to solve given problem: Give the number of images containing the object sample of "suit".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: What is the relationship between "feathers" and "onion" in image no.2345528?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: Tell the attribute of the weeds in image no.2377988.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: What is the object whose attribute is blurry in image no.2377993? Give the explanation about the object.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: How many samples of "wall" are there in image no.2353079?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: State the object class of sample no.10 of image no.2320341.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: How many times is the number of images containing "broccoli" than "tomato"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: How many images have at least 25 attributes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT COUNT(*) FROM ( SELECT IMG_ID FROM IMG_OBJ_att GROUP BY IMG_ID HAVING COUNT(ATT_CLASS_ID) > 25 ) T1 |
Write SQL query to solve given problem: How many objects are there in the attribute class id with the highest number of objects?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT COUNT(ATT_CLASS_ID) FROM IMG_OBJ_att GROUP BY IMG_ID ORDER BY COUNT(ATT_CLASS_ID) DESC LIMIT 1 |
Write SQL query to solve given problem: What are the id of all the objects belonging to the transportation class?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT OBJ_CLASS_ID FROM OBJ_CLASSES WHERE OBJ_CLASS IN ('bus', 'train', 'aeroplane', 'car', 'etc') |
Write SQL query to solve given problem: What are the corresponding classes for the "very large bike" attribute?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT ATT_CLASS_ID FROM ATT_CLASSES WHERE ATT_CLASS = 'very large' |
Write SQL query to solve given problem: What is the unique id number identifying the onion object class?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT OBJ_CLASS_ID FROM OBJ_CLASSES WHERE OBJ_CLASS = 'onion' |
Write SQL query to solve given problem: List all the corresponding classes for attributes of image id 8.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 WHERE T1.IMG_ID = 8 |
Write SQL query to solve given problem: What is the bounding box of the object with image id 4 and a prediction relationship class id of 144?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT T2.X, T2.Y, T2.W, T2.H FROM IMG_REL AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.IMG_ID = T2.IMG_ID WHERE T1.PRED_CLASS_ID = 144 AND T1.IMG_ID = 3 |
Write SQL query to solve given problem: How many images have at least 5 "black" classes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT COUNT(IMGID) FROM ( SELECT T1.IMG_ID AS IMGID FROM IMG_OBJ_att AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.ATT_CLASS = 'black' GROUP BY T1.IMG_ID HAVING COUNT(T1.ATT_CLASS_ID) >= 5 ) T3 |
Write SQL query to solve given problem: What is the prediction relationship class id of the tallest image?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT T1.PRED_CLASS_ID FROM IMG_REL AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.IMG_ID = T2.IMG_ID ORDER BY T2.H DESC LIMIT 1 |
Write SQL query to solve given problem: Which image has the highest number of "white" class attributes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT T1.IMG_ID AS IMGID FROM IMG_OBJ_att AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.ATT_CLASS = 'white' GROUP BY T1.IMG_ID ORDER BY COUNT(T1.ATT_CLASS_ID) DESC LIMIT 1 |
Write SQL query to solve given problem: What are the x and y coordinates of all the images with a prediction relationship class id of 98?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT T2.X, T2.Y FROM IMG_REL AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.IMG_ID = T2.IMG_ID WHERE T1.PRED_CLASS_ID = 98 |
Write SQL query to solve given problem: How many prediction classes with "has" captions are there for image id 3050?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT COUNT(T2.PRED_CLASS_ID) FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.IMG_ID = 3050 AND T2.PRED_CLASS = 'has' |
Write SQL query to solve given problem: List all the explanations about object classes of all the images with an x and y coordinate of 0.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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.X = 0 AND T2.Y = 0 GROUP BY T1.OBJ_CLASS |
Write SQL query to solve given problem: What are the captions of all the self-relation relationship prediction classes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT T2.PRED_CLASS FROM IMG_REL AS T1 INNER JOIN pred_classes AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.OBJ1_SAMPLE_ID = T1.OBJ2_SAMPLE_ID GROUP BY T2.PRED_CLASS |
Write SQL query to solve given problem: Give all the bounding boxes for image 2222 whose object classes are feathers.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT T2.X, T2.Y, T2.H, T2.W FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 2222 AND T1.OBJ_CLASS = 'feathers' |
Write SQL query to solve given problem: Among the objects that have multiple relations, how many images whose captions for the prediction class ids are "on"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT COUNT(T2.PRED_CLASS_ID) FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.OBJ1_SAMPLE_ID != T1.OBJ2_SAMPLE_ID AND T2.PRED_CLASS = 'on' |
Write SQL query to solve given problem: What is the object class of the image with a bounding box of 0, 0, 135, 212?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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.X = 0 AND T2.Y = 0 AND T2.W = 135 AND T2.H = 212 |
Write SQL query to solve given problem: Provide the dimensions of the bounding box that contains the keyboard that was spotted in image no. 3.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 T1.IMG_ID = 3 AND T2.OBJ_CLASS = 'keyboard' |
Write SQL query to solve given problem: Identify the border's coordinates on the X and Y axes that enclose a folk in image no. 6.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT 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 T1.IMG_ID = 6 AND T2.OBJ_CLASS = 'folk' |
Write SQL query to solve given problem: Define the onion's bounding box on image no. 285930.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 = 285930 AND T2.OBJ_CLASS = 'onion' |
Write SQL query to solve given problem: 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)?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT SUM(IIF(T1.IMG_ID = 1, 1, 0)), SUM(IIF(T1.X = 341 AND T1.Y = 27 AND T1.W = 42 AND T1.H = 51, 1, 0)) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID |
Write SQL query to solve given problem: On image no. 5, name the attributes that are composed of multiple objects.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 WHERE T1.IMG_ID = 5 GROUP BY T2.ATT_CLASS HAVING COUNT(T2.ATT_CLASS) > 2 |
Write SQL query to solve given problem: What attributes are used to describe the wall on image no. 27.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT T4.ATT_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID INNER JOIN IMG_OBJ_ATT AS T3 ON T1.IMG_ID = T3.IMG_ID INNER JOIN ATT_CLASSES AS T4 ON T3.ATT_CLASS_ID = T4.ATT_CLASS_ID WHERE T2.OBJ_CLASS = 'wall' AND T1.IMG_ID = 27 GROUP BY T4.ATT_CLASS |
Write SQL query to solve given problem: Name the object element that is described as being scattered on image no. 10.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID INNER JOIN IMG_OBJ_ATT AS T3 ON T1.IMG_ID = T3.IMG_ID INNER JOIN ATT_CLASSES AS T4 ON T3.ATT_CLASS_ID = T4.ATT_CLASS_ID WHERE T4.ATT_CLASS = 'scattered' AND T1.IMG_ID = 10 GROUP BY T2.OBJ_CLASS |
Write SQL query to solve given problem: How many images contain 'bridge' as an object element?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 = 'bridge' |
Write SQL query to solve given problem: What colour is the van that can be spotted in image no. 1?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT T4.ATT_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID INNER JOIN IMG_OBJ_ATT AS T3 ON T1.IMG_ID = T3.IMG_ID INNER JOIN ATT_CLASSES AS T4 ON T3.ATT_CLASS_ID = T4.ATT_CLASS_ID WHERE T2.OBJ_CLASS = 'van' AND T1.IMG_ID = 1 GROUP BY T4.ATT_CLASS |
Write SQL query to solve given problem: 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).. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT DISTINCT T2.OBJ_CLASS, T4.ATT_CLASS, T6.PRED_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID INNER JOIN IMG_OBJ_ATT AS T3 ON T1.IMG_ID = T3.IMG_ID INNER JOIN ATT_CLASSES AS T4 ON T3.ATT_CLASS_ID = T4.ATT_CLASS_ID INNER JOIN IMG_REL AS T5 ON T1.IMG_ID = T5.IMG_ID INNER JOIN PRED_CLASSES AS T6 ON T5.PRED_CLASS_ID = T6.PRED_CLASS_ID WHERE T1.IMG_ID = 1 AND T1.X = 388 AND T1.Y = 369 AND T1.W = 48 AND T1.H = 128 |
Write SQL query to solve given problem: What is the relationship between object sample no. 25 and object sample no. 2 on image no. 1?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT T2.PRED_CLASS FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.IMG_ID = 1 AND T1.OBJ1_SAMPLE_ID = 25 AND T1.OBJ2_SAMPLE_ID = 2 |
Write SQL query to solve given problem: How many attributes are related to the object sample no. 7 on image no. 4?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT COUNT(ATT_CLASS_ID) FROM IMG_OBJ_ATT WHERE IMG_ID = 4 AND OBJ_SAMPLE_ID = 7 |
Write SQL query to solve given problem: How many object elements can be detected on image no. 31?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT COUNT(OBJ_CLASS_ID) FROM IMG_OBJ WHERE IMG_ID = 31 |
Write SQL query to solve given problem: On image no. 20, identify the attribute ID that is composed of the highest number of objects.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: Define the bounding box of the object sample no. 7 on image no. 42.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT X, Y, W, H FROM IMG_OBJ WHERE IMG_ID = 42 AND OBJ_SAMPLE_ID = 7 |
Write SQL query to solve given problem: On image no. 99 identify the percentage of objects that are described as white.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: How many attribute classes are there for image id 5?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT COUNT(ATT_CLASS_ID) FROM IMG_OBJ_ATT WHERE IMG_ID = 5 |
Write SQL query to solve given problem: State the explanation about object class 10.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT OBJ_CLASS FROM OBJ_CLASSES WHERE OBJ_CLASS_ID = 10 |
Write SQL query to solve given problem: Name the object class of the image with a bounding (422, 63, 77, 363).. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: What is the caption for the prediction class id 12?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT PRED_CLASS FROM PRED_CLASSES WHERE PRED_CLASS_ID = 12 |
Write SQL query to solve given problem: Indicate the bounding box of the image 8.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | SELECT X, Y, W, H FROM IMG_OBJ WHERE IMG_ID = 8 |
Write SQL query to solve given problem: How many object samples in image no.908 are in the class of tip?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: List out the number of object samples in image no.41 which are in the class of "kitchen"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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 |
Write SQL query to solve given problem: Count the image numbers that contain the "paint" object.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | image_and_language | 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' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.