0% found this document useful (0 votes)
21 views6 pages

Lab Number 1

The document shows SQL commands being run to connect to an Oracle database as different users, view table and user information, and run queries on the JOBS table. Key points: 1) The SYS user connects and then the HR user connection is denied due to invalid password. 2) The HR password is unlocked and then the user connects successfully. 3) Queries are run to view the tables, columns in the JOBS table, and minimum and maximum salaries.

Uploaded by

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

Lab Number 1

The document shows SQL commands being run to connect to an Oracle database as different users, view table and user information, and run queries on the JOBS table. Key points: 1) The SYS user connects and then the HR user connection is denied due to invalid password. 2) The HR password is unlocked and then the user connects successfully. 3) Queries are run to view the tables, columns in the JOBS table, and minimum and maximum salaries.

Uploaded by

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

1

LAB NO = 01
1. SQL> conn sys as sysdba
Enter password:
Connected.

2. SQL> show user


USER is "SYS"

3. SQL> conn hr
Enter password:

ERROR:
ORA-01017: invalid username/password; logon denied
Warning: You are no longer connected to ORACLE.

4. SQL> alter user HR identified by hr account unlock;


SP2-0640: Not connected

5. SQL> show user


USER is ""

6. SQL> conn hr
Enter password:
Connected.
2

7. SQL> select *from tab;


TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
REGIONS TABLE
COUNTRIES TABLE
LOCATIONS TABLE
DEPARTMENTS TABLE
JOBS TABLE
EMPLOYEES TABLE
JOB_HISTORY TABLE
EMP_DETAILS_VIEW VIEW
8 rows selected.

8. SQL> select *from JOBS;


JOB_ID JOB_TITLE MIN_SALARY MAX_SALARY
---------- ----------------------------------- ---------- ----------
AD_PRES President 20000 40000
AD_VP Administration Vice President 15000 30000
AD_ASST Administration Assistant 3000 6000
FI_MGR Finance Manager 8200 16000
FI_ACCOUNT Accountant 4200 9000
AC_MGR Accounting Manager 8200 16000
AC_ACCOUNT Public Accountant 4200 9000
SA_MAN Sales Manager 10000 20000
SA_REP Sales Representative 6000 12000
3

PU_MAN Purchasing Manager 8000 15000


PU_CLERK Purchasing Clerk 2500 5500

JOB_ID JOB_TITLE MIN_SALARY MAX_SALARY


---------- ----------------------------------- ---------- ----------
ST_MAN Stock Manager 5500 8500
ST_CLERK Stock Clerk 2000 5000
SH_CLERK Shipping Clerk 2500 5500
IT_PROG Programmer 4000 10000
MK_MAN Marketing Manager 9000 15000
MK_REP Marketing Representative 4000 9000
HR_REP Human Resources Representative 4000 9000
PR_REP Public Relations Representative 4500 10500
19 rows selected.

9. SQL> select max_salary from JOBS;


MAX_SALARY
----------
40000
30000
6000
16000
9000
16000
9000
20000
4

12000
15000
5500

MAX_SALARY
----------
8500
5000
5500
10000
15000
9000
9000
10500
19 rows selected.

10. SQL> select min_salary from JOBS;


MIN_SALARY
----------
20000
15000
3000
8200
4200
8200
4200
5

10000
6000
8000
2500

MIN_SALARY
----------
5500
2000
2500
4000
9000
4000
4000
4500
19 rows selected.

11. SQL> select max_salary , min_salary from JOBS;


MAX_SALARY MIN_SALARY
---------- ----------

40000 20000
30000 15000
6000 3000
16000 8200
9000 4200
16000 8200
9000 4200
6

20000 10000
12000 6000
15000 8000
5500 2500

MAX_SALARY MIN_SALARY
---------- ----------
8500 5500
5000 2000
5500 2500
10000 4000
15000 9000
9000 4000
9000 4000
10500 4500

19 rows selected.

You might also like