PersonActivity Table
The PersonActivity table stores information on a person's participation in an activity. Linking Tables in the Eval Database describes how this table resolves the many-to-many relationship between persons and activities. This table has foreign key relationships with the Activity, Grade, and Person tables. The following illustration shows the column properties of the PersonActivity table.
- The PersonActivityId column is the primary key. Its data type is int and the Identity attribute is checked. The alternative to adding this primary key column is to use the PersonId, ActivityId, and DateOfActivity columns as a composite key because the business rule allows a person to repeat an activity once a day. A synthetic primary key (PersonActivityId) makes it necessary to add a unique constraint on the PersonId, ActivityId, and DateOfActivity column combination. Constraints on Eval Table Columns describes the constraints in the Eval database.
- The PersonId column defines the foreign key relationship to the Person table. Its data type is int.
- The ActivityId column defines the foreign key relationship to the Activity table. Its data type is int, because the primary key in the Activity table is an int data type (the Identity property requires an int data type) and matching data types are required to create a foreign key relationship.
- The Evaluator column contains the FirstName and LastName fields from the Person table of the person who added the PersonActivity record or who last changed the record.
- The DateOfActivity column contains the date the activity occurred. Its data type is datetime. The format of date data is specified when a SQL Server language is selected. Converting Date and Time Data describes how the PT application maintains the integrity of dates.
- The GradeId column contains the foreign key to the record in the Grade table that represents the grade.
- The RawScore column holds the numeric evaluation of the activity before adjustments are applied to the score.
- The AdjScore column holds the numeric evaluation of the activity after adjustments are applied to the score. ActivityType table describes the different types of penalties that can affect the value of the AdjScore column.
- The Comment column contains remarks that the user wants to associate with an evaluation. Its data type is ntext. Eval Database Columns with ntext Data Types describes this data type in detail.