Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> QUES: Create table Employee as........

QUES: Create table Employee as........

From: viagraboy <viagraboy_at_viagraboy.com>
Date: Thu, 18 Nov 1999 16:55:58 GMT
Message-ID: <38342dee.159154061@news.supernews.com>


I use this script to create a table:

create table employee as
select * from emp

If the Emp has these constraints on it:

C: Check constraint; includes Not Nulls
P: Primary Key
R: Foreign Key
U: Unique
V: With Check Option constraint (for views)

Which of these constraints will be on the new Employee table?

I ran this script on the emp table before I created the new table.

SQL> select constraint_name, constraint_type   2 from user_constraints
  3 where table_name = 'EMP';

CONSTRAINT_NAME                        C
------------------------------                                -
S_EMP_MANAGER_ID_FK                  R
S_EMP_DEPT_ID_FK                           R
S_EMP_TITLE_FK                                R
S_EMP_ID_NN                                     C
S_EMP_LAST_NAME_NN                   C
S_EMP_ID_PK                                     P
S_EMP_USERID_UK                          U
S_EMP_COMMISSION_PCT_CK        C

8 rows selected. Received on Thu Nov 18 1999 - 10:55:58 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US