FC0-U61 · Question #903
A database administrator has created a primary table and must ensure the date column in the table only accepts date values. Which of the following does the administrator need to set?
The correct answer is C. Constrain!. To ensure a database column only accepts specific data types like dates, the administrator must implement a database constraint.
Question
A database administrator has created a primary table and must ensure the date column in the table only accepts date values. Which of the following does the administrator need to set?
Options
- ASchema
- BPrimary key
- CConstrain!
- DPermissions
How the community answered
(27 responses)- A4% (1)
- B4% (1)
- C93% (25)
Why each option
To ensure a database column only accepts specific data types like dates, the administrator must implement a database constraint.
A schema defines the overall structure of the database, tables, and relationships, but 'setting a schema' is not the specific action to enforce data type validation on a column.
A primary key uniquely identifies rows and enforces non-nullability, but it does not specifically restrict a column to only accept date values.
To restrict a column to only accept date values, the database administrator needs to set a constraint. This can involve defining the column with a DATE data type, which inherently enforces date-only values, or using a CHECK constraint for more complex validation rules.
Permissions control user access and actions within the database, but they do not enforce data type or value restrictions on columns.
Concept tested: Database constraints for data integrity
Source: https://learn.microsoft.com/en-us/sql/relational-databases/tables/primary-and-foreign-key-constraints
Topics
Community Discussion
No community discussion yet for this question.