Re: Creating tables, mapping from ER diagrams

From: Age of illusion <92908250_at_cpccux0.cphk.hk>
Date: 6 Jan 1995 16:29:27 GMT
Message-ID: <3ejr57$6fk_at_cpccux0.cphk.hk>


Moorthy N. Rekapalli (moorthy_at_eng.auburn.edu) wrote:
: Hello Everyone,
 

: When we create tables, we mention primary keys and foreign keys according to Entity - Relationship diagrams. For example,
 

: CREATE TABLE ORD (
: ORDID NUMBER (4) NOT NULL,
: ORDERDATE DATE,
: COMMPLAN CHAR (1),
: CUSTID NUMBER (6) NOT NULL,
: SHIPDATE DATE,
: TOTAL NUMBER (8,2) CHECK (TOTAL >= 0) CONSTRAINT TOTAL_ZERO,
: FOREIGN KEY (CUSTID) REFERENCES CUSTOMER (CUSTID) CONSTRAINT ORD_FOREIGN_KEY,
: PRIMARY KEY (ORDID) CONSTRAINT ORD_PRIMARY_KEY);
 
: After creating the tables, desc table_name will not show the information regarding primary and foreign keys.
 

: SQL> desc ord;
: Name Null? Type
: ------------------------------- -------- ----
: ORDID NOT NULL NUMBER(4)
: ORDERDATE DATE
: COMMPLAN CHAR(1)
: CUSTID NOT NULL NUMBER(6)
: SHIPDATE DATE
: TOTAL NUMBER(8,2)
:
 

: Is there any way to see the table definitions with primary and foreign keys
: after creating them ? This will be very helpful when we are following up
: some other's work.

Try the data dictionary table_constraint. Henry. Received on Fri Jan 06 1995 - 17:29:27 CET

Original text of this message