SlideShare a Scribd company logo
create table dept(
deptno number(2,0),
dname varchar2(14),
loc varchar2(13),
constraint pk_dept primary key (deptno)
);
create table emp(
empno number(4,0),
ename varchar2(10),
job varchar2(9),
mgr number(4,0),
hiredate date,
sal number(7,2),
comm number(7,2),
deptno number(2,0),
constraint pk_emp primary key (empno),
constraint fk_deptno foreign key (deptno) references dept (deptno)
);
insert into DEPT (DEPTNO, DNAME, LOC)
values(10, 'ACCOUNTING', 'NEW YORK');
insert into dept
values(20, 'RESEARCH', 'DALLAS') ;
insert into dept
values(30, 'SALES', 'CHICAGO');
insert into dept
values(40, 'OPERATIONS', 'BOSTON') ;
insert into emp
values(
7839, 'KING', 'PRESIDENT', null,
to_date('17-11-1981','dd-mm-yyyy'),
5000, null, 10
);
insert into emp
values(
7698, 'BLAKE', 'MANAGER', 7839,
to_date('1-5-1981','dd-mm-yyyy'),
2850, null, 30
);
insert into emp
values(
7782, 'CLARK', 'MANAGER', 7839,
to_date('9-6-1981','dd-mm-yyyy'),
2450, null, 10
);
insert into emp
values(
7566, 'JONES', 'MANAGER', 7839,
to_date('2-4-1981','dd-mm-yyyy'),
2975, null, 20
);
insert into emp
values(
7788, 'SCOTT', 'ANALYST', 7566,
to_date('13-JUL-87','dd-mm-rr') - 85,
3000, null, 20
);
insert into emp
values(
7902, 'FORD', 'ANALYST', 7566,
to_date('3-12-1981','dd-mm-yyyy'),
3000, null, 20
);
insert into emp
values(
7369, 'SMITH', 'CLERK', 7902,
to_date('17-12-1980','dd-mm-yyyy'),
800, null, 20
);
insert into emp
values(
7499, 'ALLEN', 'SALESMAN', 7698,
to_date('20-2-1981','dd-mm-yyyy'),
1600, 300, 30
);
insert into emp
values(
7521, 'WARD', 'SALESMAN', 7698,
to_date('22-2-1981','dd-mm-yyyy'),
1250, 500, 30
);
insert into emp
values(
7654, 'MARTIN', 'SALESMAN', 7698,
to_date('28-9-1981','dd-mm-yyyy'),
1250, 1400, 30
);
insert into emp
values(
7844, 'TURNER', 'SALESMAN', 7698,
to_date('8-9-1981','dd-mm-yyyy'),
1500, 0, 30
);
insert into emp
values(
7876, 'ADAMS', 'CLERK', 7788,
to_date('13-JUL-87', 'dd-mm-rr') - 51,
1100, null, 20
);
insert into emp
values(
7900, 'JAMES', 'CLERK', 7698,
to_date('3-12-1981','dd-mm-yyyy'),
950, null, 30
);
insert into emp
values(
7934, 'MILLER', 'CLERK', 7782,
to_date('23-1-1982','dd-mm-yyyy'),
1300, null, 10
);
select ename, dname, job, empno, hiredate, loc
from emp, dept
where emp.deptno = dept.deptno
order by ename;
CREATE VIEW empvu80
AS SELECT empno,ename,sal
FROM emp
WHERE deptno = 40;
CREATE OR REPLACE VIEW empvu20
AS SELECT *
FROM emp
WHERE deptno = 20
WITH CHECK OPTION CONSTRAINT empvu20_ck ;
CREATE OR REPLACE VIEW empvu10
(empno,ename,job)
AS SELECT empno,ename,job
FROM emp
WHERE deptno= 10
WITH READ ONLY ;
DROP VIEW empvu80;
CREATE SEQUENCE dept_deptid_seq
INCREMENT BY 10
START WITH 50
MAXVALUE 99
NOCACHE
NOCYCLE;
INSERT INTO dept(deptno,
dname,loc)
VALUES (dept_deptid_seq.NEXTVAL,
'Support','Bombay');
SELECT dept_deptid_seq.CURRVAL
FROM dual;
ALTER SEQUENCE dept_deptid_seq
INCREMENT BY 20
MAXVALUE999999
NOCACHE
NOCYCLE;
DROP SEQUENCEdept_deptid_seq;
CREATE INDEX emp_last_name_idx
ON emp(ename);
DROP INDEX emp_last_name_idx;
CREATE SYNONYM d_sum
FOR dept_sum_vu;

