Updated SQL definition for related item