You are on page 1of 4

How to download Oracle?

Step1: serach for oracle express edition download for windows

Step2: Accept license aggreement and


download the sw by creating the account.

Step3:Unzip or Extract ,Install.

how to start oracle?

Step1: Wind+r type sqlplus


step2: enter username and password

list of user accounts:

select * from all_users;

How to create your own account?

login as sys:
-------------

connect sys as sysdba


password: sys

sql>create user user1 identified by user1;

sql>grant dba to user1;

SQL> connect
Enter user-name: keerthana
Enter password:
Connected.

--run the db creation script.

List of the tables

SQL> select * from cat;

TABLE_NAME TABLE_TYPE
------------------------------ -----------
BONUS TABLE
DEPT TABLE
EMP TABLE
SALGRADE TABLE

Understand the contents of the table:

select * from <table_name>;

SQL> select * from dept;

DEPTNO DNAME LOC


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

waqtfo all the dnames?

SQL> select dname from dept;

DNAME
--------------
ACCOUNTING
RESEARCH
SALES
OPERATIONS

Note:

SQL is not case sensitive.


Every SQL should end with ;
column and table names should be used as is.

waqtfo all the dname and deptno?

select dname,deptno
from dept;

waqtfo all the dept details?

select * from dept;

waqtfo all the enames and sal?

select ename,sal
from emp;

---calculation fields

waqtfo all the ename sal and annual sal?

select ename,sal,sal*12 from emp;


ENAME SAL SAL*12
---------- ---------- ----------
SMITH 800 9600
ALLEN 1600 19200
WARD 1250 15000
JONES 2975 35700
MARTIN 1250 15000
BLAKE 2850 34200
CLARK 2450 29400
SCOTT 3000 36000
KING 5000 60000
TURNER 1500 18000
ADAMS 1100 13200
JAMES 950 11400
FORD 3000 36000
MILLER 1300 15600
waqtfo all the ename sal and annual sal
if it is increased by 14 percentage?

select ename,sal,sal*1.14*12 from emp;

ENAME SAL SAL*1.14*12


---------- ---------- -----------
SMITH 800 10944
ALLEN 1600 21888
WARD 1250 17100
JONES 2975 40698
MARTIN 1250 17100
BLAKE 2850 38988
CLARK 2450 33516
SCOTT 3000 41040
KING 5000 68400
TURNER 1500 20520
ADAMS 1100 15048
JAMES 950 12996
FORD 3000 41040
MILLER 1300 17784
note:

new sal = sal + sal *0.14


new sal = sal (1+ 1 *0.14)
new sal = sal *1.14*12

select deptno,location
from dept;

You might also like