0% found this document useful (0 votes)
161 views2 pages

Create Temporary, Permanent & Transient Table

The document creates three different types of tables: a temporary table, a transient table, and a permanent table. It inserts sample data into each table and runs queries to illustrate the differences between each table type.

Uploaded by

clouditlab9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
161 views2 pages

Create Temporary, Permanent & Transient Table

The document creates three different types of tables: a temporary table, a transient table, and a permanent table. It inserts sample data into each table and runs queries to illustrate the differences between each table type.

Uploaded by

clouditlab9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

--------- Create TEMPORARY Table ---------

create or replace TEMPORARY table EMPLOYEES_TEMP(employee_id number,


empl_join_date date,
dept varchar(10),
salary number,
manager_id number);

insert into EMPLOYEES_TEMP values(8,'2014-10-01','HR',40000,4),


(12,'2014-09-01','Tech',50000,9),
(3,'2018-09-01','Marketing',30000,5),
(4,'2017-09-01','HR',10000,5),
(25,'2019-09-01','HR',35000,9),
(12,'2014-09-01','Tech',50000,9),
(86,'2015-09-01','Tech',90000,4),
(73,'2016-09-01','Marketing',20000,1);

SHOW TABLES;

select * from EMPLOYEES_TEMP;

// Try running above query in different worksheet or session, we should get an


error
// Also focus on Table icon/sign to detect TEMPORARY table

--------- Create TRANSIENT Table ---------


create or replace TRANSIENT table employees_transient(employee_id number,
empl_join_date date,
dept varchar(10),
salary number,
manager_id number);

insert into employees_transient values(8,'2014-10-01','HR',40000,4),


(12,'2014-09-01','Tech',50000,9),
(3,'2018-09-01','Marketing',30000,5),
(4,'2017-09-01','HR',10000,5),
(25,'2019-09-01','HR',35000,9),
(12,'2014-09-01','Tech',50000,9),
(86,'2015-09-01','Tech',90000,4),
(73,'2016-09-01','Marketing',20000,1);

SHOW TABLES;

select * from EMPLOYEES_TRANSIENT;

// Try running above query in different worksheet or session, we should not get any
error
// Also focus on Table icon/sign to detect TRANSIENT table

--------- Create PERMANENT Table ---------


create or replace PERMANENT table employees_permanent(employee_id number,
empl_join_date date,
dept varchar(10),
salary number,
manager_id number);

create or replace table employees_permanent(employee_id number,


empl_join_date date,
dept varchar(10),
salary number,
manager_id number);

insert into employees_permanent values(8,'2014-10-01','HR',40000,4),


(12,'2014-09-01','Tech',50000,9),
(3,'2018-09-01','Marketing',30000,5),
(4,'2017-09-01','HR',10000,5),
(25,'2019-09-01','HR',35000,9),
(12,'2014-09-01','Tech',50000,9),
(86,'2015-09-01','Tech',90000,4),
(73,'2016-09-01','Marketing',20000,1);

SHOW TABLES;

select * from "EMPLOYEES_PERMANENT";

You might also like