EMPL EMPL_LAST_NAME JOB_TITLE MGR HIREDATE SALARY COMMISSION DEP
---- --------------- ---------- ---- --------- ---------- ---------- ---
7839 King President 17-NOV-11 5000 500
7566 Jones Manager 7839 02-APR-12 2975 200
7698 Blake Manager 7839 01-MAY-13 2850 300
7782 Raimi Manager 7839 09-JUN-12 2450 100
7902 Ford Analyst 7566 03-DEC-12 3000 200
7369 Smith Clerk 7902 17-DEC-12 800 200
7499 Michaels Sales 7698 20-FEB-18 1600 300 300
7521 Ward Sales 7698 22-FEB-19 1250 500 300
7654 Martin Sales 7698 28-SEP-18 1250 1400 300
7788 Scott Analyst 7566 09-NOV-18 3000 200
7844 Turner Sales 7698 08-SEP-19 1500 0 300
EMPL EMPL_LAST_NAME JOB_TITLE MGR HIREDATE SALARY COMMISSION DEP
---- --------------- ---------- ---- --------- ---------- ---------- ---
7876 Adams Clerk 7788 23-SEP-18 1100 400
7900 James Clerk 7698 03-DEC-17 950 300
7934 Miller Clerk 7782 23-JAN-16 1300 100
14 rows selected.
=====
about to use forward-slash to re-run the previous SQL statement:
=====
EMPL EMPL_LAST_NAME JOB_TITLE MGR HIREDATE SALARY COMMISSION DEP
---- --------------- ---------- ---- --------- ---------- ---------- ---
7839 King President 17-NOV-11 5000 500
7566 Jones Manager 7839 02-APR-12 2975 200
7698 Blake Manager 7839 01-MAY-13 2850 300
7782 Raimi Manager 7839 09-JUN-12 2450 100
7902 Ford Analyst 7566 03-DEC-12 3000 200
7369 Smith Clerk 7902 17-DEC-12 800 200
7499 Michaels Sales 7698 20-FEB-18 1600 300 300
7521 Ward Sales 7698 22-FEB-19 1250 500 300
7654 Martin Sales 7698 28-SEP-18 1250 1400 300
7788 Scott Analyst 7566 09-NOV-18 3000 200
7844 Turner Sales 7698 08-SEP-19 1500 0 300
EMPL EMPL_LAST_NAME JOB_TITLE MGR HIREDATE SALARY COMMISSION DEP
---- --------------- ---------- ---- --------- ---------- ---------- ---
7876 Adams Clerk 7788 23-SEP-18 1100 400
7900 James Clerk 7698 03-DEC-17 950 300
7934 Miller Clerk 7782 23-JAN-16 1300 100
14 rows selected.
=====
showing (default) value of feedback:
=====
FEEDBACK ON for 6 or more rows
=====
now, with feedback of 15, you will NOT see '14 rows selected' message:
=====
EMPL EMPL_LAST_NAME JOB_TITLE MGR HIREDATE SALARY COMMISSION DEP
---- --------------- ---------- ---- --------- ---------- ---------- ---
7839 King President 17-NOV-11 5000 500
7566 Jones Manager 7839 02-APR-12 2975 200
7698 Blake Manager 7839 01-MAY-13 2850 300
7782 Raimi Manager 7839 09-JUN-12 2450 100
7902 Ford Analyst 7566 03-DEC-12 3000 200
7369 Smith Clerk 7902 17-DEC-12 800 200
7499 Michaels Sales 7698 20-FEB-18 1600 300 300
7521 Ward Sales 7698 22-FEB-19 1250 500 300
7654 Martin Sales 7698 28-SEP-18 1250 1400 300
7788 Scott Analyst 7566 09-NOV-18 3000 200
7844 Turner Sales 7698 08-SEP-19 1500 0 300
EMPL EMPL_LAST_NAME JOB_TITLE MGR HIREDATE SALARY COMMISSION DEP
---- --------------- ---------- ---- --------- ---------- ---------- ---
7876 Adams Clerk 7788 23-SEP-18 1100 400
7900 James Clerk 7698 03-DEC-17 950 300
7934 Miller Clerk 7782 23-JAN-16 1300 100
=====
showing (default) value of pagesize:
=====
pagesize 14
=====
now see the difference in this query with a pagesize of 30:
=====
EMPL EMPL_LAST_NAME JOB_TITLE MGR HIREDATE SALARY COMMISSION DEP
---- --------------- ---------- ---- --------- ---------- ---------- ---
7839 King President 17-NOV-11 5000 500
7566 Jones Manager 7839 02-APR-12 2975 200
7698 Blake Manager 7839 01-MAY-13 2850 300
7782 Raimi Manager 7839 09-JUN-12 2450 100
7902 Ford Analyst 7566 03-DEC-12 3000 200
7369 Smith Clerk 7902 17-DEC-12 800 200
7499 Michaels Sales 7698 20-FEB-18 1600 300 300
7521 Ward Sales 7698 22-FEB-19 1250 500 300
7654 Martin Sales 7698 28-SEP-18 1250 1400 300
7788 Scott Analyst 7566 09-NOV-18 3000 200
7844 Turner Sales 7698 08-SEP-19 1500 0 300
7876 Adams Clerk 7788 23-SEP-18 1100 400
7900 James Clerk 7698 03-DEC-17 950 300
7934 Miller Clerk 7782 23-JAN-16 1300 100
=====
showing (default) value of linesize:
=====
linesize 80
=====
here is how this query looks with a linesize of 50:
=====
EMPL EMPL_LAST_NAME JOB_TITLE MGR HIREDATE
---- --------------- ---------- ---- ---------
SALARY COMMISSION DEP
---------- ---------- ---
7839 King President 17-NOV-11
5000 500
7566 Jones Manager 7839 02-APR-12
2975 200
7698 Blake Manager 7839 01-MAY-13
2850 300
7782 Raimi Manager 7839 09-JUN-12
2450 100
7902 Ford Analyst 7566 03-DEC-12
3000 200
7369 Smith Clerk 7902 17-DEC-12
800 200
7499 Michaels Sales 7698 20-FEB-18
1600 300 300
7521 Ward Sales 7698 22-FEB-19
1250 500 300
7654 Martin Sales 7698 28-SEP-18
EMPL EMPL_LAST_NAME JOB_TITLE MGR HIREDATE
---- --------------- ---------- ---- ---------
SALARY COMMISSION DEP
---------- ---------- ---
1250 1400 300
7788 Scott Analyst 7566 09-NOV-18
3000 200
7844 Turner Sales 7698 08-SEP-19
1500 0 300
7876 Adams Clerk 7788 23-SEP-18
1100 400
7900 James Clerk 7698 03-DEC-17
950 300
7934 Miller Clerk 7782 23-JAN-16
1300 100
EMPL_LAST_NAME
---------------
King
Jones
Blake
Raimi
Ford
Smith
Michaels
Ward
Martin
Scott
Turner
Adams
James
Miller
=====
after using col command to change empl last name column heading:
=====
Employee
Last Name
---------------
King
Jones
Blake
Raimi
Ford
Smith
Michaels
Ward
Martin
Scott
Turner
Adams
James
Miller
=====
...and now with a format of a25:
=====
Employee
Last Name
-------------------------
King
Jones
Blake
Raimi
Ford
Smith
Michaels
Ward
Martin
Scott
Turner
Adams
James
Miller
=====
...and now with a format of a2:
=====
Em
La
--
Ki
ng
Jo
ne
s
Bl
ak
e
Ra
im
i
Fo
rd
Sm
it
h
Mi
ch
ae
ls
Em
La
--
Wa
rd
Ma
rt
in
Sc
ot
t
Tu
rn
er
Ad
am
s
Ja
me
s
Mi
ll
Em
La
--
er
=====
...and now with a format of s2 TRU (truncated)
=====
Em
La
--
Ki
Jo
Bl
Ra
Fo
Sm
Mi
Wa
Ma
Sc
Tu
Ad
Ja
Mi
=====
do NOT use A formats for NUMERIC columns!!!!!!
=====
SALARY
----------
##########
##########
##########
##########
##########
##########
##########
##########
##########
##########
##########
##########
##########
##########
=====
...after changing salary column format to 999999:
=====
SALARY
-------
5000
2975
2850
2450
3000
800
1600
1250
1250
3000
1500
1100
950
1300
=====
...and after changing it to 99999.99:
=====
SALARY
---------
5000.00
2975.00
2850.00
2450.00
3000.00
800.00
1600.00
1250.00
1250.00
3000.00
1500.00
1100.00
950.00
1300.00
=====
...and after changing it to 99999.999999:
=====
SALARY
-------------
5000.000000
2975.000000
2850.000000
2450.000000
3000.000000
800.000000
1600.000000
1250.000000
1250.000000
3000.000000
1500.000000
1100.000000
950.000000
1300.000000
=====
after writing a col command using a computed column's column alias:
=====
JOB_TITLE AVG_SALARY
---------- ----------
Manager 2758.33
Analyst 3000.00
Clerk 1037.50
President 5000.00
Sales 1400.00
=====
have given col commands for dept_num, empl_last_name, salary:
=====
Dept # Employee Salary
------ ---------- -----------
100 Miller $1300.00
100 Raimi $2450.00
200 Scott $3000.00
200 Jones $2975.00
200 Ford $3000.00
200 Smith $800.00
300 Martin $1250.00
300 Ward $1250.00
300 Blake $2850.00
300 Michaels $1600.00
300 James $950.00
300 Turner $1500.00
400 Adams $1100.00
500 King $5000.00
=====
previous query, but now breaking on dept_num:
=====
Dept # Employee Salary
------ ---------- -----------
100 Miller $1300.00
Raimi $2450.00
200 Scott $3000.00
Jones $2975.00
Ford $3000.00
Smith $800.00
300 Martin $1250.00
Ward $1250.00
Blake $2850.00
Michaels $1600.00
James $950.00
Turner $1500.00
400 Adams $1100.00
500 King $5000.00
=====
...now breaking on dept_num, also with skip 1:
=====
Dept # Employee Salary
------ ---------- -----------
100 Miller $1300.00
Raimi $2450.00
200 Scott $3000.00
Jones $2975.00
Ford $3000.00
Smith $800.00
300 Martin $1250.00
Ward $1250.00
Blake $2850.00
Michaels $1600.00
James $950.00
Turner $1500.00
400 Adams $1100.00
500 King $5000.00
=====
...now also with compute avg of salary on dept_num:
=====
Dept # Employee Salary
------ ---------- -----------
100 Miller $1300.00
Raimi $2450.00
****** -----------
avg $1875.00
200 Scott $3000.00
Jones $2975.00
Ford $3000.00
Smith $800.00
****** -----------
avg $2443.75
300 Martin $1250.00
Ward $1250.00
Blake $2850.00
Michaels $1600.00
James $950.00
Turner $1500.00
****** -----------
avg $1566.67
400 Adams $1100.00
****** -----------
avg $1100.00
500 King $5000.00
****** -----------
Dept # Employee Salary
------ ---------- -----------
avg $5000.00
=====
...now with compute count of salary on dept_num:
=====
Dept # Employee Salary
------ ---------- -----------
100 Miller $1300.00
Raimi $2450.00
****** -----------
count 2
200 Scott $3000.00
Jones $2975.00
Ford $3000.00
Smith $800.00
****** -----------
count 4
300 Martin $1250.00
Ward $1250.00
Blake $2850.00
Michaels $1600.00
James $950.00
Turner $1500.00
****** -----------
count 6
400 Adams $1100.00
****** -----------
count 1
500 King $5000.00
****** -----------
Dept # Employee Salary
------ ---------- -----------
count 1
=====
...now with a 3-line top title:
=====
Wed Nov 17 page 1
Beautiful
Three Line
Top Title
Dept # Employee Salary
------ ---------- -----------
100 Miller $1300.00
Raimi $2450.00
****** -----------
count 2
200 Scott $3000.00
Jones $2975.00
Ford $3000.00
Smith $800.00
****** -----------
count 4
300 Martin $1250.00
Ward $1250.00
Blake $2850.00
Michaels $1600.00
James $950.00
Turner $1500.00
****** -----------
count 6
400 Adams $1100.00
Wed Nov 17 page 2
Beautiful
Three Line
Top Title
Dept # Employee Salary
------ ---------- -----------
****** -----------
count 1
500 King $5000.00
****** -----------
count 1
=====
...now also with a 2-line bottom title:
=====
Wed Nov 17 page 1
Beautiful
Three Line
Top Title
Dept # Employee Salary
------ ---------- -----------
100 Miller $1300.00
Raimi $2450.00
****** -----------
count 2
200 Scott $3000.00
Jones $2975.00
Ford $3000.00
Smith $800.00
****** -----------
count 4
300 Martin $1250.00
Ward $1250.00
Blake $2850.00
Michaels $1600.00
James $950.00
Turner $1500.00
****** -----------
count 6
Gorgeous
Two Line BOTTOM Title
Wed Nov 17 page 2
Beautiful
Three Line
Top Title
Dept # Employee Salary
------ ---------- -----------
400 Adams $1100.00
****** -----------
count 1
500 King $5000.00
****** -----------
count 1
Gorgeous
Two Line BOTTOM Title
=====
and now clean up, resetting things changed back to SQL*Plus defaults:
=====