-2

試圖根據給定的大學項目簡介設計ER圖。具有不同屬性的實體取決於其類型?

我很困惑,我應該如何處理這個問題:

The items sold in the Food Truck can be of different types: burritos and 
beverages. Every item have an ID, a description and a price. Assume that every 
Food Truck has infinite stock of each item (i.e. we do not need to track stock levels 
in each Food Truck). 
All Burritos come with rice, a type of bean, a filling, and a set of optional 
toppings. Burritos are priced by size (Mini, Regular, and Grande). Bean types will 
vary. Chipp will start by offering two types: black beans and red beans. Burrito 
fillings will vary (depending on the season). There are at least 3 types of Burrito 
fillings and there should be a vegetarian option. 
A Burrito may optionally have toppings: lettuce, tomato, and mild and hot 
salsa. Toppings are free, but Chipp will also offer guacamole as a topping for which 
there is an extra charge. 
The Food Truck also sells different types of refreshing beverages, both 
alcoholic and non-alcoholic. All beverages have a size measured in milliliters (just in 
case Chipp takes his Food Truck business over the Channel to mainland Europe). 

我有這麼遠的解決方案是通過使兩個弱實體,兩者有關係,是這樣的:

enter image description here

這是處理問題的正確方法嗎?

回答

1

陳的原始符號沒有子類型的符號。沒有弱密鑰的弱實體產生相同的結果。您的方法在該框架內是正確的。然而,在相同的原始記號中,弱實體集與識別關係(雙邊鑽石)相關聯,並且在實體集合和關係之間用雙線表示總體參與,而不是基本指標(min,max)樣式。這不是堅持原始記法的建議,但在這些方面針對您的教科書驗證您的答案可能是一個好主意。

已經開發了許多不同的擴展符號來表示子類型,並指出不相關性,原始符號不能。如果你的課程中包含這些內容,我建議你使用它們,因爲它們更具表現力。

請注意鱷梨醬的額外收費要求,您的圖表還沒有包括在內。最後,您將價格表示爲項目的派生屬性,但我沒有看到可以從中計算出的其他屬性。

相關問題