Лабораторная работа: Проектирование РБД "Санатория" с помощью инструментария AllFusion ERwin Data Modeler
Set ERwinField = ERwinRelation.CreateField("ID client")
ERwinField.ForeignName = "ID client"
ERwinRelation.Fields.Append ERwinField
Set ERwinField = ERwinRelation.CreateField("ID enterprise")
ERwinField.ForeignName = "ID enterprise"
ERwinRelation.Fields.Append ERwinField
Set ERwinField = ERwinRelation.CreateField("Number of flat")
ERwinField.ForeignName = "Number of flat"
ERwinRelation.Fields.Append ERwinField
ERwinDatabase.Relations.Append ERwinRelation
' CREATE RELATIONSHIP "Give to"
Set ERwinRelation = ERwinDatabase.CreateRelation("Give to", "Enterprise-sender", "Permit")
Set ERwinField = ERwinRelation.CreateField("ID enterprise")
ERwinField.ForeignName = "ID enterprise"
ERwinRelation.Fields.Append ERwinField
ERwinDatabase.Relations.Append ERwinRelation
' CREATE RELATIONSHIP "Consist of"
Set ERwinRelation = ERwinDatabase.CreateRelation("Consist of", "Department", "Sector")
Set ERwinField = ERwinRelation.CreateField("ID department")
ERwinField.ForeignName = "ID department"
ERwinRelation.Fields.Append ERwinField
ERwinDatabase.Relations.Append ERwinRelation
' CREATE RELATIONSHIP "Consist of"
Set ERwinRelation = ERwinDatabase.CreateRelation("Consist of", "Sector", "Work place")
Set ERwinField = ERwinRelation.CreateField("ID sector")
ERwinField.ForeignName = "ID sector"
ERwinRelation.Fields.Append ERwinField
ERwinDatabase.Relations.Append ERwinRelation
' CREATE RELATIONSHIP "Give to"