Which Transact- SQL statement should you use?

You are a database developer of a Microsoft SQL Server database.
You are designing a table that will store Customer data from different sources. The table will include a column that contains the CustomerlD from the source system and a column that contains the SourcelD.
A sample of this data is as shown in the following table.

You need to ensure that the table has no duplicate CustomerlD within a SourcelD. You also need to ensure that the data in the table is in the order of SourcelD and then CustomerlD.
Which Transact- SQL statement should you use?
A. CREATE TABLE Customer
(SourcelD int NOT NULL,
CustomerlD int NOT NULL,
CustomerName varchar(255) NOT NULL
CONSTRAINT UCLCustomer UNIQUE
(SourcelD, CustomerlD));
B. CREATE TABLE Customer
(SourcelD int NOT NULL UNIQUE,
CustomerlD int NOT NULL UNIQUE,
CustomerName varchar(255) NOT NULL);
C. CREATE TABLE Customer
(SourcelD int NOT NULL PRIMARY KEY CLUSTERED,
CustomerlD int NOT NULL UNIQUE,
CustomerName varchar(255) NOT NULL);
D. CREATE TABLE Customer
(SourcelD int NOT NULL,
CustomerlD int NOT NULL,
CustomerName varchar(255) NOT NULL,
CONSTRAINT PK_Customer PRIMARY KEY CLUSTERED
(SourcelD, CustomerlD));

microsoft-exams

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.