Can a table have two primary keys?

Answer Posted / pardeeep

NO,A table have only one primary key.But we can use it on more then one column.
Exp..
create table emp(empno int,ename nvarchar(20),deptno int,constraint Pk_constraint primary key( empno,deptno))
This query for SQL server

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between triggers and constraints?

521


what is column? : Sql dba

576


What is rank dense_rank and partition in sql?

539


What is primary key in db?

522


How do you declare a user-defined exception?

530






Is sql dba a good career? : SQL DBA

538


Mention what does plvtab enables you to do when you showthe contents of pl/sql tables?

671


Define implicit and explicit cursors.

633


Explain the uses of a database trigger?

574


What is the difference between rename and alias?

711


How consistent is the view of the data between and within multiple sessions, transactions or statements ?

1713


What is oracle sql called?

506


Do triggers have restrictions on the usage of large datatypes, such as long and long raw?

692


Which is faster view or stored procedure?

506


what are the differences between require and include, include_once and require_once? : Sql dba

533