delete from PHOTOGRAPH where KEY_PERSON IS NULL AND KEY_NEXT IS NULL AND KEY_PREVIOUS IS NULL AND PHOTO_TYPE = 'USER';