You work as a database administrator at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. Your duties at Domain.com include managing the database schema for an order entry application in a SQL Server 2005 database named Certkiller -DB04. A Domain.com employee named Mia Hamm works is part of the design review committee. Mia Hamm requests that a new column named CK_Commission to the CK_Product table. The actual commission rates for the products are not known at present. Therefore, every product has a default commission rate of 10 percent. The table allows you to modify the rate if required. You have received instruction from the CIO to add the new column.
You need to configure the table to assign the default value as efficiently as possible.
What should you do?
A.
You need to create An UPDATE trigger in order to update the default value for every new item in the table.
B.
You need to create an INSERT trigger.
This trigger is created to assign the default value to every item in the table.
C.
You need to create a DEFAULT constraint to assign the default value specifying the WITH VALUES argument.
D.
You need to create a CHECK constraint to validate the data.
Thereafter he can assign the default value to every item in the table.
Explanation:
[ CONSTRAINT constraint_name ] – Specifies the start of a DEFAULT definition. To maintain compatibility with earlier versions of SQL Server, a constraint name can be assigned to a DEFAULT. constraint_name must follow the rules for identifiers, except that the name cannot start with a number sign (#). If constraint_name is not specified, a system-generated name is assigned to the DEFAULT definition. WITH VALUES -Specifies that the value given in DEFAULT constant_expression is stored in a new column added to existing rows. If the added column allows null values and WITH VALUES is specified, the default value is stored in the new column, added to existing rows. If WITH VALUES is not specified for columns that allow nulls, the value NULL is stored in the new column in existing rows. If the new column does not allow nulls, the default value is stored in new rows regardless of whether WITH VALUES is specified.