Sqlserver Interview questions


Total available count: 45
Subject - Databases
Subsubject - Sqlserver

What is Unique key constraint?

A Unique key constraint enforces the uniqueness of the values in a set of columns, so no duplicate values are entered. The unique key constraints are used to enforce entity integrity as the primary key constraints.

A programmer can have many Unique key constraints per table, but only one Primary key constraint per table.

CREATE TABLE Employee
(
    empid int NOT NULL UNIQUE,
    empname varchar(255) NOT NULL,
    age varchar(255),
    address varchar(255),
    city varchar(255)
)

 




Next 1 interview question(s)

1
What is a Primary key?