To add a query based on the relationship between 2 or more tables, some relaitonship must already exist, or one needs to be created.  In com_generic, I currenly have 2 tables.