Лабораторная работа: Проектирование РБД "Санатория" с помощью инструментария AllFusion ERwin Data Modeler
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 "R/11"
Set ERwinRelation = ERwinDatabase.CreateRelation("R/11", "Department", "Department_Client")
Set ERwinField = ERwinRelation.CreateField("ID department")
ERwinField.ForeignName = "ID department"
ERwinRelation.Fields.Append ERwinField
ERwinDatabase.Relations.Append ERwinRelation
' CREATE RELATIONSHIP "perform"
Set ERwinRelation = ERwinDatabase.CreateRelation("perform", "Work place", "Function")
Set ERwinField = ERwinRelation.CreateField("ID work place")
ERwinField.ForeignName = "ID work place"
ERwinRelation.Fields.Append ERwinField
Set ERwinField = ERwinRelation.CreateField("ID sector")
ERwinField.ForeignName = "ID sector"
ERwinRelation.Fields.Append ERwinField
ERwinDatabase.Relations.Append ERwinRelation
' CREATE RELATIONSHIP "Provide"
Set ERwinRelation = ERwinDatabase.CreateRelation("Provide", "Department", "Motor transport")
Set ERwinField = ERwinRelation.CreateField("ID department")
ERwinField.ForeignName = "ID department"
ERwinRelation.Fields.Append ERwinField
ERwinDatabase.Relations.Append ERwinRelation
' CREATE RELATIONSHIP "Have"