93.9k views
5 votes
To declare a constraint that an employee is only male or female, we use _________

Select one:
a. Attribute-based CHECK constraint
b. Not-null constraint
c. Referenced integrity constraint
d. Tuple-based CHECK constraint

1 Answer

2 votes

Final answer:

An attribute-based CHECK constraint ensures that an employee's gender field only contains 'male' or 'female' values, upholding data integrity. The correct answer is option a.

Step-by-step explanation:

To declare a constraint that an employee is only male or female, we use an attribute-based CHECK constraint. This type of constraint is used in SQL to specify that the value in a certain column must meet a specific condition. In the context of an employee's gender, an attribute-based CHECK constraint would verify that a gender field contains only 'male' or 'female' as its value, ensuring data integrity for that column.

User Ken De Guzman
by
7.6k points