Which five code segments should you use?

DRAG DROP
You create a disk-based table that contains the following script:

You need to prevent duplicate values in the SKU field.
Which five code segments should you use?
To answer, move the appropriate code segments from the list of code segments to the
answer area and arrange them in the correct order.

DRAG DROP
You create a disk-based table that contains the following script:

You need to prevent duplicate values in the SKU field.
Which five code segments should you use?
To answer, move the appropriate code segments from the list of code segments to the
answer area and arrange them in the correct order.

Answer: See the explanation

Explanation:
Box 1: ALTER TABLE dbo.Products
Box 2: ADD CONSTRAINT
Box 3:CK_SKU
Box 4: UNIQUE
Box 5: (SKU)

Note: The SQL command is:
ALTER TABLE <tablename> ADD CONSTRAINT
<constraintname> UNIQUE
(
<columnname>
)



Leave a Reply 1

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


MickBig

MickBig

ALTER TABLE dbo.Products
ADD CONSTRAINT
CK_SKU
UNIQUE
(SKU)