108k views
3 votes
Suppose the relation WorksOn(project, employee, hoursperweek). Consider the following constraint:

Nobody can work more than 3 projects at once.
How can we implement this constraint ?
Select one:
a. We create a tuple-based constraint
b. We create a trigger to refuse all modifications violating this constraint
c. We create an assertion to ensure this constraint must be true at all times
d. We create an attribute-based constraint

1 Answer

1 vote

Final answer:

To implement the constraint that nobody can work more than 3 projects at once in the WorksOn relation, a tuple-based constraint can be created. This can be enforced by adding a check constraint to the relation.

Step-by-step explanation:

To implement the constraint that nobody can work more than 3 projects at once in the relation WorksOn(project, employee, hoursperweek), we can create a tuple-based constraint. This means that for every tuple in the WorksOn relation, the number of distinct projects for each employee should be less than or equal to 3. This constraint can be enforced by adding a check constraint to the WorksOn relation, specifying that the count of distinct projects per employee should not exceed 3.

User Yves Baumes
by
8.2k points