How do I formulate "at most" in domain relational calculus?
Example queries:
Dish: dish_id, name
Have: dish_id, ing_id
Ingredient: ing_id, name
What are the names of ingredients included in at most two dishes?
What are the names of ingredients included in at most one dish?
There exist at least N ids when/iff there exist N ids.
There exist at most N ids when/iff NOT there exist N+1 ids.
There exist exactly N ids when/iff there exist (at least) N ids and there exist at most N ids. Which is when/iff there exist (at least) N ids and NOT there exists one more id.
PS Be sure to know whether you want at least 1.
PS Difference between Relational Algebra and Relational Calculus