Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
131 views8 pages

Spool File For Oracle Students Trained by MR - Sathish Yellanki

The document is a spool file from an Oracle database that was generated for students trained by Mr. Sathish Yellanki. It contains examples of SQL commands like DESC, INSERT, SELECT used on sample tables like DEPT, EMP to demonstrate basic CRUD operations and retrieving data. Descriptions of tables like DEPT, EMP, SalGrade are shown along with the columns they contain and some sample data inserted and selected from these tables.

Uploaded by

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

Spool File For Oracle Students Trained by MR - Sathish Yellanki

The document is a spool file from an Oracle database that was generated for students trained by Mr. Sathish Yellanki. It contains examples of SQL commands like DESC, INSERT, SELECT used on sample tables like DEPT, EMP to demonstrate basic CRUD operations and retrieving data. Descriptions of tables like DEPT, EMP, SalGrade are shown along with the columns they contain and some sample data inserted and selected from these tables.

Uploaded by

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

Spool File For Oracle Students Trained by Mr.

Sathish Yellanki
..
SQL> cl scr

SQL> DESC Dept


Name Null? Type
----------------------------------------- -------- ---------------------
-------
DEPTNO NOT NULL NUMBER(2)
DNAME VARCHAR2(14)
LOC VARCHAR2(13)

SQL> INSERT INTO Dept


2 VALUES(NULL, 'SHIPPING', 'CHENNAI');
VALUES(NULL, 'SHIPPING', 'CHENNAI')
*
ERROR at line 2:
ORA-01400: cannot insert NULL into ("SCOTT"."DEPT"."DEPTNO")

SQL> INSERT INTO Dept


2 VALUES(50, NULL, 'CHENNAI');

1 row created.

SQL> ROLLBACK;

Rollback complete.

SQL> cl scr

SQL> DESC Emp


Name Null? Type
----------------------------------------- -------- ---------------------
-------
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NOT NULL NUMBER(2)

SQL> INSERT INTO Dept


2 VALUES(50, 'SHIPPING', 'CHENNAI');

1 row created.

SQL> INSERT INTO Dept


2 VALUES(40, 'CARGO', 'DELHI');
INSERT INTO Dept
--------------------------------------------------------------------------------
SkyEss Techno Solutions Pvt. Ltd.
Flat No. 201, II Floor, Abhilash Towers, BK Guda, Hyderabad 500 038
Ph No. +9140 23710047, 64640047, Mobile: 9985798869
Contact For Courses And Training in
Oracle Developer Suite 10g(D2K), Oracle Apps R12, Live Projects in SQL and PL/SQL, Data
Modeling, Linux/Unix
Follow Me: https://www.facebook.com/satishkumar.yellanki