More Related Content

What's hot

Double linked list
Double linked listDouble linked list
Double linked list
raviahuja11
 
Circular queue
Circular queueCircular queue
Circular queue
ShobhaHiremath8
 
CQL 实现
CQL 实现CQL 实现
CQL 实现
dennis zhuang
 
C & Python Introduction
C & Python IntroductionC & Python Introduction
C & Python Introduction
Spy Seat
 
ES2015 New Features
ES2015 New FeaturesES2015 New Features
ES2015 New Features
Giacomo Zinetti
 
Merge sort
Merge sortMerge sort
Merge sort
Aadhrit Attire
 
An Introduction to Tinkerpop
An Introduction to TinkerpopAn Introduction to Tinkerpop
An Introduction to Tinkerpop
Takahiro Inoue
 
CLinkedList
CLinkedListCLinkedList
CLinkedList
Thomas Knudstrup
 
New text document
New text documentNew text document
New text document
Debranjan Pal
 
Exp3
Exp3Exp3
CS50 Lecture3
CS50 Lecture3CS50 Lecture3
CS50 Lecture3
昀 李
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
kramsri
 

What's hot (12)

Double linked list
Double linked listDouble linked list
Double linked list
 
Circular queue
Circular queueCircular queue
Circular queue
 
CQL 实现
CQL 实现CQL 实现
CQL 实现
 
C & Python Introduction
C & Python IntroductionC & Python Introduction
C & Python Introduction
 
ES2015 New Features
ES2015 New FeaturesES2015 New Features
ES2015 New Features
 
Merge sort
Merge sortMerge sort
Merge sort
 
An Introduction to Tinkerpop
An Introduction to TinkerpopAn Introduction to Tinkerpop
An Introduction to Tinkerpop
 
CLinkedList
CLinkedListCLinkedList
CLinkedList
 
New text document
New text documentNew text document
New text document
 
Exp3
Exp3Exp3
Exp3
 
CS50 Lecture3
CS50 Lecture3CS50 Lecture3
CS50 Lecture3
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
 

Similar to Create view ans sequence

ScottCreate_1.pdf
ScottCreate_1.pdfScottCreate_1.pdf
ScottCreate_1.pdf
LaaouissiAzed
 
Tablas, Codigos Base De Datos Excelsa
Tablas, Codigos Base De Datos ExcelsaTablas, Codigos Base De Datos Excelsa
Tablas, Codigos Base De Datos Excelsa
Héctor
 
Tablas, Codigos De Base De Datos
Tablas, Codigos De Base De DatosTablas, Codigos De Base De Datos
Tablas, Codigos De Base De Datos
guesta050b04
 
When debugging the code, use Drop table statementsto drop pr.docx
 When debugging the code, use Drop table statementsto drop pr.docx When debugging the code, use Drop table statementsto drop pr.docx
When debugging the code, use Drop table statementsto drop pr.docx
aryan532920
 
Writeable ct es_pgcon_may_2011
Writeable ct es_pgcon_may_2011Writeable ct es_pgcon_may_2011
Writeable ct es_pgcon_may_2011
David Fetter
 
Milestone 1 FINAL
Milestone 1 FINALMilestone 1 FINAL
Milestone 1 FINAL
Danny Nguyen
 
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdfSQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
arrowit1
 
Procesos
ProcesosProcesos
Procesos
PublioScipion
 
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
Little Tukta Lita
 
Sentencias básicas en oracle
Sentencias básicas en oracleSentencias básicas en oracle
Sentencias básicas en oracle
Nelson Salinas
 
Creating Tablespaces and Tables in DB2BCIS 4620zArchit.docx
Creating Tablespaces and Tables in DB2BCIS 4620zArchit.docxCreating Tablespaces and Tables in DB2BCIS 4620zArchit.docx
Creating Tablespaces and Tables in DB2BCIS 4620zArchit.docx
willcoxjanay
 
Writeable CTEs: The Next Big Thing
Writeable CTEs: The Next Big ThingWriteable CTEs: The Next Big Thing
Writeable CTEs: The Next Big Thing
PostgreSQL Experts, Inc.
 
25 MARCH1 list, generator.pdf list generator
25 MARCH1 list, generator.pdf list generator25 MARCH1 list, generator.pdf list generator
25 MARCH1 list, generator.pdf list generator
PravinDhanrao3
 
