Developing Microsoft SQL Server Databases — Question 52
You need to add a new column named Confirmed to the Employees table.
The Confirmed column has the following requirements:
✑ It must have a default value of TRUE.
✑ It must minimize the amount of disk space used.
Which Transact-SQL statement should you run?
Answer options
- A. ALTER TABLE Employees ADD Confirmed but DEFAULT 0;
- B. ALTER TABLE Employees ADD Confirmed but DEFAULT 1;
- C. ALTER TABLE Employees ADD Confirmed nchar(1) DEFAULT '1';
- D. ALTER TABLE Employees ADD Confirmed nchar(1) DEFAULT '0';
Correct answer: C
Explanation
The correct answer is C because using nchar(1) with a default value of '1' efficiently represents a boolean value while minimizing disk space. Options A and B use incorrect syntax with 'but' instead of 'DEFAULT', and option D defaults to '0', which does not meet the requirement for a TRUE default value.