0% found this document useful (0 votes)
5 views4 pages

Exp 8

Uploaded by

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

Exp 8

Uploaded by

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

Experiment: 8

AIM: To implement the program for Set Operators & Views.


Program:
SQL> create table z(id number(10),name varchar(10));

Table created.

SQL> insert into z values(1,'a');

1 row created.

SQL> insert into z values(2,'b');

1 row created.

SQL> create table z1(id number(10),name varchar(10));

Table created.

SQL> insert into z1 values(2,'b');

1 row created.
SQL> insert into z1 values(3,'c');

1 row created.

SQL> insert into z1 values(4,'d');

1 row created.

SQL> select * from z;

ID NAME

---------- ----------

1a

2b

SQL> select * from z1;

ID NAME

---------- ----------

2b

3c

4d
SQL> select * from z union select * from z1;

ID NAME

---------- ----------

1a

2b

3c

4d

SQL> select * from z union all select * from z1;

ID NAME

---------- ----------

1a

2b

2b

3c

4d

SQL> select * from z intersect select * from z1;


ID NAME

---------- ----------

2b

SQL> select * from z minus select * from z1;

ID NAME

---------- ----------

1a

SQL> select * from z1 minus select * from z;

ID NAME

---------- ----------

3c

4d

OUTPUT:

Result: The above query has been implemented successfully

You might also like