3

So, in this semester I started learning about DBMS and the first two chapters was about ER systems. But even though i understand what is a weak entity and the definition of total participation I find it hard to distinguish what to use in practice..For example

enter image description here

In this simple example I cant understand why the restaurant is not a weak entity (It cant exist a restaurant without dishes) and the same for dish-ingredients (it can not exist a dish with 0 ingredients). So, why in this diagram restaurant -dish and dish-ingrendient are only represented with a total participation and not as a weak entities too?

Kamil Gosciminski
  • 16,547
  • 8
  • 49
  • 72
Panos Kikas
  • 43
  • 1
  • 5
  • Total participation isn't the same as an identifying relationship. Weak entities are determined by how they're identified, not by an existence dependency. See http://stackoverflow.com/questions/38034049/is-optionality-mandatory-optional-and-participation-total-partial-are-same/38035173#38035173 – reaanb Oct 11 '16 at 20:32

1 Answers1

2

Restaurant is not a weak entity because it can exist on its own. The same rule applies to Ingredients. Ingredients don't need do be put within any dish, but a dish can't exist without any ingredients. Dish cannot exist if there is no corresponding restaurant serving that particular dish. Consider a menu with dishes that doesn't belong to any restaurant. What would be the purpose of it in your model?

Are you sure you understand the purpose of weak entity and not think of it the other way around as it currently stands?

Kamil Gosciminski
  • 16,547
  • 8
  • 49
  • 72
  • So the dish- ingredients relationship is a identifying relationship too right? (with the dish weak entity and "Contains" identifying" – Panos Kikas Oct 10 '16 at 22:16
  • http://stackoverflow.com/questions/762937/whats-the-difference-between-identifying-and-non-identifying-relationships – Kamil Gosciminski Oct 10 '16 at 22:34