Closest approximation to relational union - sql, PL-SQL Programming

Closest Approximation to Relational Union - SQL

Actually, just as SQL has several varieties of JOIN, it also has several varieties of UNION, none of which is equivalent to the relational operator of that name. The closest approximation to relational union is illustrated in Example.

Example: SQL's closest approximation to relational union

SELECT StudentId

FROM IS_CALLED

WHERE Name = 'Devinder'

UNION DISTINCT CORRESPONDING

SELECT StudentId

FROM IS_ENROLLED_ON

WHERE CourseId = 'C1'

The key word DISTINCT is optional and implied by default (somewhat curiously so, considering that its opposite, ALL, is the default option in the SELECT clause). It specifies that no row is to appear more than once in the result. Thus, there is never a need to include DISTINCT in either of the SELECT clauses, and this would be the case even if the WHERE clause were omitted from the specification of the second operand in Example, allowing the same StudentId value to appear more than once in that operand.

The key word CORRESPONDING specifies that operand columns are to be paired by name, just as in relational union.

Posted Date: 1/18/2013 5:28:12 AM | Location : United States







Related Discussions:- Closest approximation to relational union - sql, Assignment Help, Ask Question on Closest approximation to relational union - sql, Get Answer, Expert's Help, Closest approximation to relational union - sql Discussions

Write discussion on Closest approximation to relational union - sql
Your posts are moderated
Related Questions
Tautology - Equivalences Rules: If there Tautologies are not all the time as much easy to note as the one above so than we can use these truth tables to be definite that a sta

Problem: (a) Define the following terms: (i) data mining. (ii) OLAP. (b) Differentiate between snowflake schema and star schema. Support your answer with appropriate

Using DEFAULT You can use the keyword DEFAULT rather than that of the assignment operator to initialize the variables. For e.g. the declaration blood_type CHAR := ’O’; it can b

Joining in SQL Joining IS_CALLED and IS_ENROLLED_ON in SQL SELECT * FROM IS_CALLED NATURAL JOIN IS_ENROLLED_ON This is an example of an SQL table expression. I have been

CURRVAL and NEXTVAL The series is a schema object which generates the sequential numbers. Whenever you form a sequence, you can specify its primary value and an increment. T

Package Specification The package specifications contain the public declarations. The scopes of these declarations are local to your database representation and global to the

BIOCHE M ICA L ORIGIN OF LIFE - It is generally agreed by astronomers, geologists and biologists that the earth is approximately 4500-5000 million years old. It is an

to write a heap sort program usin pl-sql

Operators on Tables and Rows Row Extraction TUPLE FROM r, SQL has row subqueries. These are just like scalar subqueries except that they may specify more than one column.

Set Operators The Set operators combine the results of the two queries into one result. The INTERSECT returns all the distinct rows selected by both queries. The MINUS returns