select DISTINCT table0.person_name, table5.animal_name
from table1
INNER JOIN table0, table5
on table1.person_id=table0.person_id
and
table1.animal_id=table5.animal_id
where table1.aa=input1
and table1.bb=input2
and table1.cc=input3
and table1.dd=input4
2 base tables, 1 table which stores the relation between them with a fex extra attributes
taking fex extra attributes value as user input, based on that extracting raletion from relation table.
this information has the id of the main values (person and animal) not the names
i want to display the names on screen
like
according to the input u gave the records which found are this person has this animal with him
help
thankyou