Obtaining a natural join by specifying the common columns, PL-SQL Programming

Obtaining a natural join by specifying the common columns

Synatax:

SELECT * FROM IS_CALLED JOIN IS_ENROLLED_ON USING ( StudentId )

However, a named columns join doesn't always have an equivalent formulation using NATURAL JOIN. That's because although each USING column must be a common column, it is not necessary to specify all the common columns.

A common column whose name does not appear in the USING list gives rise to two columns of that name in the result, which therefore does not represent a relation. To cater for cases where the columns used for matching purposes are not common columns, and/or the matching operator is not "=", the required joining condition can be spelled out as shown in Example, in parentheses following the key word ON.

Posted Date: 1/18/2013 4:50:29 AM | Location : United States







Related Discussions:- Obtaining a natural join by specifying the common columns, Assignment Help, Ask Question on Obtaining a natural join by specifying the common columns, Get Answer, Expert's Help, Obtaining a natural join by specifying the common columns Discussions

Write discussion on Obtaining a natural join by specifying the common columns
Your posts are moderated
Related Questions
How do I display usernames for students from a student table, assigning each student a username initials001 (initials is the actual student initials), and if the students initials

Assignments in pl/sql The Variables and constants are initialized every time a block or subprogram is entered. By default, the variables are initialized to NULL. Therefore, unle

Updating Objects: To change the attributes of objects in an object table, you can use the UPDATE statement, as the illustration below shows: BEGIN UPDATE persons p SET p

Effect of Anonymous Columns Now, recall that a VALUES expression denotes a table with undefined column names. If an initial value is to be specified when a base table is creat

Advantages of Invoker Rights The Invoker-rights routines centralize the data retrieval. They are particularly helpful in applications which store data in various schemas. In su

Using Invoker Rights: By default, the stored procedure executes with the privileges of its definer, not its invoker. These procedures are bound to the schema in which they inh

Creating and Destroying Base Tables: Example shows an SQL command to create the base table counterpart of the ENROLMENT variable Example  Creating a base table. CREATE T

Literature review

Anatomy of a Command Figure, showing a simple SQL command, is almost identical to its counterpart in the theory book. The only difference arises from the fact that SQL uses a

Using Aggregation on Nested Tables Example is the most direct translation of its counterpart in the theory book that can be obtained in SQL but it is so over-elaborate that no