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
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.

Transaction Control The Oracle is transaction oriented; that is, Oracle uses the transactions to make sure the data integrity. The transaction is a sequence of SQL data manip

%TYPE Attribute The %TYPE attribute gives the datatype of a record, field, nested table, database column, or the variable. You can use the %TYPE attribute as the datatype speci

Cursors The Oracle uses work areas to execute the SQL statements and to store process information. A PL/SQL construct known as the cursor. Let's you assume name a work area and

i NEED THE QURIES TO SOME OF THE PROBLEMS USING plsql

Manipulating Collections Within PL/SQL, the collections add procedural power and flexibility. The biggest benefit is that your program can compute subscripts to process the spec

The requirements as follows: Create a folder called "SECURITY" on the server and upload all your project files to that folder. Please note, the "SECURITY" folder is NOT to be IN

SQL outer join SELECT * FROM IS_CALLED NATURAL LEFT JOIN IS_ENROLLED_ON Note that adding LEFT to an invocation of CROSS JOIN has no effect unless the right-hand operand

Explicit Cursors The set of rows returned by the query can include zero, one, or multiple rows, depending on how many rows meet your search criteria. Whenever a query returns

Wrapping and unwrapping in SQL Operators WRAP and UNWRAP in connection with attributes whose declared types are tuple types. Example shows how extension and projection can be