what is the use of composite key constraint?
Answers were Sorted based on User's Feedback
Answer / deva
its used to create a primary keys based on two or more
columns in the particular table.
By the set, those should be unique.
| Is This Answer Correct ? | 14 Yes | 3 No |
Answer / srikanth
A composite key is used to club primary key for more than
once column.
PRIMARY KEY(<<COLUMN1>>,<<COLUMN2>>....<<COLUMNN>>)
But the disadvantage is that it will allow duplicates for
any one of the fields.
Example:
CREATE TABLE Example1
(Id INT NOT NULL,Pername VARCHAR(20) NULL,Phno INT NOT NULL
PRIMARY KEY(Id,Phno)
)
Command(s) completed successfully.
INSERT INTO Example1
VALUES(1,'sri',1111)
(1 row(s) affected)
INSERT INTO Example1
VALUES(1,'sri',6666)
(1 row(s) affected)
SELECT * FROM Example1
Id Pername Phno
1 sri 1111
1 sri 6666
As you can see that it is allowing same Id.
Basically Composite Key will take all the fields defined as
a group.So it is least bothered about any one of the field.
| Is This Answer Correct ? | 8 Yes | 0 No |
What are main difference between Stored Procedure and Functions.
Draw E-R diagram for many to many relationship ?
19. Display all clients whose name begins with the letter J or contains the letter M anywhere or contains E as the third letter.
If youre unsure in which script a sys or system-owned object is created, but you know its in a script from a specific directory, what UNIX command from that directory structure can you run to find your answer?
Shall I get Pro*C Compiler in Oracle-10g release ?
How to apply filtering criteria at group level in oracle?
how do we code triggers , store procedure , Performance tuning and indexing in a Java Project? Pls kindly get me the perfect answer with the code for each....thank you in advance............pls any body kindly help me soon as possible....
What are the values that can be specified for OPTIMIZER_GOAL parameter of the ALTER SESSION Command ?
What are joins, explain all types of joins?
What is autonomous transaction?
What is MTTR advisor in Oracle?
Anyone have the Latest Oracle Dumbs?While u have please forard to narain1411@gmail.com