Ex No 3
Ex No 3
Ex No 3
NO:3
CREATE
Table created.
EID NUMBER(5)
NAME VARCHAR2(10)
DOJ DATE
AGE NUMBER(5)
SALARY NUMBER(10)
Table created.
SQL> desc test1105;
EID NUMBER(5)
NAME VARCHAR2(10)
DOJ DATE
AGE NUMBER(5)
SALARY NUMBER(10)
no rows selected
INSERT
4 rows created.
ROWID
------------------
AAADVOAABAAAI1aAAA
AAADVOAABAAAI1aAAB
AAADVOAABAAAI1aAAC
AAADVOAABAAAI1aAAD
ROWID
------------------
AAADVPAABAAAI1iAAA
AAADVPAABAAAI1jAAA
AAADVPAABAAAI1jAAB
AAADVPAABAAAI1jAAC
AAADVPAABAAAI1jAAD
1 row deleted.
ALIAS
SAL
----------
15000
25000
20000
25000
7 rows selected.
EID NUMBER(5)
NAME VARCHAR2(10)
DOJ DATE
AGE NUMBER(5)
SALARY NUMBER(10)
ARITHMETIC OPERATORS
NAME
----------
aaa
EID+10 NAME
---------- ----------
110 aaa
111 aaa
112 bbb
113 ccc
4 rows updated.
SQL> select * from emp105 where eid between 109 and 110;
SQL> select * from emp105 where eid not between 109 and 110;
no rows selected
SQL> select * from emp105 where eid not in(select eid from emp105 where eid!=110
);
no rows selected
no rows selected
SQL> select * from emp105 where salary >= (select min(salary) from emp105);
LOGICAL OPERATORS
no rows selected
SQL> select * from emp105 where name not in(select name from emp105 where eid=11
0);
SQL> select * from emp105 where eid=110 or name in(select name from emp105 where
eid=112);
EID NUMBER(5)
NAME VARCHAR2(10)
DOJ DATE
AGE NUMBER(5)
SALARY NUMBER(10)
Table altered.
Table dropped.
Table created.
Table created.
EID NUMBER(5)
EID
----------
110
111
112
113
Table created.
4 rows deleted.
4 rows created.
4 rows deleted.
4 rows created.
EID NAME
---------- ----------
110
111
112
113
4 rows created.
EID NAME
---------- ----------
110
111
112
113
110 aaa
111 aaa
112 bbb
113 ccc
8 rows selected.
RESULT:
Thus the various select statements and operators were executed and verified successfully.