1 Persons Metrics Boundaries Fk FK_BoundVals_Boundaries BoundVals ref Boundaries ( BoundId -> id ) BoundId Fk FK_Boundaries_BoundTypes Boundaries ref BoundTypes ( TypeId -> id ) TypeId Fk FK_Boundaries_Persons Boundaries ref Persons ( PersonId -> id ) PersonId Fk FK_DeviceData_Devices DeviceData ref Devices ( DeviceId -> id ) DeviceId Fk FK_DeviceData_Metrics DeviceData ref Metrics ( MetricId -> id ) MetricId Fk FK_DeviceMetrics_Devices DeviceMetrics ref Devices ( DeviceId -> id ) DeviceId Fk FK_DeviceMetrics_Metrics DeviceMetrics ref Metrics ( MetricId -> id ) MetricId Fk FK_GoalVals_Goals GoalVals ref Goals ( GoalId -> id ) GoalId Fk FK_GoalVals_Metrics GoalVals ref Metrics ( MetricId -> id ) MetricId Fk FK_Goals_HealthProf Goals ref HealthProf ( ProfId -> id ) ProfId Fk FK_Goals_Persons Goals ref Persons ( PersonId -> id ) PersonId Fk FK_HealthProf_Specialties HealthProf ref Specialties ( SpecialtyId -> id ) SpecialtyId Fk FK_Metrics_UoM Metrics ref UoM ( UoMId -> id ) UoMId Fk FK_PersonDevices_Devices PersonDevices ref Devices ( DeviceId -> id ) DeviceId Fk FK_PersonDevices_Persons PersonDevices ref Persons ( PersonId -> id ) PersonId Fk FK_PersonProfs_HealthProf PersonProfs ref HealthProf ( ProfId -> id ) ProfId Fk FK_PersonProfs_Persons PersonProfs ref Persons ( PersonId -> id ) PersonId BoundTypesTable dbo.BoundTypes Pk PK_BoundTypes ( id ) idid * int Referred by Boundaries ( TypeId -> id ) DescriptionDescription * nvarchar(50) t BoundValsTable dbo.BoundVals Pk PK_BoundVals ( id ) idid * int # BoundIdBoundId * int References Boundaries ( BoundId -> id ) MetricIdMetricId * int # LowBoundLowBound float # LowDeviationLowDeviation float # LowDeviationPeriodLowDeviationPeriod int # UpperBoundUpperBound float # UpperDeviationUpperDeviation float # UpperDeviationPeriodUpperDeviationPeriod int # SubmitDtSubmitDt * datetime default getdate() d BoundariesTable dbo.Boundaries Pk PK_Boundaries ( id ) idid * int Referred by BoundVals ( BoundId -> id ) ProfIdProfId * int # PersonIdPersonId * int References Persons ( PersonId -> id ) TypeIdTypeId * int References BoundTypes ( TypeId -> id ) ValidFromValidFrom date d ValidToValidTo date d SubmitDtSubmitDt * datetime default getdate() d DeviceDataTable dbo.DeviceData Pk PK_DeviceData ( id ) idid * int # DeviceIdDeviceId * int References Devices ( DeviceId -> id ) MetricIdMetricId * int References Metrics ( MetricId -> id ) ValueValue * float # SubmitDtSubmitDt * datetime default getdate() d DeviceMetricsTable dbo.DeviceMetrics Pk PK_DeviceMetrics ( id ) idid * int # DeviceIdDeviceId * int References Devices ( DeviceId -> id ) MetricIdMetricId * int References Metrics ( MetricId -> id ) DevicesTable dbo.Devices Pk PK_Devices ( id ) idid * int Referred by DeviceData ( DeviceId -> id ) Referred by DeviceMetrics ( DeviceId -> id ) Referred by PersonDevices ( DeviceId -> id ) DescriptionDescription * nvarchar(50) t PhotoPhoto nvarchar(max) t GoalValsTable dbo.GoalVals Pk PK_GoalVals ( id ) idid * int # GoalIdGoalId * int References Goals ( GoalId -> id ) MetricIdMetricId * int References Metrics ( MetricId -> id ) LowBoundLowBound float # LowDeviationLowDeviation float # LowDeviationPeriodLowDeviationPeriod int # UpperBoundUpperBound float # UpperDeviationUpperDeviation float # UpperDeviationPeriodUpperDeviationPeriod int # SubmitDtSubmitDt * datetime default getdate() d GoalsTable dbo.Goals Pk PK_Goals ( id ) idid * int Referred by GoalVals ( GoalId -> id ) ProfIdProfId * int References HealthProf ( ProfId -> id ) PersonIdPersonId * int References Persons ( PersonId -> id ) ValidFromValidFrom date d ValidToValidTo date d SubmitDtSubmitDt * datetime default getdate() d HealthProfTable dbo.HealthProf Pk PK_HealthProf ( id ) idid * int Referred by Goals ( ProfId -> id ) Referred by PersonProfs ( ProfId -> id ) ProfNameProfName * nvarchar(100) t SpecialtyIdSpecialtyId * int References Specialties ( SpecialtyId -> id ) MetricsTable dbo.Metrics Pk PK_Metrics ( id ) idid * int Referred by DeviceData ( MetricId -> id ) Referred by DeviceMetrics ( MetricId -> id ) Referred by GoalVals ( MetricId -> id ) DescriptionDescription * nvarchar(50) t UoMIdUoMId * int References UoM ( UoMId -> id ) PersonDevicesTable dbo.PersonDevices Pk PK_PersonDevices ( id ) idid * int # PersonIdPersonId * int References Persons ( PersonId -> id ) DeviceIdDeviceId * int References Devices ( DeviceId -> id ) PersonProfsTable dbo.PersonProfs Pk PK_PersonProfs ( id ) idid * int # PersonIdPersonId * int References Persons ( PersonId -> id ) ProfIdProfId * int References HealthProf ( ProfId -> id ) PersonsTable dbo.Persons Pk PK_Persons ( id ) idid * int Referred by Boundaries ( PersonId -> id ) Referred by Goals ( PersonId -> id ) Referred by PersonDevices ( PersonId -> id ) Referred by PersonProfs ( PersonId -> id ) PersonNamePersonName * nvarchar(100) t GenderIdGenderId int # AgeAge nchar(10) c WeightWeight nchar(10) c emailemail nvarchar(100) t phonephone nvarchar(50) t SpecialtiesTable dbo.Specialties Pk PK_Specialties ( id ) idid * int Referred by HealthProf ( SpecialtyId -> id ) DescriptionDescription * nvarchar(50) t UoMTable dbo.UoM Pk PK_UoM ( id ) idid * int Referred by Metrics ( UoMId -> id ) DescriptionDescription * nvarchar(50) t


