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.
Explanation looks correct: EAB
Yes it has to be A,B,E
A- Gives the “” in case if the user forget to enter a value for FAX
B- Prevent User from Enter new Null Value
E- Change the old Entered of the million record “Null” to be “”
Correct answers are A & E. Option B would only complicate things if users do NOT have a valid Fax number. By leaving the ‘entries’ for Fax as NULL, the Default constraint implicitly assigns a ” string in place of any null (unknown value) from the user.
B is needed.
Default works only for INSERTS. You could still set null for UPDATE statements.
https://msdn.microsoft.com/de-de/library/ms174979%28v=sql.120%29.aspx
DEFAULT
Specifies the value provided for the column when a value is not explicitly supplied during an insert
Exactly why option B is not needed. If you update some records and do NOT provide any value in the Fax column, it DEFAULTS to an empty ” ” string (by virtue of option A).
So, option B is not needed. Else, people will be compelled to enter incorrect value for an unknown (non-applicable) field.
An UPDATE operation is actually a ‘DELETE followed by an INSERT’ operation.
you are really wrong. it’s so easy to check…