select distinct q.question, a.answer
from question q, answer a, questioncat qc category c, catentity ce, address ad
where q.question_id = qc.question_id
and qc.catid = c.catid
and c.catname (???) = ce.cat
and ce.entity = ad.entityid
and a.address_id = ad.addressid
and q.question_id = a.question_id;
The above should give you all relevant questions that have been answered.
select distinct q.question, null
from question q, questioncat qc category c, catentity ce, address ad
where q.question_id = qc.question_id
and qc.catid = c.catid
and c.catname (???) = ce.cat
and ce.entity = ad.entityid
and a.address_id = ad.addressid
and q.question_id not in (select a.question_id from answer a);
This should give you all the relevant questions that have NOT been answered.
Union the two statements, and you should get what you want, or am I missing something here?