Table BoundTypes

IndexesField NameData TypeDescription
* id int AUTOINCREMENT
* Description nvarchar( 50 )
Indexes
PK_BoundTypes ON id


Table BoundVals

IndexesField NameData TypeDescription
* id int AUTOINCREMENT
* BoundId int
* MetricId int
  LowBound float
  LowDeviation float
  LowDeviationPeriod int
  UpperBound float
  UpperDeviation float
  UpperDeviationPeriod int
* SubmitDt datetime DEFAULT getdate()
Indexes
PK_BoundVals ON id
Foreign Keys
FK_BoundVals_Boundaries ( BoundId ) ref Boundaries (id)


Table Boundaries

IndexesField NameData TypeDescription
* id int AUTOINCREMENT
* ProfId int
* PersonId int
* TypeId int
  ValidFrom date
  ValidTo date
* SubmitDt datetime DEFAULT getdate()
Indexes
PK_Boundaries ON id
Foreign Keys
FK_Boundaries_BoundTypes ( TypeId ) ref BoundTypes (id)
FK_Boundaries_Persons ( PersonId ) ref Persons (id)


Table DeviceData

IndexesField NameData TypeDescription
* id int AUTOINCREMENT
* DeviceId int
* MetricId int
* Value float
* SubmitDt datetime DEFAULT getdate()
Indexes
PK_DeviceData ON id
Foreign Keys
FK_DeviceData_Devices ( DeviceId ) ref Devices (id)
FK_DeviceData_Metrics ( MetricId ) ref Metrics (id)


