5 years ago (2015-06-10)  Algorithm language |   First to comment  12 
post score 0 times, average 0.0
[Slideup] Catalog
  • 1. The following table shows which parts suppliers can provide.The ID and name of the supplier can be found by the ID of the part.It is worth noting that one part can be provided by multiple suppliers, and one supplier can provide multiple parts
PartID PartName SupplierID SupplierName
1234 Nut 223 ProMetal
1234 Nut 224 Biscayne
2134 Bolt 223 ProMetal
  • 2. The following E-R relational model is transformed by the E-R mapping algorithm.Map in accordance with the nine steps of exercise seven, clearly marked each step, without this step this sign "None"


a) Normalization

1. PK (PartID, SupplierID) 2.FD (PartID->PartName, SupplierID->SupplierName) 3. This table belongs to the first normal form (1NF), because the above relationship, PartID, PartName, SupplierID, SupplierName and other components Inseparable data items. At the same time, it does not satisfy the second paradigm's non-primary attribute completely dependent on the code. 4. Step 1: From 1NF to 2NF (depending on the code): In the above relational model, because of PartID->PartName(F), SupplierID->SupplierName(F), the above relational schema should be split into three. Relational pattern 1Part (PartID, PartName) PK (PartID); FD (PartID->PartName) (F: complete function dependency) 2Supplier (SupplierID, SupplierName) PK (SupplierID) FD (SupplierID->SupplierName) (F: complete function Dependent on) 3SP (SupplierID, PartID) PK (SupplierID, PartID) Step 2: From 2NF to 3NF, (not dependent on part, nor passing on dependencies) The above relational model has met the requirements

b) E-R mapping

Step 1 : New table Coach(Name, Age) PK(Name) New table Player(Name, Age) PK(Name) New table Team(Name,Color) PK(Name) New table Game(Number, Score, Time, Date New Table Stadium(Name, Size, Location) Step 2: No Step 3: No Step4: Team Add Attributes CoachName, TeamplayWith Team(Name, CoachName, TeamplayWith) FK(CoachName)-> Coach(Name), FK(TeamplayWith) ->Team(Name) Step 5: Game New Properties HostName, VisitorName Game: Game(Number,HostName,VisitorName, Score,Time,Date) FK(HostName)->Team(Name) FK(VisitorName)->Team(Name Player new attributes TeamName FK (TeamName)-> Team (Name) Step 6: Create a new table TeamStadiumRecord (TeamName, StadiumName) PK (TeamName, StadiumName) FK (TeamName)-> Team (Name) FK (StadiumName)-> Stadium ( Name) Step 7: Create a new table: TeamColor(TeamName,TeamColor) PK(TeamName,TeamColor) FK(TeamName)->Team(Name) FK(TeamColor)->Team(Color) Step 8: No Step 9: No Summary: New table Coach(Name, Age, CoachName, TeamplayWith) PK(Name) New table Team(Name,Color) PK(Name) FK(CoachName)->Coach(Name) FK(TeamplayW Ith)->Team(Name) New Table Player(Name, Age, TeamName) PK(Name) FK(TeamName)->Team(Name) New Table Game(Number,HostName,VisitorNameScore,Time,Date) FK(HostName) ->Team(Name) FK(VisitorName)->Team(Name) New table Stadium(Name,Size,Location) New table TeamStadiumRecord(TeamName,StandName) PK(TeamName,StandName) FK(TeamName)->Team(Name) FK (StadiumName) -> Stadium (Name) New Table: TeamColor (TeamName, TeamColor) PK (TeamName, TeamColor) FK (TeamName) -> Team (Name) FK (TeamColor) -> Team (Color)


This article has been printed on copyright and is protected by copyright laws. It must not be reproduced without permission.If you need to reprint, please contact the author or visit the copyright to obtain the authorization. If you feel that this article is useful to you, you can click the "Sponsoring Author" below to call the author!

Reprinted Note Source: Baiyuan's Blog>>https://wangbaiyuan.cn/en/ssd7-exam2-standardization-e-r-map-2.html

Post comment


No Comment


Forget password?