有人可以检查我的 ER 图吗?世博会、活动、国家、展馆
Can someone check my ER Diagram? Expo, Event, Country, Pavillion
为了我的数据库 class 作业,我画了一个图表。
不过,我觉得有些东西 incorrect/wrong。
我们被指示根据以下信息创建 ERD 图:
• Every Expo is clearly identified by its exhibition year and its place of event. Every Expo has its own logo and slogan. Statistical data such as the number of participating nations and planned events for each Expo are recorded.
• An Expo contains several pavilions (also called stalls), which are all clearly identified by their ID numbers. There are two types of pavilions: a) theme pavilions and b) national pavilions.
• Every pavilion has a name, an exhibition zone (e.g. Zone A1, Zone A5, Zone B5 etc.) and one of several exhibition categories (e.g. Open-air, Stage, Booth). Moreover, pavilions have different sizes recorded in square meters.
• Every country is uniquely identified and has a name and a capital city.
• Every country can only be part of one national pavilion. A country can present itself alone in a national pavilion or can work together with another partner country to present themselves together in one national pavilion. Not every country in the world will have a national pavilion in the exhibition.
• An event plan describes when each event takes place, which country/countries it is organised by, and in which pavilion it is happening. Events have an optional name. Every event is organised by at least one country. At one point of time, there is at most one event held in a pavilion.
还要求图表符合第三范式。
Here is what I've done so far.我的图表可能有什么问题?
1) 不需要单独的 "category" 实体,它可以简单地作为展馆实体的属性,因为每个展馆只有一个类别。同样,StatisticalData和Expo实体可以合并,同样需要指定planned events为多值属性。
2) 对于国家实体国家身份本身就是足够的主键。
3) 对于展馆,我建议你宁愿使用特化和泛化原则(这就像编程语言中 类 中的继承) https://creately.com/diagram/example/io43l9n82/Specialization+and+Generalization+-Entity+Relationship+Example 。这意味着现在 "country pavilion"实体是一个死者。而是利用以上原则创建两个专业馆——国家馆和主题馆。
4) 完成上述操作后,您 "have" 从国家/地区关系中删除 PartneredCountryId,您真正想要的只是 Country 和 nationalPavilion 之间的一对多关系。通过指定一对多,确保一个国家馆可以有多个国家组织(都是彼此的合作伙伴)。然后您还需要指定国家参与在此关系中是可选的,如 "Not every country in the world will have a national pavilion in the exhibition".
5) 那么您需要从 Event 中删除 CountryId 和 PavilionId,因为您根本不需要这两个关系(hasOrganised/isOrganisedBy 和 organised/isHeldAt)处理这些事情,当您我会制作实际的数据库表。
为了我的数据库 class 作业,我画了一个图表。 不过,我觉得有些东西 incorrect/wrong。
我们被指示根据以下信息创建 ERD 图:
• Every Expo is clearly identified by its exhibition year and its place of event. Every Expo has its own logo and slogan. Statistical data such as the number of participating nations and planned events for each Expo are recorded.
• An Expo contains several pavilions (also called stalls), which are all clearly identified by their ID numbers. There are two types of pavilions: a) theme pavilions and b) national pavilions.
• Every pavilion has a name, an exhibition zone (e.g. Zone A1, Zone A5, Zone B5 etc.) and one of several exhibition categories (e.g. Open-air, Stage, Booth). Moreover, pavilions have different sizes recorded in square meters.
• Every country is uniquely identified and has a name and a capital city.
• Every country can only be part of one national pavilion. A country can present itself alone in a national pavilion or can work together with another partner country to present themselves together in one national pavilion. Not every country in the world will have a national pavilion in the exhibition.
• An event plan describes when each event takes place, which country/countries it is organised by, and in which pavilion it is happening. Events have an optional name. Every event is organised by at least one country. At one point of time, there is at most one event held in a pavilion.
还要求图表符合第三范式。
Here is what I've done so far.我的图表可能有什么问题?
1) 不需要单独的 "category" 实体,它可以简单地作为展馆实体的属性,因为每个展馆只有一个类别。同样,StatisticalData和Expo实体可以合并,同样需要指定planned events为多值属性。
2) 对于国家实体国家身份本身就是足够的主键。
3) 对于展馆,我建议你宁愿使用特化和泛化原则(这就像编程语言中 类 中的继承) https://creately.com/diagram/example/io43l9n82/Specialization+and+Generalization+-Entity+Relationship+Example 。这意味着现在 "country pavilion"实体是一个死者。而是利用以上原则创建两个专业馆——国家馆和主题馆。
4) 完成上述操作后,您 "have" 从国家/地区关系中删除 PartneredCountryId,您真正想要的只是 Country 和 nationalPavilion 之间的一对多关系。通过指定一对多,确保一个国家馆可以有多个国家组织(都是彼此的合作伙伴)。然后您还需要指定国家参与在此关系中是可选的,如 "Not every country in the world will have a national pavilion in the exhibition".
5) 那么您需要从 Event 中删除 CountryId 和 PavilionId,因为您根本不需要这两个关系(hasOrganised/isOrganisedBy 和 organised/isHeldAt)处理这些事情,当您我会制作实际的数据库表。