# Count in relational algebra using Ω = { π, σ, ⋈, ⋉, β, x, ∪, ∩ , - }

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?

• 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. – D.W. Apr 20 '16 at 14:20
• 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? – 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?