-- Database schema
| ATT_CLASSES : ATT_CLASS_ID [ INTEGER ] primary_key , ATT_CLASS [ TEXT ] | OBJ_CLASSES : OBJ_CLASS_ID [ INTEGER ] primary_key , OBJ_CLASS [ TEXT ] | IMG_OBJ : IMG_ID [ INTEGER ] , OBJ_SAMPLE_ID [ INTEGER ] , OBJ_CLASS_ID [ INTEGER ] IMG_OBJ.OBJ_CLASS_ID = OBJ_CLASSES.OBJ_CLASS_ID , X [ INTEGER ] , Y [ INTEGER ] , W [ INTEGER ] , H [ INTEGER ] | IMG_OBJ_ATT : IMG_ID [ INTEGER ] IMG_OBJ_ATT.IMG_ID = IMG_OBJ.IMG_ID , ATT_CLASS_ID [ INTEGER ] IMG_OBJ_ATT.ATT_CLASS_ID = ATT_CLASSES.ATT_CLASS_ID , OBJ_SAMPLE_ID [ INTEGER ] IMG_OBJ_ATT.OBJ_SAMPLE_ID = IMG_OBJ.OBJ_SAMPLE_ID | PRED_CLASSES : PRED_CLASS_ID [ INTEGER ] primary_key , PRED_CLASS [ TEXT ] | IMG_REL : IMG_ID [ INTEGER ] IMG_REL.IMG_ID = IMG_OBJ.IMG_ID , PRED_CLASS_ID [ INTEGER ] IMG_REL.PRED_CLASS_ID = PRED_CLASSES.PRED_CLASS_ID , OBJ1_SAMPLE_ID [ INTEGER ] IMG_REL.OBJ1_SAMPLE_ID = IMG_OBJ.OBJ_SAMPLE_ID , OBJ2_SAMPLE_ID [ INTEGER ] IMG_REL.OBJ2_SAMPLE_ID = IMG_OBJ.OBJ_SAMPLE_ID |
-- -- How many images have at least one pair of object samples with the relation "parked on"?

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;