Set Operations - 1 SetOperations

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

View Full Document Right Arrow Icon
1 Set Operations In Oracle, set operators enable you to combine the results from 2 or more  select statements. The output of each statement is treated as a data set.  The operators discussed in the handout are UNION, UNION ALL, MINUS,  INTERSECT, and DIVIDE. Compatibility Rules 1. The result sets of queries must have the same number of columns. 2. The datatype of each column in the second result set must match (or  can be implicitly casted to) the datatype of its corresponding column  in a first result set. Exercises For UNION, UNION ALL, MINUS, and INTERSECT operators exercises,  use dbst651_students table we created earlier and create itec640_studets table with  similar structure. Let itec640_studets contain the first 2 rows from dbst651_students  table (The shortcut to create the table is explained on the last page of the handout in  other notes section).
Background image of page 1

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

View Full DocumentRight Arrow Icon
2
Background image of page 2
3 1. UNION List students currently enrolled in dbst651 or in itec640 class. If a student is  enrolled in both classes,  list that student once . Union incompatibility 1. Selects statements return different number of columns 2. Corresponding columns have incompatible datatypes. For example, grade is  a character, and birthday is a data.
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 3. Bonus: Check if you get an error if I select only the first 2 characters of the 
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/22/2009 for the course DBST DBST 651 taught by Professor Yelena - ta during the Spring '09 term at MD University College.

Page1 / 12

Set Operations - 1 SetOperations

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

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