Oracle command

From: Matthew <s803738_at_student.uq.edu.au>
Date: Wed, 7 Feb 2001 16:12:53 +1000
Message-ID: <95qokd$lh8$1_at_bunyip.cc.uq.edu.au>


Hi,

I am a novice in Oracle SQL.
[Quoted] [Quoted] I was taught to use the following SQL to create table and its key constraints
"CREATE TABLE EMPLOYEE

(ID CHAR(9) NOT NULL,
NAME CHAR(40) NOT NULL,
...
CONSTRAINT EMPPK

                           PRIMARY KEY (ID),
CONSTRAINT    EMPFK
                            FOREIGN KEY (NAME)    REFERENCES
DEPARTMENT_TABLE(NAME));" I will like to ask the following the questions: 1. What is the use of naming the constraints, ie, naming the primary key and foreign key? How do I make use of them?
2. What is the Oracle command for listing the constraints? I tried
"DESCRIBE" but it does not give me all the useful information that I want.

regards
Matthew Received on Wed Feb 07 2001 - 07:12:53 CET

Original text of this message