C program
C programC program
C program
Komal Singh
 
Identificacion De Las Llaves Foraneas
Identificacion De Las Llaves ForaneasIdentificacion De Las Llaves Foraneas
Identificacion De Las Llaves Foraneas
robertjeison
 
include.docx
include.docxinclude.docx
include.docx
ssuser9c8ad9
 
STACK1.docx
STACK1.docxSTACK1.docx
STACK1.docx
CharanKeasavan
 
My C proggram is having trouble in the switch in main. Also the a co.pdf
My C proggram is having trouble in the switch in main. Also the a co.pdfMy C proggram is having trouble in the switch in main. Also the a co.pdf
My C proggram is having trouble in the switch in main. Also the a co.pdf
meerobertsonheyde608
 
1- Return the names- IDS- and average salary of the top 10 employees w.docx
1- Return the names- IDS- and average salary of the top 10 employees w.docx1- Return the names- IDS- and average salary of the top 10 employees w.docx
1- Return the names- IDS- and average salary of the top 10 employees w.docx
todd991
 
Criando tabelas
Criando tabelasCriando tabelas
Criando tabelas
renatofelixribeiro
 

Similar to Create view ans sequence (20)

ScottCreate_1.pdf
ScottCreate_1.pdfScottCreate_1.pdf
ScottCreate_1.pdf
 
Tablas, Codigos Base De Datos Excelsa
Tablas, Codigos Base De Datos ExcelsaTablas, Codigos Base De Datos Excelsa
Tablas, Codigos Base De Datos Excelsa
 
Tablas, Codigos De Base De Datos
Tablas, Codigos De Base De DatosTablas, Codigos De Base De Datos
Tablas, Codigos De Base De Datos
 
When debugging the code, use Drop table statementsto drop pr.docx
 When debugging the code, use Drop table statementsto drop pr.docx When debugging the code, use Drop table statementsto drop pr.docx
When debugging the code, use Drop table statementsto drop pr.docx
 
Writeable ct es_pgcon_may_2011
Writeable ct es_pgcon_may_2011Writeable ct es_pgcon_may_2011
Writeable ct es_pgcon_may_2011
 
Milestone 1 FINAL
Milestone 1 FINALMilestone 1 FINAL
Milestone 1 FINAL
 
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdfSQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
 
Procesos
ProcesosProcesos
Procesos
 
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
 
Sentencias básicas en oracle
Sentencias básicas en oracleSentencias básicas en oracle
Sentencias básicas en oracle
 
Creating Tablespaces and Tables in DB2BCIS 4620zArchit.docx
Creating Tablespaces and Tables in DB2BCIS 4620zArchit.docxCreating Tablespaces and Tables in DB2BCIS 4620zArchit.docx
Creating Tablespaces and Tables in DB2BCIS 4620zArchit.docx
 
Writeable CTEs: The Next Big Thing
Writeable CTEs: The Next Big ThingWriteable CTEs: The Next Big Thing
Writeable CTEs: The Next Big Thing
 
25 MARCH1 list, generator.pdf list generator
25 MARCH1 list, generator.pdf list generator25 MARCH1 list, generator.pdf list generator
25 MARCH1 list, generator.pdf list generator
 
C program
C programC program
C program
 
Identificacion De Las Llaves Foraneas
Identificacion De Las Llaves ForaneasIdentificacion De Las Llaves Foraneas
Identificacion De Las Llaves Foraneas
 
include.docx
include.docxinclude.docx
include.docx
 
STACK1.docx
STACK1.docxSTACK1.docx
STACK1.docx
 
My C proggram is having trouble in the switch in main. Also the a co.pdf
My C proggram is having trouble in the switch in main. Also the a co.pdfMy C proggram is having trouble in the switch in main. Also the a co.pdf
My C proggram is having trouble in the switch in main. Also the a co.pdf
 
1- Return the names- IDS- and average salary of the top 10 employees w.docx
1- Return the names- IDS- and average salary of the top 10 employees w.docx1- Return the names- IDS- and average salary of the top 10 employees w.docx
1- Return the names- IDS- and average salary of the top 10 employees w.docx
 
Criando tabelas
Criando tabelasCriando tabelas
Criando tabelas
 

Recently uploaded

New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
wisnuprabawa3
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
KrishnaveniKrishnara1
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
bijceesjournal
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
abbyasa1014
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
rpskprasana
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
Aditya Rajan Patra
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 

Recently uploaded (20)

