-1

There exists a database as follows:

Senator (name, state, party)

Contribution (SSN, donator, amount)

RichPerson (SSN, name, party)

How do I describe the following using relational algebra: A query which finds the names of the republican senators who have received contributions of more than $100,000 from a rich person who is a democrat.

So far, I'm thinking π names (σ party = "republican") (Senator) ⋈ (σ amount > 100000) (Contribution) ⋈ (social security number [SSN] selected from both rich person and contributions - this is where I get super stuck).

  • 1
    Something is missing. In the Contribution's table are you sure there is no link (foreign key) to Senator. Can you give us a sample for each table ? – devoh Feb 13 '17 at 19:09
  • Check your theta conditions. – Chris Travers Feb 13 '17 at 19:20
  • You must tell us what rows go in the tables. Eg for Contributions "person with SSN *SSN* has a dog named *donator* that prefes dog food called *amount*"? That's just a guess. Ok a bad guess. But if you don't tell us, we're just guessing. We have only your names, your natural language query and common sense to help us. And common sense suggests "donator" is supposed to be something that identifies a senator name since otherwise the query cannot be answered from this. Please give a *predicate* (sentence template) like I did for each table. Start answering by finding one for your query. – philipxy Feb 13 '17 at 22:06
  • Please see [this answer](https://stackoverflow.com/a/42193358/3404097) from yesterday. And [this](http://stackoverflow.com/a/41800639/3404097). Give your table meanings/predicates. – philipxy Feb 14 '17 at 01:49

0 Answers0