Академический Документы
Профессиональный Документы
Культура Документы
SQL> cl scr
39 rows selected.
SQL> cl scr
14 rows selected.
SQL> ED
Wrote file afiedt.buf
14 rows selected.
14 rows selected.
SQL> cl scr
14 rows selected.
SQL> cl scr
14 rows selected.
SQL> cl scr
14 rows selected.
SQL> ED
Wrote file afiedt.buf
SQL> ED
Wrote file afiedt.buf
6 rows selected.
SQL> cl scr
14 rows selected.
SQL> cl scr
SQL> ED
Wrote file afiedt.buf
SQL> ED
Wrote file afiedt.buf
SQL> ED
Wrote file afiedt.buf
2 FROM Emp
3 START WITH Job = 'ANALYST'
4* CONNECT BY Empno = PRIOR MGR
SQL> /
6 rows selected.
SQL> cl scr
14 rows selected.
SQL> ED
Wrote file afiedt.buf
SQL> ED
Wrote file afiedt.buf
SQL> ED
Wrote file afiedt.buf
6 rows selected.
SQL> ED
Wrote file afiedt.buf
SQL> ED
Wrote file afiedt.buf
SQL> cl scr
SQL> ED
Wrote file afiedt.buf
SQL> ED
Wrote file afiedt.buf
no rows selected
SQL> ED
Wrote file afiedt.buf
SQL> ED
Wrote file afiedt.buf
8 rows selected.
SQL> ED
Wrote file afiedt.buf
Document Generated By SkyEss Techno Solutions Pvt. Ltd.
For Queries And Live Project Experience in Any Domain
Mail at: info@skyessmail.com (OR) rajesh.b@skyessmail.com
Mobile : 9030750090
Spool Generated For Class of Oracle By Satish K Yellanki
8 rows selected.
SQL> cl scr
10 rows selected.
SQL> ED
Wrote file afiedt.buf
10 rows selected.
SQL> ED
Wrote file afiedt.buf
10 rows selected.
SQL> ED
Wrote file afiedt.buf
12 rows selected.
SQL> cl scr
6 rows selected.
6 rows selected.
6 rows selected.
SQL> cl scr
14 rows selected.
6 rows selected.
SQL> SELECT Ename, Empno, Mgr, Job, Sal, ROUND(SalAvg, 2) SalAvg, ROUND(((SELECT
AVG(Sal) FROM Emp) - SalAvg), 2) AvgDif
2 FROM Emp E, (SELECT Deptno, AVG(Sal) SalAvg
3 FROM Emp
4 GROUP BY Deptno) E1
5 WHERE E.Deptno = E1.Deptno AND
6 E1.Deptno = (SELECT Deptno
7 FROM Dept
8 WHERE Dname = 'SALES')
9 START WITH Ename = 'KING'
10 CONNECT BY PRIOR Empno = MGR;
6 rows selected.
SQL> ED
Wrote file afiedt.buf
18 FROM Dept
19 WHERE Dname = 'ACCOUNTING'
20 )
21 )
22 )
23* CONNECT BY PRIOR Empno = MGR
SQL> /
6 rows selected.
SQL> ED
Wrote file afiedt.buf
14 rows selected.
SQL> ED
Wrote file afiedt.buf
14 rows selected.
SQL> ED
Wrote file afiedt.buf
14 rows selected.
SQL> ED
Wrote file afiedt.buf
14 rows selected.
SQL> ED
Wrote file afiedt.buf
SQL> ED
Wrote file afiedt.buf
6 rows selected.
SQL> ED
Wrote file afiedt.buf
14 rows selected.
SQL> ED
Wrote file afiedt.buf
13 rows selected.
SQL> cl scr
14 rows selected.
SQL> ED
Wrote file afiedt.buf
no rows selected
SQL> ED
Wrote file afiedt.buf
SQL> /
Enter value for gval: 1
8 rows selected.
SQL> /
Enter value for gval: -1
SQL> cl cr
SP2-0158: unknown CLEAR option "cr"
SQL> cl scr
SQL> ED
Wrote file afiedt.buf
SQL> ED
Wrote file afiedt.buf
NAME HIREDATE
Document Generated By SkyEss Techno Solutions Pvt. Ltd.
For Queries And Live Project Experience in Any Domain
Mail at: info@skyessmail.com (OR) rajesh.b@skyessmail.com
Mobile : 9030750090
Spool Generated For Class of Oracle By Satish K Yellanki
---------- ---------
KING 17-NOV-81
BLAKE 01-MAY-81
MARTIN 28-SEP-81
ALLEN 20-FEB-81
TURNER 08-SEP-81
JAMES 03-DEC-81
WARD 22-FEB-81
CLARK 09-JUN-81
MILLER 23-JAN-82
JONES 02-APR-81
FORD 03-DEC-81
NAME HIREDATE
---------- ---------
SMITH 17-DEC-80
SCOTT 09-DEC-82
ADAMS 12-JAN-83
14 rows selected.
SQL> cl scr
ENAME Path
---------- -----------------------------------
KING /KING
BLAKE /KING/BLAKE
MARTIN /KING/BLAKE/MARTIN
ALLEN /KING/BLAKE/ALLEN
TURNER /KING/BLAKE/TURNER
JAMES /KING/BLAKE/JAMES
WARD /KING/BLAKE/WARD
CLARK /KING/CLARK
MILLER /KING/CLARK/MILLER
JONES /KING/JONES
FORD /KING/JONES/FORD
ENAME Path
---------- -----------------------------------
SMITH /KING/JONES/FORD/SMITH
SCOTT /KING/JONES/SCOTT
ADAMS /KING/JONES/SCOTT/ADAMS
14 rows selected.
SQL> ED
Wrote file afiedt.buf
1 SELECT Ename,
Document Generated By SkyEss Techno Solutions Pvt. Ltd.
For Queries And Live Project Experience in Any Domain
Mail at: info@skyessmail.com (OR) rajesh.b@skyessmail.com
Mobile : 9030750090
Spool Generated For Class of Oracle By Satish K Yellanki
ENAME Path
---------- -----------------------------------
KING =>KING
BLAKE =>KING=>BLAKE
MARTIN =>KING=>BLAKE=>MARTIN
ALLEN =>KING=>BLAKE=>ALLEN
TURNER =>KING=>BLAKE=>TURNER
JAMES =>KING=>BLAKE=>JAMES
WARD =>KING=>BLAKE=>WARD
CLARK =>KING=>CLARK
MILLER =>KING=>CLARK=>MILLER
JONES =>KING=>JONES
FORD =>KING=>JONES=>FORD
ENAME Path
---------- -----------------------------------
SMITH =>KING=>JONES=>FORD=>SMITH
SCOTT =>KING=>JONES=>SCOTT
ADAMS =>KING=>JONES=>SCOTT=>ADAMS
14 rows selected.
SQL> cl scr
14 rows selected.
1 row updated.
14 rows selected.
SQL> ED
Wrote file afiedt.buf
no rows selected
ENAME
----------
SalPath
--------------------------------------------------------------------------------
KING
Document Generated By SkyEss Techno Solutions Pvt. Ltd.
For Queries And Live Project Experience in Any Domain
Mail at: info@skyessmail.com (OR) rajesh.b@skyessmail.com
Mobile : 9030750090
Spool Generated For Class of Oracle By Satish K Yellanki
/5000
BLAKE
/5000/2850
MARTIN
/5000/2850/1250
ENAME
----------
SalPath
--------------------------------------------------------------------------------
ALLEN
/5000/2850/1600
TURNER
/5000/2850/1500
JAMES
/5000/2850/950
ENAME
----------
SalPath
--------------------------------------------------------------------------------
WARD
/5000/2850/1250
CLARK
/5000/2450
MILLER
/5000/2450/1300
ENAME
----------
SalPath
--------------------------------------------------------------------------------
JONES
/5000/2975
FORD
/5000/2975/3000
SMITH
/5000/2975/3000/800
ENAME
----------
SalPath
--------------------------------------------------------------------------------
SCOTT
Document Generated By SkyEss Techno Solutions Pvt. Ltd.
For Queries And Live Project Experience in Any Domain
Mail at: info@skyessmail.com (OR) rajesh.b@skyessmail.com
Mobile : 9030750090
Spool Generated For Class of Oracle By Satish K Yellanki
/5000/2975/3000
ADAMS
/5000/2975/3000/1100
14 rows selected.
ENAME SalPath
---------- -------------------------
KING /5000
BLAKE /5000/2850
MARTIN /5000/2850/1250
ALLEN /5000/2850/1600
TURNER /5000/2850/1500
JAMES /5000/2850/950
WARD /5000/2850/1250
CLARK /5000/2450
MILLER /5000/2450/1300
JONES /5000/2975
FORD /5000/2975/3000
ENAME SalPath
---------- -------------------------
SMITH /5000/2975/3000/800
SCOTT /5000/2975/3000
ADAMS /5000/2975/3000/1100
14 rows selected.
SQL> cl scr
SQL> ROLLBACK
2 /
Rollback complete.
SQL> cl scr
SQL> ED
Wrote file afiedt.buf
1 SELECT Ename,
2 SYS_CONNECT_BY_PATH(Sal, '/') "SalPath"
3 FROM Emp
4 START WITH Ename = 'KING'
5* CONNECT BY PRIOR Empno = MGR;
SQL> /
CONNECT BY PRIOR Empno = MGR;
*
ERROR at line 5:
ORA-00911: invalid character
SQL> ED
Wrote file afiedt.buf
1 SELECT Ename,
2 SYS_CONNECT_BY_PATH(Sal, '/') "SalPath"
3 FROM Emp
4 START WITH Ename = 'KING'
5* CONNECT BY PRIOR Empno = MGR
SQL> /
ENAME SalPath
---------- -------------------------
KING /5000
BLAKE /5000/2850
MARTIN /5000/2850/1250
ALLEN /5000/2850/1600
TURNER /5000/2850/1500
JAMES /5000/2850/950
WARD /5000/2850/1250
CLARK /5000/2450
MILLER /5000/2450/1300
JONES /5000/2975
FORD /5000/2975/3000
ENAME SalPath
---------- -------------------------
SMITH /5000/2975/3000/800
SCOTT /5000/2975/3000
ADAMS /5000/2975/3000/1100
14 rows selected.
SQL> ED
Wrote file afiedt.buf
1 SELECT Ename,
2 SYS_CONNECT_BY_PATH(Sal, '/') "SalPath"
3 FROM Emp
4 START WITH Ename = 'KING'
5 CONNECT BY PRIOR Empno = MGR
6* ORDER BY Sal
SQL> /
ENAME SalPath
---------- -------------------------
SMITH /5000/2975/3000/800
JAMES /5000/2850/950
ADAMS /5000/2975/3000/1100
MARTIN /5000/2850/1250
WARD /5000/2850/1250
MILLER /5000/2450/1300
TURNER /5000/2850/1500
ALLEN /5000/2850/1600
CLARK /5000/2450
BLAKE /5000/2850
Document Generated By SkyEss Techno Solutions Pvt. Ltd.
For Queries And Live Project Experience in Any Domain
Mail at: info@skyessmail.com (OR) rajesh.b@skyessmail.com
Mobile : 9030750090
Spool Generated For Class of Oracle By Satish K Yellanki
JONES /5000/2975
ENAME SalPath
---------- -------------------------
FORD /5000/2975/3000
SCOTT /5000/2975/3000
KING /5000
14 rows selected.
SQL> cl scr
SQL> ED
Wrote file afiedt.buf
14 rows selected.
SQL> ED
Wrote file afiedt.buf
14 rows selected.
SQL> ED
Wrote file afiedt.buf
14 rows selected.