I am trying to write the RELATIONAL ALGEBRA statement for a query defined as follows:(adsbygoogle = window.adsbygoogle || []).push({});

"Find the diseases for which there is only one medication"

I have a table TREATMENT with two attributes, DISEASE & MEDICATION

TREATMENT (disease, medication)

This table holds a list of diseases and corresponding medication, of course for each diseases that can potentially be multiple medications, and for some only one. For example assume you have something that resembles the following:

Disease | Medication

--------------------

FLU | med1

FLU | med2

CANCER | med3

HIV | med4

FLU | med5

In this case you would expect to get CANCER & HIV (as they only have 1 corresponding medication) whereas FLU would be excluded because it has 3... (etc...)

Any help would be greatly appreciated...

Thanks,

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Relational Algebra of a Query

Loading...

Similar Threads - Relational Algebra Query | Date |
---|---|

B Relative Motion concept | Mar 9, 2018 |

B Functions and Relations | Jan 25, 2018 |

I Distinguishing things by relations | Oct 5, 2017 |

What is the situation of relational algebra? | Jul 25, 2015 |

Algebra's Related Rates examples | Dec 1, 2006 |

**Physics Forums - The Fusion of Science and Community**