Table DeviceMetrics

IndexesField NameData TypeDescription
* id int AUTOINCREMENT
* DeviceId int
* MetricId int
Indexes
PK_DeviceMetrics ON id
Foreign Keys
FK_DeviceMetrics_Devices ( DeviceId ) ref Devices (id)
FK_DeviceMetrics_Metrics ( MetricId ) ref Metrics (id)


Table Devices

IndexesField NameData TypeDescription
* id int AUTOINCREMENT
* Description nvarchar( 50 )
  Photo nvarchar(max)
Indexes
PK_Devices ON id


Table GoalVals

IndexesField NameData TypeDescription
* id int AUTOINCREMENT
* GoalId int
* MetricId int
  LowBound float
  LowDeviation float
  LowDeviationPeriod int
  UpperBound float
  UpperDeviation float
  UpperDeviationPeriod int
* SubmitDt datetime DEFAULT getdate()
Indexes
PK_GoalVals ON id
Foreign Keys
FK_GoalVals_Goals ( GoalId ) ref Goals (id)
FK_GoalVals_Metrics ( MetricId ) ref Metrics (id)


Table Goals

IndexesField NameData TypeDescription
* id int AUTOINCREMENT
* ProfId int
* PersonId int
  ValidFrom date
  ValidTo date
* SubmitDt datetime DEFAULT getdate()
Indexes
PK_Goals ON id
Foreign Keys
FK_Goals_HealthProf ( ProfId ) ref HealthProf (id)
FK_Goals_Persons ( PersonId ) ref Persons (id)


Table HealthProf

IndexesField NameData TypeDescription
* id int AUTOINCREMENT
* ProfName nvarchar( 100 )
* SpecialtyId int
Indexes
PK_HealthProf ON id
Foreign Keys
FK_HealthProf_Specialties ( SpecialtyId ) ref Specialties (id)


Table Metrics

IndexesField NameData TypeDescription
* id int AUTOINCREMENT
* Description nvarchar( 50 )
* UoMId int
Indexes
PK_Metrics ON id
Foreign Keys
FK_Metrics_UoM ( UoMId ) ref UoM (id)


Table PersonDevices

IndexesField NameData TypeDescription
* id int AUTOINCREMENT
* PersonId int
* DeviceId int
Indexes
PK_PersonDevices ON id
Foreign Keys
FK_PersonDevices_Devices ( DeviceId ) ref Devices (id)
FK_PersonDevices_Persons ( PersonId ) ref Persons (id)


Table PersonProfs

IndexesField NameData TypeDescription
* id int AUTOINCREMENT
* PersonId int
* ProfId int
Indexes
PK_PersonProfs ON id
Foreign Keys
FK_PersonProfs_HealthProf ( ProfId ) ref HealthProf (id)
FK_PersonProfs_Persons ( PersonId ) ref Persons (id)


Table Persons

IndexesField NameData TypeDescription
* id int AUTOINCREMENT
* PersonName nvarchar( 100 )
  GenderId int
  Age nchar( 10 )
  Weight nchar( 10 )
  email nvarchar( 100 )
  phone nvarchar( 50 )
Indexes
PK_Persons ON id


Table Specialties

IndexesField NameData TypeDescription
* id int AUTOINCREMENT
* Description nvarchar( 50 )
Indexes
PK_Specialties ON id


Table UoM

IndexesField NameData TypeDescription
* id int AUTOINCREMENT
* Description nvarchar( 50 )
Indexes
PK_UoM ON id

Powered by DbSchema