New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 

Create view ans sequence

  • 1. create table dept( deptno number(2,0), dname varchar2(14), loc varchar2(13), constraint pk_dept primary key (deptno) ); create table emp( empno number(4,0), ename varchar2(10), job varchar2(9), mgr number(4,0), hiredate date, sal number(7,2), comm number(7,2), deptno number(2,0), constraint pk_emp primary key (empno), constraint fk_deptno foreign key (deptno) references dept (deptno) ); insert into DEPT (DEPTNO, DNAME, LOC) values(10, 'ACCOUNTING', 'NEW YORK'); insert into dept values(20, 'RESEARCH', 'DALLAS') ; insert into dept values(30, 'SALES', 'CHICAGO'); insert into dept values(40, 'OPERATIONS', 'BOSTON') ; insert into emp values( 7839, 'KING', 'PRESIDENT', null, to_date('17-11-1981','dd-mm-yyyy'), 5000, null, 10 ); insert into emp values( 7698, 'BLAKE', 'MANAGER', 7839, to_date('1-5-1981','dd-mm-yyyy'), 2850, null, 30 ); insert into emp values( 7782, 'CLARK', 'MANAGER', 7839, to_date('9-6-1981','dd-mm-yyyy'), 2450, null, 10 ); insert into emp values( 7566, 'JONES', 'MANAGER', 7839,
  • 2. to_date('2-4-1981','dd-mm-yyyy'), 2975, null, 20 ); insert into emp values( 7788, 'SCOTT', 'ANALYST', 7566, to_date('13-JUL-87','dd-mm-rr') - 85, 3000, null, 20 ); insert into emp values( 7902, 'FORD', 'ANALYST', 7566, to_date('3-12-1981','dd-mm-yyyy'), 3000, null, 20 ); insert into emp values( 7369, 'SMITH', 'CLERK', 7902, to_date('17-12-1980','dd-mm-yyyy'), 800, null, 20 ); insert into emp values( 7499, 'ALLEN', 'SALESMAN', 7698, to_date('20-2-1981','dd-mm-yyyy'), 1600, 300, 30 ); insert into emp values( 7521, 'WARD', 'SALESMAN', 7698, to_date('22-2-1981','dd-mm-yyyy'), 1250, 500, 30 ); insert into emp values( 7654, 'MARTIN', 'SALESMAN', 7698, to_date('28-9-1981','dd-mm-yyyy'), 1250, 1400, 30 ); insert into emp values( 7844, 'TURNER', 'SALESMAN', 7698, to_date('8-9-1981','dd-mm-yyyy'), 1500, 0, 30 ); insert into emp values( 7876, 'ADAMS', 'CLERK', 7788, to_date('13-JUL-87', 'dd-mm-rr') - 51,
  • 3. 1100, null, 20 ); insert into emp values( 7900, 'JAMES', 'CLERK', 7698, to_date('3-12-1981','dd-mm-yyyy'), 950, null, 30 ); insert into emp values( 7934, 'MILLER', 'CLERK', 7782, to_date('23-1-1982','dd-mm-yyyy'), 1300, null, 10 ); select ename, dname, job, empno, hiredate, loc from emp, dept where emp.deptno = dept.deptno order by ename; CREATE VIEW empvu80 AS SELECT empno,ename,sal FROM emp WHERE deptno = 40; CREATE OR REPLACE VIEW empvu20 AS SELECT * FROM emp WHERE deptno = 20 WITH CHECK OPTION CONSTRAINT empvu20_ck ; CREATE OR REPLACE VIEW empvu10 (empno,ename,job) AS SELECT empno,ename,job
  • 4. FROM emp WHERE deptno= 10 WITH READ ONLY ; DROP VIEW empvu80; CREATE SEQUENCE dept_deptid_seq INCREMENT BY 10 START WITH 50 MAXVALUE 99 NOCACHE NOCYCLE; INSERT INTO dept(deptno, dname,loc) VALUES (dept_deptid_seq.NEXTVAL, 'Support','Bombay'); SELECT dept_deptid_seq.CURRVAL FROM dual; ALTER SEQUENCE dept_deptid_seq INCREMENT BY 20 MAXVALUE999999 NOCACHE NOCYCLE; DROP SEQUENCEdept_deptid_seq;
  • 5. CREATE INDEX emp_last_name_idx ON emp(ename); DROP INDEX emp_last_name_idx; CREATE SYNONYM d_sum FOR dept_sum_vu;