Home » SQL & PL/SQL » SQL & PL/SQL » candidate key
candidate key [message #189357] Thu, 24 August 2006 04:43 Go to next message
sunsanvin
Messages: 60
Registered: April 2006
Location: Hyderabad
Member

Hi friends,
I'm working with all constraints, except candidate key. what exactly meant by a candidate key and where should we use that?

thank you very much
Re: candidate key [message #189371 is a reply to message #189357] Thu, 24 August 2006 05:26 Go to previous messageGo to next message
Frank Naude
Messages: 4502
Registered: April 1998
Senior Member
Well, all candidate keys must be declared as either:

- a PRIMARY KEY; or
- UNIQUE.

In the example below, a and b are candidate keys:

SQL> CREATE TABLE test (
  2    a NUMBER PRIMARY KEY,
  3    b NUMBER UNIQUE,
  4    c NUMBER
  5  );

Table created.
Re: candidate key [message #189404 is a reply to message #189357] Thu, 24 August 2006 08:35 Go to previous message
Yasir Hashmi
Messages: 304
Registered: April 2006
Senior Member
http://www.databasedev.co.uk/what_is_a_key.html
Previous Topic: need help on query
Next Topic: Structure of Table created using CTAS
Goto Forum:
  


Current Time: Fri Dec 09 03:47:08 CST 2016

Total time taken to generate the page: 0.12165 seconds