Know you can register online for particular course ( http://skyess.info/contact-form/ )


Spool File For Oracle Students Trained by Mr.Sathish Yellanki
..
*
ERROR at line 1:
ORA-00001: unique constraint (SCOTT.DEPT_PRIMARY_KEY) violated

SQL> INSERT INTO Dept


2 VALUES(60, 'SHIPPING', 'MUMBAI');

1 row created.

SQL> ROLLBACK;

Rollback complete.

SQL> cl scr

SQL> DESC Dept


Name Null? Type
----------------------------------------- -------- ---------------------
-------
DEPTNO NOT NULL NUMBER(2)
DNAME VARCHAR2(14)
LOC VARCHAR2(13)

SQL> SELECT --An SQL Statement For Recognizing The Data Retrieval, And
Columns To Be Projected
2 * --A Symbol OR Token To Project All The Columns in The
Table(PROJECTION Operator)
3 FROM --A Clause That Identifies The Physical OR Logical Data Source
4 Dept --The Name of The Data Source From Which The Data Has To Be
Retrieved
5 /

DEPTNO DNAME LOC


---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON

SQL> DESC SalGrade


Name Null? Type
----------------------------------------- -------- ---------------------
-------
GRADE NUMBER
LOSAL NUMBER
HISAL NUMBER

SQL> SELECT *
2 FROM SalGrade;
--------------------------------------------------------------------------------
SkyEss Techno Solutions Pvt. Ltd.
Flat No. 201, II Floor, Abhilash Towers, BK Guda, Hyderabad 500 038
Ph No. +9140 23710047, 64640047, Mobile: 9985798869
Contact For Courses And Training in
Oracle Developer Suite 10g(D2K), Oracle Apps R12, Live Projects in SQL and PL/SQL, Data
Modeling, Linux/Unix
Follow Me: https://www.facebook.com/satishkumar.yellanki

Know you can register online for particular course ( http://skyess.info/contact-form/ )


Spool File For Oracle Students Trained by Mr.Sathish Yellanki
..

GRADE LOSAL HISAL


---------- ---------- ----------
1 700 1200
2 1201 1400
3 1401 2000
4 2001 3000
5 3001 9999

SQL> DESC Emp


Name Null? Type
----------------------------------------- -------- ---------------------
-------
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NOT NULL NUMBER(2)

SQL> SELECT *
2 FROM Emp;

EMPNO ENAME JOB MGR HIREDATE SAL


COMM
---------- ---------- --------- ---------- --------- ---------- ---------
-
DEPTNO
----------
7839 KING PRESIDENT 17-NOV-81 5000
10

7698 BLAKE MANAGER 7839 01-MAY-81 2850


30

7782 CLARK MANAGER 7839 09-JUN-81 2450


10

EMPNO ENAME JOB MGR HIREDATE SAL


COMM
---------- ---------- --------- ---------- --------- ---------- ---------
-
DEPTNO
----------
7566 JONES MANAGER 7839 02-APR-81 2975
20

--------------------------------------------------------------------------------
SkyEss Techno Solutions Pvt. Ltd.
Flat No. 201, II Floor, Abhilash Towers, BK Guda, Hyderabad 500 038
Ph No. +9140 23710047, 64640047, Mobile: 9985798869
Contact For Courses And Training in
Oracle Developer Suite 10g(D2K), Oracle Apps R12, Live Projects in SQL and PL/SQL, Data
Modeling, Linux/Unix
Follow Me: https://www.facebook.com/satishkumar.yellanki

Know you can register online for particular course ( http://skyess.info/contact-form/ )


Spool File For Oracle Students Trained by Mr.Sathish Yellanki
..
7654 MARTIN SALESMAN 7698 28-SEP-81 1250
1400
30

7499 ALLEN SALESMAN 7698 20-FEB-81 1600


300
30

EMPNO ENAME JOB MGR HIREDATE SAL


COMM
---------- ---------- --------- ---------- --------- ---------- ---------
-
DEPTNO
----------
7844 TURNER SALESMAN 7698 08-SEP-81 1500
0
30

7900 JAMES CLERK 7698 03-DEC-81 950


30

7521 WARD SALESMAN 7698 22-FEB-81 1250


500
30

EMPNO ENAME JOB MGR HIREDATE SAL


COMM
---------- ---------- --------- ---------- --------- ---------- ---------
-
DEPTNO
----------
7902 FORD ANALYST 7566 03-DEC-81 3000
20

7369 SMITH CLERK 7902 17-DEC-80 800


20

7788 SCOTT ANALYST 7566 09-DEC-82 3000


20

EMPNO ENAME JOB MGR HIREDATE SAL


COMM
---------- ---------- --------- ---------- --------- ---------- ---------
-
DEPTNO
----------
7876 ADAMS CLERK 7788 12-JAN-83 1100
--------------------------------------------------------------------------------
SkyEss Techno Solutions Pvt. Ltd.
Flat No. 201, II Floor, Abhilash Towers, BK Guda, Hyderabad 500 038
Ph No. +9140 23710047, 64640047, Mobile: 9985798869
Contact For Courses And Training in
Oracle Developer Suite 10g(D2K), Oracle Apps R12, Live Projects in SQL and PL/SQL, Data
Modeling, Linux/Unix
Follow Me: https://www.facebook.com/satishkumar.yellanki

Know you can register online for particular course ( http://skyess.info/contact-form/ )


Spool File For Oracle Students Trained by Mr.Sathish Yellanki
..
20

7934 MILLER CLERK 7782 23-JAN-82 1300


10

14 rows selected.

SQL> COLUMN DEPTNO FORMAT 99


SQL> SELECT * FROM Emp;

EMPNO ENAME JOB MGR HIREDATE SAL


COMM
---------- ---------- --------- ---------- --------- ---------- ---------
-
DEPTNO
------
7839 KING PRESIDENT 17-NOV-81 5000
10

7698 BLAKE MANAGER 7839 01-MAY-81 2850


30

7782 CLARK MANAGER 7839 09-JUN-81 2450


10

EMPNO ENAME JOB MGR HIREDATE SAL


COMM
---------- ---------- --------- ---------- --------- ---------- ---------
-
DEPTNO
------
7566 JONES MANAGER 7839 02-APR-81 2975
20

7654 MARTIN SALESMAN 7698 28-SEP-81 1250


1400
30

7499 ALLEN SALESMAN 7698 20-FEB-81 1600


300
30

EMPNO ENAME JOB MGR HIREDATE SAL


COMM
---------- ---------- --------- ---------- --------- ---------- ---------
-
DEPTNO
--------------------------------------------------------------------------------
SkyEss Techno Solutions Pvt. Ltd.
Flat No. 201, II Floor, Abhilash Towers, BK Guda, Hyderabad 500 038
Ph No. +9140 23710047, 64640047, Mobile: 9985798869
Contact For Courses And Training in
Oracle Developer Suite 10g(D2K), Oracle Apps R12, Live Projects in SQL and PL/SQL, Data
Modeling, Linux/Unix
Follow Me: https://www.facebook.com/satishkumar.yellanki

Know you can register online for particular course ( http://skyess.info/contact-form/ )


Spool File For Oracle Students Trained by Mr.Sathish Yellanki
..
------
7844 TURNER SALESMAN 7698 08-SEP-81 1500
0
30

7900 JAMES CLERK 7698 03-DEC-81 950


30

7521 WARD SALESMAN 7698 22-FEB-81 1250


500
30

EMPNO ENAME JOB MGR HIREDATE SAL


COMM
---------- ---------- --------- ---------- --------- ---------- ---------
-
DEPTNO
------
7902 FORD ANALYST 7566 03-DEC-81 3000
20

7369 SMITH CLERK 7902 17-DEC-80 800


20

7788 SCOTT ANALYST 7566 09-DEC-82 3000


20

EMPNO ENAME JOB MGR HIREDATE SAL


COMM
---------- ---------- --------- ---------- --------- ---------- ---------
-
DEPTNO
------
7876 ADAMS CLERK 7788 12-JAN-83 1100
20

7934 MILLER CLERK 7782 23-JAN-82 1300


10

14 rows selected.

SQL> COL EMPNO FOR 9999


SQL> SELECT * FROM Emp;

EMPNO ENAME JOB MGR HIREDATE SAL COMM


DEPTNO

--------------------------------------------------------------------------------
SkyEss Techno Solutions Pvt. Ltd.
Flat No. 201, II Floor, Abhilash Towers, BK Guda, Hyderabad 500 038
Ph No. +9140 23710047, 64640047, Mobile: 9985798869
Contact For Courses And Training in
Oracle Developer Suite 10g(D2K), Oracle Apps R12, Live Projects in SQL and PL/SQL, Data
Modeling, Linux/Unix
Follow Me: https://www.facebook.com/satishkumar.yellanki

Know you can register online for particular course ( http://skyess.info/contact-form/ )


Spool File For Oracle Students Trained by Mr.Sathish Yellanki
..
----- ---------- --------- ---------- --------- ---------- ---------- ---
---
7839 KING PRESIDENT 17-NOV-81 5000
10
7698 BLAKE MANAGER 7839 01-MAY-81 2850
30
7782 CLARK MANAGER 7839 09-JUN-81 2450
10
7566 JONES MANAGER 7839 02-APR-81 2975
20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400
30
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300
30
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0
30
7900 JAMES CLERK 7698 03-DEC-81 950
30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500
30
7902 FORD ANALYST 7566 03-DEC-81 3000
20
7369 SMITH CLERK 7902 17-DEC-80 800
20

EMPNO ENAME JOB MGR HIREDATE SAL COMM


DEPTNO
----- ---------- --------- ---------- --------- ---------- ---------- ---
---
7788 SCOTT ANALYST 7566 09-DEC-82 3000
20
7876 ADAMS CLERK 7788 12-JAN-83 1100
20
7934 MILLER CLERK 7782 23-JAN-82 1300
10

14 rows selected.

SQL> SET LINESIZE 120


SQL> SET PAGESIZE 20
SQL> SELECT * FROM Emp;

EMPNO ENAME JOB MGR HIREDATE SAL COMM


DEPTNO
----- ---------- --------- ---------- --------- ---------- ---------- ---
---
7839 KING PRESIDENT 17-NOV-81 5000
10
7698 BLAKE MANAGER 7839 01-MAY-81 2850
30
--------------------------------------------------------------------------------
SkyEss Techno Solutions Pvt. Ltd.
Flat No. 201, II Floor, Abhilash Towers, BK Guda, Hyderabad 500 038
Ph No. +9140 23710047, 64640047, Mobile: 9985798869
Contact For Courses And Training in
Oracle Developer Suite 10g(D2K), Oracle Apps R12, Live Projects in SQL and PL/SQL, Data
Modeling, Linux/Unix
Follow Me: https://www.facebook.com/satishkumar.yellanki

Know you can register online for particular course ( http://skyess.info/contact-form/ )


Spool File For Oracle Students Trained by Mr.Sathish Yellanki
..
7782 CLARK MANAGER 7839 09-JUN-81 2450
10
7566 JONES MANAGER 7839 02-APR-81 2975
20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400
30
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300
30
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0
30
7900 JAMES CLERK 7698 03-DEC-81 950
30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500
30
7902 FORD ANALYST 7566 03-DEC-81 3000
20
7369 SMITH CLERK 7902 17-DEC-80 800
20
7788 SCOTT ANALYST 7566 09-DEC-82 3000
20
7876 ADAMS CLERK 7788 12-JAN-83 1100
20
7934 MILLER CLERK 7782 23-JAN-82 1300
10

14 rows selected.

SQL> SPOOL OFF

--------------------------------------------------------------------------------
SkyEss Techno Solutions Pvt. Ltd.
Flat No. 201, II Floor, Abhilash Towers, BK Guda, Hyderabad 500 038
Ph No. +9140 23710047, 64640047, Mobile: 9985798869
Contact For Courses And Training in
Oracle Developer Suite 10g(D2K), Oracle Apps R12, Live Projects in SQL and PL/SQL, Data
Modeling, Linux/Unix
Follow Me: https://www.facebook.com/satishkumar.yellanki

Know you can register online for particular course ( http://skyess.info/contact-form/ )

You might also like