what is the use of composite key constraint?

Answers were Sorted based on User's Feedback



what is the use of composite key constraint?..

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

what is the use of composite key constraint?..

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

Post New Answer

More Oracle General Interview Questions

hi friends i completed b.com 2004.i have 3y accounting exp. in manufacturing company.now i have completed oracle finance.pls suggest me how will get job in oracle.can i get job in oracle.

0 Answers  


What is the difference between a vector and an Array? (Java)

3 Answers   RBS,


How do you bind variables in oracle?

0 Answers  


What happens if recursive calls get out of control?

0 Answers  


what is null value?

9 Answers  






It's Urgent? How to IMPORT .xls & .txt file into ORACLE?

5 Answers  


12. Display the client name in upper case only and in lower case only.

1 Answers   Wipro,


What is the difference between a primary key & a unique key?

0 Answers  


How many types of segments in Oracle?

0 Answers   MCN Solutions,


What is forall Statement ?

2 Answers   Thermotech,


What are different Oracle database objects?

1 Answers  


Assuming today is Monday, how would you use the DBMS_JOB package to schedule the execution of a given procedure owned by SCOTT to start Wednesday at 9AM and to run subsequently every other day at 2AM.

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)