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 can you do with pl sql?
What are few of the schema objects that are created using PL/SQL?
describe mysql connection using mysql binary. : Sql dba
What is the purpose of a secondary key?
need to split a string into seperate values. eg. col1 col2 ---------- 100 - 'a,b,c' 200 - 'a,x,b,d,e' 300 - 'c' result: value count ------------- a - 2 b - 1 c - 2 etc.
what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba
Why is sql important?
What is varray in pl sql?
What does pl sql stand for?
What is rollback?
How do I debug a stored procedure?
What is a dirty read sql?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)