I have the following situation: in a MEDICAL CONSULTATION I may have one or more SYMPTOMS. So I have a CONSULTA_SINTOMA table, making the connection between CONSULTA and SYMPTOM. A disease can be identified by one or more symptoms, so I have a table SYNDROME doing the link between DISEASE and SYMPTOM.
My problem: I can get all the symptom ids presented in a query in the query table. But how do you, from there, know all possible diseases? For example, if the symptoms presented in a query are: 1, 2, and 3. How do you know which illnesses are identified by these symptoms?