Professional Documents
Culture Documents
3 Buvanes
3 Buvanes
3 Buvanes
Table created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
PRODNAME PRODNO
------------------------------ ------------
table 10001
chair 10010
desk 10110
cot 11110
sofa 10010
tv stand 11010
8208E21CSR020
6 rows selected.
Table created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
Table created.
1 row created.
8208E21CSR020
SQL> insert into sstud1 values('anand','Madurai');
1 row created.
1 row created.
1 row created.
SNAME PLACE
-------------------- --------------------
prajan chennai
anand Madurai
Buvanes Nagai
Prem Ramnad
Table created.
1 row created.
1 row created.
1 row created.
1 row created.
8208E21CSR020
-------------------- ---------- ----------
anand IT 650
SNAME DEPT
-------------------- ----------
prajan CSE
anand IT
Buvanes CSE
Prem CSE
SNAME DEPT
-------------------- ----------
prajan CSE
anand IT
Buvanes CSE
Prem CSE
SQL> select sstud1.sname,dept from sstud1 left outer join sstud2 on(sstud1.sname=sstud2.sname);
SNAME DEPT
-------------------- ----------
prajan CSE
anand IT
Buvanes CSE
8208E21CSR020
Prem CSE
SQL> select sstud1.sname,dept from sstud1 right outer join sstud2 on(sstud1.sname=sstud2.sname);
SNAME DEPT
-------------------- ----------
prajan CSE
anand IT
Buvanes CSE
Prem CSE
SQL> select sstud1.sname,dept from sstud1 full outer join sstud2 on(sstud1.sname=sstud2.sname);
SNAME DEPT
-------------------- ----------
prajan CSE
anand IT
Buvanes CSE
Prem CSE
SQL> select sname from sstud1 where sstud1.sname in (select sstud2.sname from sstud2);
SNAME
--------------------
prajan
anand
Buvanes
Prem
SQL> select sname from sstud1 where sstud1.sname not in (select sstud2.sname from sstud2);
no rows selected
SQL> select sname from sstud2 where marks>some (select marks from sstud2 where dept='CSE');
8208E21CSR020
SNAME
--------------------
prajan
anand
Buvanes
SQL> select sname from sstud2 where marks>=some (select marks from sstud2 where dept='CSE');
SNAME
--------------------
prajan
anand
Buvanes
Prem
SQL> select sname from sstud2 where marks>=any (select marks from sstud2 where dept='CSE');
SNAME
--------------------
prajan
anand
Buvanes
Prem
SQL> select sname from sstud2 where marks>any (select marks from sstud2 where dept='CSE');
SNAME
--------------------
prajan
anand
Buvanes
8208E21CSR020
SQL> select sname from sstud2 where marks>all (select marks from sstud2 where dept='CSE');
no rows selected
SQL> select sname from sstud2 where marks<all (select marks from sstud2 where dept='CSE');
no rows selected
SQL> select sname from sstud1 where exists (select sstud2.sname from sstud2 where
sstud1.sname=sstud2.sname);
SNAME
--------------------
prajan
anand
Buvanes
Prem
SQL> select sname from sstud1 where not exists (select sstud2.sname from sstud2 where
sstud1.sname=sstud2.sname);
no rows selected
8208E21CSR020