Which statement or statements should you execute?

The database contains a disk-based table named ContentTable that has 1 million rows and
a column named Fax. Fax allows null values.
You need to update Fax to meet the following requirements:
Prevent null values from being used.
Always use an empty string instead of a null value.
Which statement or statements should you execute? (Each correct answer presents part of
the solution. Choose all that apply.)

The database contains a disk-based table named ContentTable that has 1 million rows and
a column named Fax. Fax allows null values.
You need to update Fax to meet the following requirements:
Prevent null values from being used.
Always use an empty string instead of a null value.
Which statement or statements should you execute? (Each correct answer presents part of
the solution. Choose all that apply.)

A.
Option A

B.
Option B

C.
Option C

D.
Option D
Option E

D.
Option D
Option E

Explanation:
E: First change the NULLs to ‘ ‘.
A: Then set the default to the column to ‘ ‘.
B: Finally add the NOT NULL constraint to the column.



Leave a Reply 4

Your email address will not be published. Required fields are marked *


FALGUNKUMAR PATEL

FALGUNKUMAR PATEL

I am agree with CB

Ben

Ben

EB. The column is already existing with data and shouldn’t be dropped.
You can’t enter a default value as they want a value entered for subsequent entries.

Kevin

Kevin

Update ContentTable Set Fax = ” Where Fax Is Null;

Alter Table dbo.ContentTable Add Constraint DF_ContentTable_Fax Default ” For Fax;

Alter Table ContentTable Alter Column Fax char(11) Not Null;

A default value is only inserted if a value isn’t provided for the fax column, otherwise the provided value will be inserted into the table.