title: Create a copy of table and provide constraints to it while creating
body: <p>I am new to Oracle database. I know we can create a copy of table using 
  <code>CREATE TABLE copy_emp(eid, ename,job,mid,sal,dept_id)
  as SELECT employee_id, concat(first_name,last_name),job_id,manager_id,salary,department_id FROM employees;</code>
  and later we can use
  <code>alter table copy_emp add constraint epk FORIEGN KEY(dept_id) references departments(dept_id)</code> to add a foreign key constraint</p>
  
  <p>But is it possible to provide constraints at the time of creating copy of table through query.</p>
  
  <p>For example can we do something like this:</p>
  
  <pre><code>CREATE table copy_emp(eid, ename,job,mid,sal,dept_id constraint dpt_fk references copy_dept(department_id) ON DELETEcascade)
  as
  SELECT employee_id,
  concat(first_name,last_name),job_id,manager_id,salary,department_id 
  FROM employees;
  </code></pre>
  
  <p>Can we provide constraints while creating a copy of table if yes than what is the query and if no than why?</p>