Лабораторная работа: Проектирование РБД "Санатория" с помощью инструментария AllFusion ERwin Data Modeler
Set ERwinField = ERwinTableDef.CreateField("ID enterprise", DB_INTEGER)
ERwinField.Required = True
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("Number of flat", DB_INTEGER)
ERwinField.Required = True
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("Period", DB_TEXT, 18)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("Cost", DB_INTEGER)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("People quantity", DB_INTEGER)
ERwinTableDef.Fields.Append ERwinField
ERwinDatabase.TableDefs.Append ERwinTableDef
' CREATE INDEX "PrimaryKey"
Set ERwinTableDef = ERwinDatabase.TableDefs("Permit")
Set ERwinIndex = ERwinTableDef.CreateIndex("PrimaryKey")
Set ERwinField = ERwinIndex.CreateField("ID permit")
ERwinIndex.Fields.Append ERwinField
Set ERwinField = ERwinIndex.CreateField("ID client")
ERwinIndex.Fields.Append ERwinField
Set ERwinField = ERwinIndex.CreateField("ID enterprise")
ERwinIndex.Fields.Append ERwinField
Set ERwinField = ERwinIndex.CreateField("Number of flat")
ERwinIndex.Fields.Append ERwinField
ERwinIndex.Primary = True
ERwinTableDef.Indexes.Append ERwinIndex
' CREATE TABLE "Sector"
Set ERwinTableDef = ERwinDatabase.CreateTableDef("Sector")
Set ERwinField = ERwinTableDef.CreateField("ID sector", DB_INTEGER)