is there more the two primary key in a single table?
Answers were Sorted based on User's Feedback
Answer / narendra singh
yes, it may be possible that a table can have more than one
primary key but except its own primary key, others are
foreign keys...........
A primary key for one table is foreign key for other table..
thank Q......
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / simi
yes,
CREATE TABLE [dbo].[custrate](
[id] [int] NOT NULL,
[patname] [char](50) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL,
[rate] [int] NULL,
CONSTRAINT [PK__custrate__12FE9D09] PRIMARY KEY CLUSTERED
(
[id] ASC,
[patname] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / abhishek chakraborty
Yes
In Mysql
CREATE TABLE `rooms2hire`.`user data` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
`email` VARCHAR( 255 ) NOT NULL ,
`name` VARCHAR( 255 ) NOT NULL ,
PRIMARY KEY ( `id` , `email` )
) ENGINE = MYISAM
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / murugavel
yes
CREATE TABLE "accessmenu" (
"UID" int(11) NOT NULL DEFAULT '0',
"MID" int(11) NOT NULL DEFAULT '0',
"AlterPermission" tinyint(4) DEFAULT '0',
PRIMARY KEY ("UID","MID")
);
| Is This Answer Correct ? | 4 Yes | 6 No |
Answer / laxman2610
No, One table can have only one primary key. but, if u want
u can create another one as unique with not null.
| Is This Answer Correct ? | 0 Yes | 2 No |
How to drop an existing user defined function in ms sql server?
What is dbcc?
Can you link only other SQL Servers or any database servers such as Oracle?
What is the cpu pressure?
What to check if a User database is locked?
What is database replication?
What is difference between equi join and natural join?
how to implement locking in sql server
What number sorts of privileges are accessible in sql?
How To Find That One Week Change in My DataBase we Have Done Like We Have A database Test I Change Table,Stored Procd. Then I Find Which SP,Table We Have Edit/Change in Seven Dayes
What are all new concepts in SQL Server 2008? That is Exactly Difference between 2005 to 2008
How do you know which index a table is using?
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)