Search notes:

Oracle: CREATE TABLE … AS SELECT …

create table … as select … (aka CTAS) creates a table whose column-data types and values stored in its records are determined by the result set of a select statement.
create table tbl_copy
-- nologging
-- pctfree
as
select
   col_1,
   col_4,
   col_5
from
   tbl;

WITH clause

A create table as select statement can be combined with a WITH clause as shown below:
create table tq84_numbers
as
with nums as (
   select
      level as num,
      to_char(to_date(level, 'j'), 'jsp')  spelled
   from
      dual connect by level <= 10000
)
select
   num,
   spelled
from
   nums;

Parallel

It must be made sure that the session is enabled for parallel DDLs:
alter session enable parallel ddl;
Then, the table can be created «parallely»:
create table tab_xyz PARALLEL as
select
  …

Specifying column names

It is possible to specify column names with their datatypes inferred from the select statement:
create table tq84_xyz (foo, bar, baz)
as
   select
      object_name,
      object_type,
      created
   from
      user_objects;
      
desc tq84_xyz;
Specifying the data types as well might result in an ORA-01773: may not specify column datatypes in this CREATE TABLE error.

Specifying storage options

The following CTAS statement creates a table with pctfree 0:
create table tq84_objs
   pctfree 0
as
select
   owner,
   object_type,
   object_name
from
   dba_objects;

Creating an IOT with a CTAS

create table tq84_ctas_iot (
   object_name,
   object_type,
   created,
   primary key(object_name, object_type)
)
   organization index
   pctfree 0
as
select
   object_name,
   object_type,
   created
from
   user_objects;
 
drop table tq84_ctas_iot purge;   

See also

A create table as select will perform an online statistics gathering.
The create table and select statements.
A create table … as … that involves a database link and CLOBs or BLOBs and analytic functions sometimes(?) throws a ORA-22992: cannot use LOB locators selected from remote tables.
The LOAD AS SELECT execution plan operator.
The event 14529 turns on or off create partition exchange tables with CTAS.
The to_lob WTF.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1740453979, '52.15.200.26', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/SQL/statement/nouns/table/create/as-select/index(146): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78