schema(author)={name, newspaper}

The table contains a list of authors. Each author works for a newspaper. So a single newspaper may employ multiple authors. How can I get the names of the newspapers that have at least two authors working for them? My algebra consists of:

Ω = { π, σ, ⋈, ⋉, β, x, ∪, ∩ , - }

There is no count in the algebra. So I am limited to the above Ω. Any ideas how I can implement counting?

  • $\begingroup$ What have you tried? Where did you get stuck? e do not want to just do your exercise for you; we want you to gain understanding. However, as it is we do not know what your underlying problem is, so we can not begin to help. $\endgroup$ – D.W. Apr 20 '16 at 14:20
  • $\begingroup$ This is a nice example of an XY problem: you think you need counting, when you don't. Related: at the beach someone asks you whether there are at least two grains of sand. Would you count them all? $\endgroup$ – chi Apr 20 '16 at 16:18

Hint: to express "the set $S$ has size $\ge 1$" in propositional logic (without using the "size" operator), you can write $\exists x . x \in S$. How would you express "the set $S$ has size $\ge 2$"? Does that give you any ideas for how to use relational algebra to solve your question?

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.