BACHELOR OF BUSINESS ADMINISTRATION

BUSINESS ADMINISTRATION

BUSINESS ANALYTICS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
If you wanted to define a restriction on a table column so that it has unique values, the restriction to use would be:
A
NOT NULL
B
Primary Key
C
Unique
D
Check
Explanation: 

Detailed explanation-1: -A UNIQUE constraint can be referenced by a FOREIGN KEY constraint. When a UNIQUE constraint is added to an existing column or columns in the table, by default, the Database Engine examines the existing data in the columns to make sure all values are unique.

Detailed explanation-2: -The SQL PRIMARY KEY constraint combines between the UNIQUE and SQL NOT NULL constraints, where the column or set of columns that are participating in the PRIMARY KEY cannot accept a NULL value.

Detailed explanation-3: -First we write ALTER TABLE, then we list the name of the table (in our example: product ), and next we add the clause ADD CONSTRAINT with the name of the unique constraint (in our example: UQ product name ). This is followed by the UNIQUE keyword with column/columns (in our example it is column: name ) in parentheses.

Detailed explanation-4: -On the Table Designer menu, select Indexes/Keys. In the Indexes/Keys dialog box, select Add. In the grid under General, select Type and choose Unique Key from the drop-down list box to the right of the property, and then select Close.

There is 1 question to complete.