SQL output type question

Q.  Which is the correct SQL syntax from the following to create a PRIMARY KEY constraint on existing table “ EMPLOYEE ” on " EMPID " column and currently column does not contain any value?
- Published on 27 Aug 15

a. Alter table EMPLOYEE Add Constraint PK - EMPID Primary Key, EMPID;
b. Update table EMPLOYEE Add Constraint PK - EMPID Primary Key (EMPID);
c. Alter table EMPLOYEE Add Constraint PK - EMPID Primary Key (EMPID);
d. Alter table EMPLOYEE Add Constraint PK - EMPID Primary Key, (EMPID);

ANSWER: Alter table EMPLOYEE Add Constraint PK - EMPID Primary Key (EMPID);
 

    Discussion

  • Nirja Shah   -Posted on 05 Nov 15
    - The alter command is used to alter the table.

    - The above command will alter the table and add a primary key constraint to that particular column.

Post your comment / Share knowledge


Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)