Can a table have two primary keys?
Answers were Sorted based on User's Feedback
Answer / suresh babu
No,The Table should have one primary key.But we can create
single primary key for combination of more columns,which is
called Composite Primary Key.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / damini
No.A table can have only one primary key .if it is having
more than one primary key then we say it as composite
primary key...A composite primarykey is a primary key of 2
or more columns together..A composite primary key is
different from primary key..
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / subbarayulu
No, a table should allows only one primary key with the
properties of NOT NULL + UNIQUE . But user can be able to
give more than one primary keys in a table with the help of
NOT NULL and UNIQUE KEYs but not directly using PRIMARY KEY
constraint.
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / srilekha
no,it's not possible to set more than one primary key column
to a single table
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / sattprakash mittal
Primary key is a field which is uniquely identified each record in a table. A table can only one primary key but there are more field can be used as primary key are known as candidate keys
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / 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 |
What are the types of join in sql?
how will be date change into string
How to fetch alternate records from a table?
how are rank and dense rank being alloted for column with same values over a particular column
Does it possible to pass object (or) table as an argument to a remote procedure?
What are system versioned tables?
Why is the cursor important?
What is a natural join?
what is meant by nl2br()? : Sql dba
Can ddl statements be used in pl/sql?
What cursor type do you use to retrieve multiple recordsets?
17 Answers Apollo, CTS, IonIdea, Microsoft, Oracle, TCS, Vmoksha, Wipro,
table :- city name country code abc 11 bcd 22 cde 232 def 33 write a procedure , so that when we give a phone no. eg - 1123456789 - o/p sud be city name = abc if phone no. - 2322345897 , o/p sud be =cde note - bcd and cde city name sud be diff. as dey diff only with th last no. Pls ans. this questnion.