Can someone check my ER Diagram? Expo, Event, Country, Pavillion

时间:2018-02-03 10:12:18

标签: database diagram database-normalization erd

For my database class homework, I've drawn out a diagram. I feel like something is incorrect/wrong about it though.

We've been instructed to create an ERD diagram based on this information:

• 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.

It's also been requested for the diagram to be in third normal form.

Here is what I've done so far. What may be wrong about my diagram?

1 个答案:

答案 0 :(得分:0)

1) Separate "category" entity is not needed it can simply be an attribute of pavilion entity, since each pavilion has only one category. Similarly, StatisticalData and Expo entity can be merged, and also you need to specify that planned events is a mutivalue attribute.

2) For country entity country identity itself is sufficient primary key.

3) for pavilion, I would suggest you would rather use specialization and generalisation principle(It's like inheritance in classes in programming languages) https://creately.com/diagram/example/io43l9n82/Specialization+and+Generalization+-Entity+Relationship+Example .That means now that "country pavilion" entity is a goner. Rather using above principle create two specialized pavilions - national and theme.

4) Once you are done with above, you "have" to remove PartneredCountryId from country relationship, what you really want is simply one to many relationship between Country and nationalPavilion. By specifying one to many, it make sure that one national pavilion can have multiple countries organising it(all are partners to one another). And then you need to also specify that countries participation is optional in this relation, as "Not every country in the world will have a national pavilion in the exhibition".

5)then you need to remove CountryId and PavilionId from Event because you simply don't have to the two relationships(hasOrganised/isOrganisedBy and organised/isHeldAt) takes care of these thing, when you'll make actuall database tables.