Tutorials
Oracle 10gIn this training you will learn about Creating Tables and Parallelizing Table Creation.
To create a new table in your schema, you must have the CREATE TABLE system privilege. To create a table in another user's schema, you must have the CREATE ANY TABLE system privilege. Additionally, the owner of the table must have a quota for the tablespace that contains the table, or the UNLIMITED TABLESPACE system privilege.
Create tables using the SQL statement CREATE TABLE.
When you issue the following statement, you create a table named Employee in the your default schema and default tablespace. The below mentioned code can either be executed through SQL*PLUS or iSQL*PLUS.
CREATE TABLE employee (
..........empno NUMBER(5) PRIMARY KEY,
..........ename VARCHAR2(15) NOT NULL,
..........job VARCHAR2(10),
..........mgr NUMBER(5),
..........hiredate DATE DEFAULT (sysdate),
..........sal NUMBER(7,2),
..........comm NUMBER(7,2),
..........deptno NUMBER(3) NOT NULL
); ..........................................................................

Figure 1. Table creation through SQL*PLUS
Parallelizing Table Creation
When you specify the AS SELECT clause to create a table and populate it with data from another table, you can utilize parallel execution. The CREATE TABLE ... AS SELECT statement contains two parts: a CREATE part (DDL) and a SELECT part (query). Oracle Database can parallelize both parts of the statement. The CREATE part is parallelized if one of the following is true:
A PARALLEL clause is included in the CREATE TABLE ... AS SELECT statement
An ALTER SESSION FORCE PARALLEL DDL statement is specified
If you parallelize the creation of a table, that table then has a parallel declaration (the PARALLEL clause) associated with it. Any subsequent DML or queries on the table, for which parallelization is possible, will attempt to use parallel execution.
The following simple statement parallelizes the creation of a table and stores the result in a compressed format, using table compression:
CREATE TABLE admin_emp_dept
..........PARALLEL COMPRESS
..........AS SELECT * FROM employee
..........WHERE deptno = 10;

|
Hi I want to know how to set default value for a DECIMAL datatype. |

| very nice |
| Very nice |
| This concept is very interesting |
| This is nice. If you give the syntax then it will be more useful(coz I don't know which are all optional in Parallelizing Table creation through SQL*PLUS) |
| hi i want to know the code(oracle) in which employee id is incremented when a record is inserted and decremented when the record is deleted. |
|
Hi, I want to know how to create a database by using command prompt in Oracle 10g. Can any one tell me that how I can create a database. |
| HI! Manish if you create sequence on employee id such as (create sequence employee_id_seq increment by 1 start with 1) and then if you give employee_id_seq.nextval into your insert statement then you can get employee id incremented by 1 automatically after every insert. |
|
hi its very nice but i want to know how to creat it using GUI. Thanks |