Hub Of Geekz

  • Home
  • About Me
  • Contact Us
  • Home
  • Languages
    • C++
    • Java
    • Perl
    • Prolog
    • Bootstrap
  • Database
    • SQL
    • PL/SQL
  • Study
    • Java
      • Java Collection
      • Java Concurrency
      • Java Interview Questions
      • Java Networking
    • Number System
  • Kavita
  • Entertainment
    • Hinglish Cafe
    • Videos
    • Jokes
  • Windows Tricks
  • How To

Sunday, 28 April 2013

To create a set of operation in simple database table using CREATE,INSERT,UNION,INTERSECTION and MINUS

 Earthcare Foundation NGO     22:36     SQL     No comments   


Experiment-03
Object:To create a set of operation in simple database table using CREATE,INSERT,UNION,INTERSECTION and MINUS.

Requirement:Windows XP,Oracle 9i.

Program Code:
SQL>create table avneesh
       2 (name        char(20),
       3 id                number(15),
       4 dob            date);
Table Created.
SQL >Insert  into avneesh values(‘avneesh’,’1031030015’,’28-MAR-1992’);
1.row created
SQL >Insert  into avneesh values(‘ashish’,’1031030041’,’28-APR-1992’);
1.row created
SQL >Insert  into avneesh values(‘abhishek’,’1031030007’,’15-APR-1991’);
1.row created
SQL>create table avneesh1
       2 (name                   char(20),
       3  id                          number(15),
       4  dob                      date,
     5  place                        char(20));

Table Created.
SQL>Insert into avneesh1 values(‘aman’,’1031030200’,’12-MAY-1994’,’varanasi’);
1.row created
SQL>Insert into avneesh1 values(‘avneesh’,’1031030015’,’28-MAR-1992’,’varanasi’);
1.row created
SQL>Insert into avneesh1 values(‘amol’,’1031030035’,’28-DEC-1993’,’mumbai’);
1.row created
SQL>desc avneesh;
Name                                           Null?          Type
--------- -------------------- --------------------
Name                                                           char(20)
Id                                                                  number(15)
Dob                                                               Date

SQL>desc avneesh1;
Name                                           Null?          Type
--------- -------------------- --------------------
Name                                                             char(20)
Id                                                                    number(15)
Dob                                                                Date
Place                                                              char(20)
SQL>select * from avneesh;
Name                                id                    dob
--------- -------------------- --------------------
avneesh                   1031030015          28-MAR-1992
ashish                   1031030041          28-APR-1992
abhishek              1031030007           15-APR-1991
SQL>select * from avneesh1;

Name                                id                    dob                place
--------- -------------------- --------------------
aman                 1031030200      12-MAY-1994       varanasi
avneesh                1031030015      28-MAR-1992       varanasi
amol                  1031030035      28-DEC-1993         mumbai

SQL>select id from avneesh union select id from avneesh1;
id
------------------
1031030015
1031030041
1031030007
1031030200
1031030035
SQL>select id from avneesh intersect select id from avneesh1;
id
-------------
1031030015
SQL>select id from avneesh minus select id from avneesh1;
id
-------------
1031030007
1031030008












Result:The above database operation has been done successfully.
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Ad


Jobsmag.inIndian Education BlogThingsGuide

Subscribe

Do you want fresh and hot updates about us? Then subscribe to our Feeds.

Total Pageviews

Popular Posts

  • Write a program in PL/SQL to print the factorial of a number.
    In this post I will explain how to get the factorial of any given number. For that first you need to know what is the procedure to find ...
  • To find the GCD of two numbers in PROLOG.
    gcd(X,Y):-X=Y,write('GCD of two numbers is '),write(X); X=0,write('GCD of two numbers is '),write(Y); Y=0,write('G...
  • Write a PL/SQL code to get the Fibonacci Sequence
    First, I will explain what is Fibonacci Sequence and how to get this series. So, Fibonacci Sequence is a series of numbers 0,1,1,2,3,5,8,1...

Label

All Articles Best Resources Blogging Boost Traffic Bootstrap C Plus Plus Collection Comedy Comedy Posts Comedy Videos Concurrency creative commons website Education Employee Entertainment Fibonacci Sequence free images GirlFriend Hinglish Cafe How To Image Websites Inspirational Java Java Interview Questions Java Networking Kavita Sangrah Life Lock Sreen Love Number System Patterns Perl Picture PL/SQL Plastic Engineering Programming Prolog public domain SEO Servlet Short Story Shortcut Keys Social Media Social Services SQL SuVichar Thread Traffic True Events Ultimate Guide Windows Tricks Windows8.1 WordPress

Blog Archive

  • ►  2020 (43)
    • ►  September (41)
    • ►  August (2)
  • ►  2019 (1)
    • ►  July (1)
  • ►  2018 (9)
    • ►  September (7)
    • ►  July (1)
    • ►  May (1)
  • ►  2017 (8)
    • ►  June (3)
    • ►  May (3)
    • ►  March (1)
    • ►  January (1)
  • ►  2016 (2)
    • ►  September (1)
    • ►  January (1)
  • ►  2015 (91)
    • ►  December (1)
    • ►  November (1)
    • ►  October (6)
    • ►  May (10)
    • ►  March (20)
    • ►  February (50)
    • ►  January (3)
  • ►  2014 (339)
    • ►  December (1)
    • ►  October (55)
    • ►  September (58)
    • ►  August (94)
    • ►  July (64)
    • ►  June (67)
  • ▼  2013 (34)
    • ►  August (5)
    • ▼  April (29)
      • Write a PL/SQL code to find the greatest number am...
      • Write a PL/SQL code to create and use process.
      • Write a PL/SQL code to get the Fibonacci Sequence
      • Write a PL/SQL code to implement after row trigger.
      • Write a PL/SQL code to calculate total sal of emp ...
      • Cursor in PL/SQL.
      • Write a program in PL/SQL to print the following p...
      • Write a program in PL/SQL to print the factorial o...
      • To calculate the areas of circles of given radius ...
      • To perform mathematical operation of two numbers u...
      • To perform the string function in simple database ...
      • To perform the numeric function in simple database...
      • To perform logical operations in simple database t...
      • To perform the group function in simple database T...
      • To create the simple relationship between two tabl...
      • To create a set of operation in simple database ta...
      • To alter table of a simple database using CREATE,A...
      • To create a database table using Create, Desc, Ins...
      • To write program in PROLOG to implement Tower in ...
      • To find the sum of given list in PROLOG
      • To create relations in PROLOG
      • To find the largest of three numbers in PROLOG.
      • To find the largest of three numbers in PROLOG.
      • To find the larger of two numbers in PROLOG.
      • To find the GCD of two numbers in PROLOG.
      • To find the factorial of given number in PROLOG.
      • To count the number of elements in a list in PROLOG.
      • To construct a binary tree in PROLOG
      • To perform arithmetic operations in PROLOG
  • ►  2012 (20)
    • ►  November (1)
    • ►  October (15)
    • ►  September (4)

Author

  • Earthcare Foundation NGO
  • Kavita house
  • Unknown
  • Unknown

Info

Copyright © Hub Of Geekz | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates