exp5 - 1 row created. SQL> select *from borrower; C_ID...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Aim : To study Set operations in SQL RISHI AGARWAL ROLL NO 02 SE CMPN A SQL> create table depositor(C_id integer,C_name varchar(25),Amt integer); Table created. SQL> insert into depositor values(001,'RISHI',1000); 1 row created. SQL> insert into depositor values(001,'AGARWAL',7000); 1 row created. SQL> insert into depositor values(003,'DRAGON',50000); 1 row created. SQL> insert into depositor values(004,PARADOX',20000); ERROR: ORA-01756: quoted string not properly terminated SQL> insert into depositor values(004,'PARADOX',20000); 1 row created. SQL> select *from depositor; C_ID C_NAME AMT ---------- ------------------------- ---------- 1 RISHI 1000 1 AGARWAL 7000 3 DRAGON 50000 4 PARADOX 20000 SQL> create table borrower(C_id integer,C_Name varchar(25),Amt integer); Table created.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
SQL> insert into borrower values(001,'AGARWAL',70000); 1 row created. SQL> insert into borrower values(002,'DRAGON',5000); 1 row created. SQL> insert into borrower values(004,'PARADOX',20000);
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 row created. SQL> select *from borrower; C_ID C_NAME AMT---------- ------------------------- ----------1 AGARWAL 70000 2 DRAGON 5000 4 PARADOX 20000 SQL> select Amt from depositor union(select amt from borrower); AMT----------1000 5000 7000 20000 50000 70000 6 rows selected. SQL> select Amt from depositor union all(select amt from borrower); AMT----------1000 7000 50000 20000 70000 5000 20000 7 rows selected. SQL> select Amt from depositor intersect(select amt from borrower); AMT----------20000 SQL> select C_Name from depositor intersect(select C_Name from borrower); C_NAME-------------------------AGARWAL DRAGON PARADOX SQL> select Amt from depositor minus(select amt from borrower); AMT----------1000 7000 50000 SQL> select Amt from depositor group by Amt having avg(Amt)<=all(select avg(Amt) from borrower group by Amt); AMT----------1000...
View Full Document

This note was uploaded on 10/25/2010 for the course CMPN SEM4 taught by Professor Thakur during the Spring '07 term at University of Mumbai.

Page1 / 3

exp5 - 1 row created. SQL> select *from borrower; C_ID...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online