problem
stringlengths
121
422
db_id
stringclasses
69 values
solution
stringlengths
23
804
Write SQL query to solve given problem: How many samples of clouds are there in the image no.2315533?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
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'
Write SQL query to solve given problem: Which object classes belong to the onion category?. 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: What is the bounding box of "spoon" in image id 1344?. 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 = 1344 AND T2.OBJ_CLASS = 'spoon'
Write SQL query to solve given problem: What is the percentage of "surface" object samples in image No.2654?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
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
Write SQL query to solve given problem: How many images include the "wood" objects?. 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 = 'wood'
Write SQL query to solve given problem: State the object class of the image with tallest bounding box.. 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 ORDER BY T1.H DESC LIMIT 1
Write SQL query to solve given problem: Calculate the percentage of "airplane" object class in the table.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
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
Write SQL query to solve given problem: How many samples of animal objects are there in image no.660?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
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
Write SQL query to solve given problem: Name number of samples of "bed" object are there in the image No.1098?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
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
Write SQL query to solve given problem: Name the object class of the image with lowest bounding box.. 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 ORDER BY T1.H LIMIT 1
Write SQL query to solve given problem: Indicating the bounding box of "kitchen" in image id 250.. 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 = 250 AND T2.OBJ_CLASS = 'kitchen'
Write SQL query to solve given problem: Which images have more than 20 object samples?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT IMG_ID FROM IMG_OBJ GROUP BY IMG_ID HAVING COUNT(IMG_ID) > 20
Write SQL query to solve given problem: Which object in image 8 is the widest? State its object sample ID.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT OBJ_SAMPLE_ID FROM IMG_OBJ WHERE IMG_ID = 8 ORDER BY W DESC LIMIT 1
Write SQL query to solve given problem: Find the object in image 5 where the object with the coordinate of (634, 468).. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT OBJ_SAMPLE_ID FROM IMG_OBJ WHERE IMG_ID = 5 AND X = 634 AND Y = 468
Write SQL query to solve given problem: Which object has the highest attribute classes?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT OBJ_SAMPLE_ID FROM IMG_OBJ_ATT GROUP BY OBJ_SAMPLE_ID ORDER BY COUNT(OBJ_SAMPLE_ID) DESC LIMIT 1
Write SQL query to solve given problem: What is the ratio between the number of object samples in image 1 and the number of object samples in image 6?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
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
Write SQL query to solve given problem: List all the IDs of images that have objects with the attributes of 'wired'.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
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'
Write SQL query to solve given problem: List all the object classes in image 10.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
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
Write SQL query to solve given problem: List attributes for object class 'tip' In image 1314.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
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'
Write SQL query to solve given problem: What is the prediction class between object class 'chain' and 'label' in image 2360078?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
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
Write SQL query to solve given problem: How many images have objects with the attributes of polka dot?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
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'
Write SQL query to solve given problem: What are the attributes of the widest object in image 400?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT T1.ATT_CLASS FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID WHERE T2.IMG_ID = 400 ORDER BY T3.W DESC LIMIT 1
Write SQL query to solve given problem: State the name of the object class that has in most images.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID GROUP BY T2.OBJ_CLASS ORDER BY COUNT(T1.OBJ_CLASS_ID) DESC LIMIT 1
Write SQL query to solve given problem: State the width and height of the object with the class of 'van' in image 1.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT T1.H, T1.W FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 1 AND T2.OBJ_CLASS = 'van'
Write SQL query to solve given problem: State the coordinate of X and Y for the object with the attribute of 'sparse' in image 1.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT T3.OBJ_SAMPLE_ID, T3.X, T3.Y FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID WHERE T3.IMG_ID = 1 AND T1.ATT_CLASS = 'sparse'
Write SQL query to solve given problem: Calculate the percentage of object samples that are related to street lights.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT CAST(SUM(CASE WHEN T2.OBJ_CLASS = 'street lights' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.OBJ_SAMPLE_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID
Write SQL query to solve given problem: Based on image 5, what is the percentage of images that belong windows object class?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT CAST(COUNT(T1.OBJ_SAMPLE_ID) AS REAL) * 100 / COUNT(CASE WHEN T1.IMG_ID = 5 THEN 1 ELSE 0 END) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'windows'
Write SQL query to solve given problem: How many images have an x-coordinate of 5 and y-coordinate of 5?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT COUNT(IMG_ID) FROM IMG_OBJ WHERE X = 5 AND Y = 5
Write SQL query to solve given problem: How many images have less than 15 object samples?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT COUNT(IMG_ID) FROM IMG_OBJ WHERE OBJ_SAMPLE_ID < 15
Write SQL query to solve given problem: How many images have a total of 10 attribute classes?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT COUNT(IMG_ID) FROM IMG_OBJ WHERE OBJ_CLASS_ID = 10
Write SQL query to solve given problem: List the ID of all images with objects that have multiple relations.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
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
Write SQL query to solve given problem: How many images have "vegetable" and "fruits" as their object classes?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT COUNT(T1.IMG_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'vegetables' OR T2.OBJ_CLASS = 'fruits'
Write SQL query to solve given problem: What is the image ID with a predicted class of "parked on"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT DISTINCT T1.IMG_ID FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.PRED_CLASS = 'parked on'
Write SQL query to solve given problem: List all the object classes of the images that have a (5,5) coordinate.. 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 = 5 AND T1.Y = 5
Write SQL query to solve given problem: How many images have "keyboard" as their object class?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT COUNT(T1.IMG_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'keyboard'
Write SQL query to solve given problem: What are the width and height of the bounding box of the object with "keyboard" as their object class and (5, 647) as their coordinate?. 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 T2.OBJ_CLASS = 'keyboard' AND T1.X = 5 AND T1.Y = 647
Write SQL query to solve given problem: List all the ID of the images that have an attribute class of "horse".. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT T2.IMG_ID FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.ATT_CLASS = 'horse'
Write SQL query to solve given problem: Provide the x-coordinate and y-coordinate of the image with an attribute class of ''horse" and an object class of "fur".. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT T3.X, T3.Y FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE T1.ATT_CLASS = 'horse' AND T4.OBJ_CLASS = 'fur'
Write SQL query to solve given problem: List all the attribute classes of the image ID "15".. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT T1.ATT_CLASS FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.IMG_ID = 15
Write SQL query to solve given problem: For those objects that have multiple relations, how many images have a prediction class of "reading"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT COUNT(T1.IMG_ID) FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.PRED_CLASS = 'reading'
Write SQL query to solve given problem: How many images have "picture" as their attribute class?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT COUNT(T2.IMG_ID) FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.ATT_CLASS = 'picture'
Write SQL query to solve given problem: How many images have "picture" as their attribute class and "bear" as their object class?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT COUNT(T2.IMG_ID) FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE T1.ATT_CLASS = 'picture' AND T4.OBJ_CLASS = 'bear'
Write SQL query to solve given problem: List all the attribute classes of the images that have a (5,5) coordinate.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT T1.ATT_CLASS FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID WHERE T3.X = 5 AND T3.Y = 5
Write SQL query to solve given problem: Calculate the average number of images with an attribute class of "keyboard".. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT AVG(T1.IMG_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'keyboard'
Write SQL query to solve given problem: Calculate the ratio of the total number of images with an object class of "man" and "person".. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT CAST(COUNT(CASE WHEN T2.OBJ_CLASS = 'man' THEN 1 ELSE 0 END) AS REAL) / COUNT(CASE WHEN T2.OBJ_CLASS = 'person' THEN 1 ELSE 0 END) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID
Write SQL query to solve given problem: List the object sample IDs of image ID 17 with coordinates (0,0).. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT OBJ_SAMPLE_ID FROM IMG_OBJ WHERE IMG_ID = 17 AND X = 0 AND Y = 0
Write SQL query to solve given problem: List all bounding box widths and heights of object sample ID 2.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT W, H FROM IMG_OBJ WHERE OBJ_SAMPLE_ID = 2
Write SQL query to solve given problem: In the Y coordinate of image ID 12, how many are 0?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT COUNT(IMG_ID) FROM IMG_OBJ WHERE IMG_ID = 12 AND Y = 0
Write SQL query to solve given problem: List all the attribute classes of image ID 22.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT T1.ATT_CLASS FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.IMG_ID = 22
Write SQL query to solve given problem: List the object classes of image ID 36 with coordinates (0,0).. 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.IMG_ID = 36 AND T1.X = 0 AND T1.Y = 0
Write SQL query to solve given problem: Write 10 coordinates with the object class "pizza.". Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT T1.IMG_ID, T1.X, T1.Y FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'pizza' LIMIT 10
Write SQL query to solve given problem: What object class is in the X and Y coordinates of 126 and 363?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT T1.IMG_ID, 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 = 126 AND T1.Y = 363
Write SQL query to solve given problem: What is the most common object class of image ID 56?. 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.IMG_ID = 56 GROUP BY T2.OBJ_CLASS ORDER BY COUNT(T2.OBJ_CLASS_ID) DESC LIMIT 1
Write SQL query to solve given problem: Write the object classes of image ID 22 alongside the object's width and height.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT T1.W, T1.H, 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 = 22
Write SQL query to solve given problem: What is the predicate class of image ID 68?. 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 = 68
Write SQL query to solve given problem: How many 'has' predicate classes does image ID 107 have?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT COUNT(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 = 107 AND T2.PRED_CLASS = 'has'
Write SQL query to solve given problem: Name the most common predicate class of image ID 4434.. 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 = 4434 ORDER BY T2.PRED_CLASS DESC LIMIT 1
Write SQL query to solve given problem: Count the number of 'dress' object classes and include their X and Y coordinates in image ID 1764.. 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 = 1764 AND T2.OBJ_CLASS = 'dress'
Write SQL query to solve given problem: Give the X and Y coordinates of the sample object of image ID 23 that has the 'cast' attribute class.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT T3.OBJ_SAMPLE_ID, T3.X, T3.Y FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID WHERE T3.IMG_ID = 23 AND T1.ATT_CLASS = 'cast'
Write SQL query to solve given problem: How many 'blue' attribute classes are there on image ID 2355735?. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT COUNT(T1.ATT_CLASS) FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.IMG_ID = 2355735 AND T1.ATT_CLASS = 'blue'
Write SQL query to solve given problem: What is the average width and height of the objects in image ID 47? List their object classes as well.. Keep the solution inside sql tag ```sql [SQL-Query] ```
image_and_language
SELECT T2.OBJ_CLASS, AVG(T1.W), AVG(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 = 47 GROUP BY T2.OBJ_CLASS
Write SQL query to solve given problem: List the first Name and last name of all players not from USA and who are born in 1990 .. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT firstName, lastName FROM Master WHERE birthYear = 1990 AND birthCountry != 'USA'
Write SQL query to solve given problem: List all players' given name who are good at both left and right hand and playing the forward position.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT nameGiven FROM Master WHERE shootCatch IS NULL AND pos = 'F'
Write SQL query to solve given problem: Who is the youngest player who is still living. State the given name and date of birth.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT nameGiven , nameGiven , birthYear, birthMon, birthDay FROM Master WHERE deathYear IS NULL ORDER BY birthYear DESC, birthMon DESC, birthday DESC LIMIT 1
Write SQL query to solve given problem: Name the goalies who played for more than two teams from Year 2000 to 2005.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year >= 2000 AND T2.year <= 2005 GROUP BY T2.playerID HAVING COUNT(DISTINCT T2.tmID) > 2
Write SQL query to solve given problem: What is the average weight of players who have height greater than 72 inches.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT AVG(weight) FROM Master WHERE height > 72
Write SQL query to solve given problem: Name the goalies who have played more than total of 5000 minutes in the all the season played. State given name of the player and from which country was he born.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T1.nameGiven, T1.birthCountry FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID GROUP BY T1.nameGiven, T1.birthCountry HAVING SUM(T2.Min) > 5000
Write SQL query to solve given problem: Name the goaltenders who had played in both PCHA and NHL league.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.lgID IN ('PCHA', 'NHL') GROUP BY T2.playerID HAVING COUNT(DISTINCT T2.lgID) > 1
Write SQL query to solve given problem: List all deceased goalies by last name. List the season where he had the most time played.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.playerID, T2.year, Min FROM Master AS T1 INNER JOIN Goalies AS T2 ON T2.playerID = T1.playerID WHERE T1.deathYear IS NOT NULL ORDER BY T2.Min DESC LIMIT 1
Write SQL query to solve given problem: List all goalies from year 2000 to 2010 for team COL. State their given name, height, weight and age of today.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.nameGiven, T1.height , T1.weight, STRFTIME('%Y', CURRENT_TIMESTAMP) - birthYear FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.tmID = 'COL' AND T2.year >= 2000 AND T2.year <= 2010 GROUP BY T1.playerID
Write SQL query to solve given problem: Name all goalies with 10 or more empty net goals. Name the players and season where he played.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.firstName, T1.lastName , T2.year FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.ENG >= 10
Write SQL query to solve given problem: State the goalie who has the lowest percentage of goals against among all the shots against recorded. Name the players and season where he played.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.firstName, T1.lastName, T2.year FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE CAST(T2.GA AS REAL) / T2.SA IS NOT NULL ORDER BY CAST(T2.GA AS REAL) / T2.SA LIMIT 1
Write SQL query to solve given problem: List all goalies who played in the year 2005 season and shorter than 72 inches. List all the team names he play for.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T1.firstName, T1.lastName, T3.name FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T2.tmID = T3.tmID WHERE T2.year = 2005 AND T1.height < 72
Write SQL query to solve given problem: State the nick name of player ID 'aubinje01'. List all the teams and season he played for.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T1.nameNick, T3.year, T3.name FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T2.tmID = T3.tmID WHERE T1.playerID = 'aubinje01'
Write SQL query to solve given problem: Name the goalies with the most seasons played. State the average time he played for each season.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.firstName, T1.lastName, T2.year, AVG(T2.Min) FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T1.playerID = ( SELECT playerID FROM Goalies GROUP BY playerID ORDER BY COUNT(playerID) DESC LIMIT 1 ) GROUP BY T1.firstName, T1.lastName, T2.year
Write SQL query to solve given problem: Name the goalie and the season he played where he had 5% shutouts among the number of goals recorded while the goalie was on the ice.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T1.firstName, T1.lastName, T2.year FROM Master AS T1 INNER JOIN ( SELECT playerID, year FROM Goalies WHERE CAST(SHO AS REAL) / GA > 0.05 ) AS T2 ON T2.playerID = T1.playerID
Write SQL query to solve given problem: List the living players who have two positions. State their given name the position they play.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT firstName, lastName, pos FROM Master WHERE deathYear IS NULL AND pos LIKE '%/%'
Write SQL query to solve given problem: State the nick name of the tallest player? If the player had left NHL, mention the last season he was with NHL.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT nameNick, lastNHL FROM Master ORDER BY height DESC LIMIT 1
Write SQL query to solve given problem: What is the average height of player who were born in 1990 and after? Compare the average height with players who were born before 1990.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT AVG(IIF(birthYear < 1990, height, NULL)) - AVG(IIF(birthYear >= 1990, height, NULL)) FROM Master
Write SQL query to solve given problem: Name the goalies who are good at left hand and also has become a coach after retirement. Name all teams he had played before.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT firstName, lastName, T3.name FROM Goalies AS T1 INNER JOIN Master AS T2 ON T2.playerID = T1.playerID INNER JOIN Teams AS T3 ON T1.lgID = T3.lgID WHERE T1.playerID IS NOT NULL AND T2.coachID IS NOT NULL AND T2.shootCatch = 'L' AND T2.pos = 'G'
Write SQL query to solve given problem: List all the deceased goalies and the teams he had played whose birth country was in Canada.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT firstName, lastName, T3.name FROM Goalies AS T1 INNER JOIN Master AS T2 ON T2.playerID = T1.playerID INNER JOIN Teams AS T3 ON T1.lgID = T3.lgID WHERE T2.birthCountry = 'Canada' AND T2.deathYear IS NOT NULL AND T2.pos = 'G'
Write SQL query to solve given problem: Name the goalies and season they played when Boston Bruins won number 1 in rank.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.firstName, T1.lastName, T3.year FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T2.year = T3.year AND T2.tmID = T3.tmID WHERE T1.deathYear IS NOT NULL AND T3.name = 'Boston Bruins' AND T3.rank = 1 AND T1.pos = 'G'
Write SQL query to solve given problem: Among all goalies who are still alive, whose first season in NHL in before 1950. List the team names they were in.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T3.name FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T2.lgID = T3.lgID AND T2.year = T3.year WHERE T1.deathYear IS NOT NULL AND T1.firstNHL < 1950
Write SQL query to solve given problem: For all players who becomes coach after retirement, state the given name of coach and which teams and years did they coach?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T2.nameGiven, T3.name, T3.year FROM Coaches AS T1 INNER JOIN Master AS T2 ON T2.coachID = T1.coachID INNER JOIN Teams AS T3 ON T1.lgID = T3.lgID WHERE T2.playerID IS NOT NULL AND T2.coachID IS NOT NULL
Write SQL query to solve given problem: Among the coaches who was never a player, who has highest percentage of game winning? Provide the given name of the coach and team he coached.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.nameGiven, T3.name FROM Coaches AS T1 INNER JOIN Master AS T2 ON T2.coachID = T1.coachID INNER JOIN Teams AS T3 ON T1.lgID = T3.lgID WHERE T1.coachID IS NOT NULL ORDER BY CAST(T1.w AS REAL) / T1.g DESC LIMIT 1
Write SQL query to solve given problem: Which coach has the best performance for team DET in history? What was the winning percentage? Name the coach and the year he coached.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT CAST(T2.W AS REAL) / T2.G, T1.firstName, T1.lastName, T2.year FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID INNER JOIN ( SELECT coachID FROM Coaches ORDER BY CAST(w AS REAL) / g DESC LIMIT 1 ) AS T3 ON T2.coachID = T3.coachID
Write SQL query to solve given problem: Who is the coach who had coached the the most seasons in MTL? State his given name, date of birth and all teams he had coaches before.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.nameGiven , T2.birthYear, T2.birthMon, T2.birthDay, T3.name FROM Goalies AS T1 INNER JOIN Master AS T2 ON T2.playerID = T1.playerID INNER JOIN Teams AS T3 ON T3.lgID = T1.lgID WHERE T3.tmID = 'MTL' GROUP BY T2.nameGiven, T2.birthYear, T2.birthMon, T2.birthDay, T3.name ORDER BY COUNT(T2.coachID) DESC LIMIT 1
Write SQL query to solve given problem: List all goalies with more lost than won games for two seasons or more. State the name of the player and team he played.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T1.firstName, T1.lastName, T3.name FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T2.year = T3.year AND T2.tmID = T3.tmID WHERE T1.pos = 'G' AND T2.L > T2.W GROUP BY T1.firstName, T1.lastName, T3.name HAVING COUNT(T3.year) > 2
Write SQL query to solve given problem: For all the goalies born in year 1987, who are good in both right hand and left hand? Calculate his percentage of winning for every season he played.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.firstName, T1.lastName, T2.year, CAST(T2.W AS REAL) / T2.GP FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T1.birthYear = 1987 AND T1.shootCatch IS NULL
Write SQL query to solve given problem: What is given name for player 'aebisda01'. Calculate the average time in minutes for the all his games played as goaltender.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.nameGiven, CAST(SUM(T2.Min) AS REAL) / SUM(T2.GP) FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T1.playerID = 'aebisda01' GROUP BY T1.nameGiven
Write SQL query to solve given problem: List all living goalies who have greater than 50% wins among all games played. State their last name and first name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T1.deathYear IS NOT NULL GROUP BY T1.playerID HAVING CAST(SUM(T2.Min) AS REAL) / SUM(T2.GP) > 0.5
Write SQL query to solve given problem: How many players and coaches are awarded after death?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(note) FROM AwardsMisc WHERE note IS NOT NULL
Write SQL query to solve given problem: Among the players who won an award in the year 1983, how many of them play the position of goalie?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(playerID) FROM AwardsPlayers WHERE pos = 'G' AND year = 1983
Write SQL query to solve given problem: How many coaches worked a temporary term in the year 2007?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(coachID) FROM Coaches WHERE year = 2007 AND notes = 'interim'
Write SQL query to solve given problem: How many shoutouts are there in the regular season of 1977?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(year) FROM CombinedShutouts WHERE year = 1977 AND `R/P` = 'R'
Write SQL query to solve given problem: How many teams scored against their opponent who had pulled their goalie in the year 2005?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(tmID) FROM Goalies WHERE year = 2005 AND ENG IS NULL
Write SQL query to solve given problem: Please list the years in which the NHL League had shots recorded while the goalie was on the ice.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT year FROM Goalies WHERE lgID = 'NHL' AND SA IS NOT NULL
Write SQL query to solve given problem: Please list the name of the person who was in the Hall of Fame in the year 1978.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT name FROM HOF WHERE year = 1978
Write SQL query to solve given problem: How many people were in the Hall of Fame's Builder category?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(hofID) FROM HOF WHERE category = 'Builder'
Write SQL query to solve given problem: Among the people who got into the Hall of Fame after the year 1980, how many of them belong to the category of "Player"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(hofID) FROM HOF WHERE year > 1980 AND category = 'Player'