Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I have crated ID as primary key


For an example
ID-4111
name- customer
ledger-1
ename-SHAKEER


but for 2nd time
ID-4111
name-supplier
ledger-2
ename-shakeer

can i create like this
Posted
Comments
TrushnaK 30-Dec-13 7:18am    
what you want to do exactly.

No. The ID cannot have duplicate value, that means there cannot be more than one ID with the same value of 4111 in that table. The column that is designated as primary key in a table can only contain unique values. The purpose of primary key is to ensure that there is no duplicate records in a table. Learn more about relational database from this quick guide Relational_Database_Design.html[^]
 
Share this answer
 
v3
You're looking for Composite Primary Keys[^]
 
Share this answer
 
Hi ,

Primary key is Unique one. u can't create like that
 
Share this answer
 
primary key is unique key. it can't duplicate value.
as per your senario you have to use primary keys[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900