Please send questions to
st10@humboldt.edu .
Howdy there CIS 315
SQL>
SQL> select *
2 from empl;
EMPL EMPL_LAST_NAME JOB_TITLE MGR HIREDATE SALARY COMMISSION DEP
---- --------------- ---------- ---- --------- ---------- ---------- ---
7839 King President 17-NOV-91 5000 500
7566 Jones Manager 7839 02-APR-91 2975 200
7698 Blake Manager 7839 01-MAY-91 2850 300
7782 Raimi Manager 7839 09-JUN-91 2450 100
7902 Ford Analyst 7566 03-DEC-91 3000 200
7369 Smith Clerk 7902 17-DEC-90 800 200
7499 Michaels Salesman 7698 20-FEB-91 1600 300 300
7521 Ward Salesman 7698 22-FEB-91 1250 500 300
7654 Martin Salesman 7698 28-SEP-91 1250 1400 300
7788 Scott Analyst 7566 09-NOV-91 3000 200
7844 Turner Salesman 7698 08-SEP-91 1500 0 300
EMPL EMPL_LAST_NAME JOB_TITLE MGR HIREDATE SALARY COMMISSION DEP
---- --------------- ---------- ---- --------- ---------- ---------- ---
7876 Adams Clerk 7788 23-SEP-91 1100 400
7900 James Clerk 7698 03-DEC-91 950 300
7934 Miller Clerk 7782 23-JAN-92 1300 100
14 rows selected.
SQL>
SQL> --------
SQL> -- NOTE: PLEASE set echo OFF again after debugging, typically;
SQL> -- it can make for LONG spooled results files...
SQL> --------
SQL>
SQL> set echo off
MAX(SALARY)
-----------
1300
EMPL
----
7934
EMPL_LAST_NAME SALARY
--------------- ----------
Miller 1300
EMPL_LAST_NAME HIREDATE
--------------- ---------
Raimi 09-JUN-91
DEP
---
200
EMPL_LAST_NAME SALARY
--------------- ----------
Scott 3000
Jones 2975
Ford 3000
Smith 800
MGR
----
7782
EMPL_LAST_NAME
---------------
Raimi
HIREDATE
---------
23-JAN-92
09-JUN-91
17-NOV-91
EMPL_LAST_NAME DEPT_NAME
--------------- ---------------
Adams Operations
EMPL_LAST_NAME DEPT_NAME
--------------- ---------------
Adams Operations
ENAME DNAME
--------------- ---------------
Adams Operations
ENAME DNAME
--------------- ---------------
Adams Operations
select empl_last_name, dname
*
ERROR at line 1:
ORA-00904: "EMPL_LAST_NAME": invalid identifier
EMPL_LAST_NAME
---------------
Raimi
Scott
EMPL
----
7369
7876
7900
7934
MGR
----
7902
7788
7698
7782
(select mgr
*
ERROR at line 4:
ORA-01427: single-row subquery returns more than one row
EMPL_LAST_NAME
---------------
Blake
Raimi
Scott
Ford
EMPL_LAST_NAME SALARY
--------------- ----------
Scott 3000
Jones 2975
Ford 3000
Smith 800
EMPL_LAST_NAME SALARY
--------------- ----------
Scott 3000
Jones 2975
Ford 3000
Smith 800
EMPL_LAST_NAME SALARY
--------------- ----------
Scott 3000
Jones 2975
Ford 3000
Smith 800
Manager Clerk's name Clerk's salary
--------------- --------------- --------------
Raimi Miller 1300
Manager Clerk's name Clerk's salary
--------------- --------------- --------------
Raimi Miller 1300
MIN(SALARY)
-----------
1250
EMPL EMPL_LAST_NAME JOB_TITLE MGR HIREDATE SALARY COMMISSION DEP
---- --------------- ---------- ---- --------- ---------- ---------- ---
7934 Miller Clerk 7782 23-JAN-92 1300 100
EMPL_LAST_NAME DEPT_LOC
--------------- ---------------
Miller New York
EMPL_LAST_NAME DEPT_LOC
--------------- ---------------
Miller New York
DEPT_NAME DEPT_LOC
--------------- ---------------
Research Dallas
Sales Chicago
DEPT_NAME DEPT_LOC
--------------- ---------------
Research Dallas
Research Dallas
Sales Chicago
Sales Chicago
Sales Chicago
DEPT_NAME DEPT_LOC
--------------- ---------------
Research Dallas
Research Dallas
Sales Chicago
Sales Chicago
Sales Chicago
DEPT_NAME DEPT_LOC
--------------- ---------------
Research Dallas
Sales Chicago
DEPT_NAME DEPT_LOC
--------------- ---------------
Research Dallas
Sales Chicago
'
-
b
b
b
b
b
b
b
b
b
b
b
b
b
b
14 rows selected.
DEPT_NUM||DEPT_NAM
------------------
600Computer
100Accounting
200Research
300Sales
400Operations
500Management
6 rows selected.
Department
---------------------
600 - Computer
100 - Accounting
200 - Research
300 - Sales
400 - Operations
500 - Management
6 rows selected.
insert into dept
*
ERROR at line 1:
ORA-00001: unique constraint (ST10.SYS_C0014401) violated
DEPT_LOC DEPT_NAME
--------------- ---------------
New York Accounting
Dallas Research
Chicago Sales
Boston Operations
New York Management
DEPT_LOC DEPT_NAME
--------------- ---------------
Arcata Computer
DEPT_LOC DEPT_NAME
--------------- ---------------
Arcata Computer
New York Accounting
Dallas Research
Chicago Sales
Boston Operations
New York Management
6 rows selected.
no rows selected
no rows selected
DEPT_LOC DEPT_NAME
--------------- ---------------
Arcata Computer
DEPT_LOC DEPT_NAME
--------------- ---------------
Arcata Computer
VID_ID
------
120011
130012
220032
230033
210031
VID_ID
------
120011
130012
220032
230033
210031
Client of interest
--------------------------------
Beta, Edie
Client of interest
--------------------------------
Beta, Edie
MOVIE_TITLE
----------------------------------------
Star Wars
Gone with the Wind
Indiana Jones and the Temple of Doom
MOVIE_TITLE
----------------------------------------
Star Wars
Gone with the Wind
Indiana Jones and the Temple of Doom
Customer Customer Rep
------------------------------------- ---------------
Secondly, Second Martin
Customer Customer Rep
------------------------------------- ---------------
Secondly, Second Martin
DEPT_LOC
---------------
Dallas
Chicago
DEPT_LOC
---------------
Dallas
Chicago
DEPT_LOC
---------------
Dallas
Chicago
DEPT_LOC
---------------
Dallas
Chicago
DEPT_LOC
---------------
Dallas
Dallas
Chicago
Chicago
DEPT_LOC
---------------
Dallas
Dallas
Chicago
Chicago