How many images have at least 25 attributes?
images refers to IMG_ID; have at least 25 attributes refers to count(ATT_CLASS_ID) > = 25
SELECT COUNT(*) FROM ( SELECT IMG_ID FROM IMG_OBJ_att GROUP BY IMG_ID HAVING COUNT(ATT_CLASS_ID) > 25 ) T1