Row counterparts of table operators - sql, PL-SQL Programming

Row Counterparts of Table Operators

SQL does not have counterparts tuple rename, tuple projection, tuple extension, tuple join and tuple compose. To obtain the same effects as these operators on row r, one has first to derive the table t consisting of just r, then apply the SQL counterpart of the corresponding relational operator on t, putting parentheses around the table expression so that, so long as the context is appropriate, it becomes a row subquery. For example, if r has fields named a, b, and c, we can simulate a tuple renaming of a tuple projection to obtain the row consisting of just a and b, with b renamed to x, by (SELECT a, x FROM VALUES (r) AS t(a, x, c)).

The snag here is that the columns of a VALUES expression have implementation-dependent names, so we cannot rely on the field names of r being propagated to the table. We therefore have to specify the names in parentheses after the range variable name, t. At least that gives us the slight short cut of renaming b as x on the fly, so to speak.

Posted Date: 1/18/2013 7:05:19 AM | Location : United States







Related Discussions:- Row counterparts of table operators - sql, Assignment Help, Ask Question on Row counterparts of table operators - sql, Get Answer, Expert's Help, Row counterparts of table operators - sql Discussions

Write discussion on Row counterparts of table operators - sql
Your posts are moderated
Related Questions
Other monadic - SQL In 2VL there are just 4 (2 2 ) monadic operators, of which negation is really the only "useful" one. When a third truth value is introduced we have 27 (3 3

Initial thought process: Design a script which was simple and user friendly. Integrate procedures/functions to extract data under the hood. I focused on giving the user the opt

I would like to have a custom MS Access database designed and coded that would help me schedule my customer's orders and that would help me track my employees production output and

Product-specific Packages The Oracle and different Oracle tools are supplied with the product-specific packages which help you to build the PL/SQL-based applications. For illu

Advantages of PL/SQL The PL/SQL is a high-performance transaction processing, completely portable language that offers the following advantages as shown: 1) Support for SQL

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

At times, Brewbean's has changed the id number for existing products. In the past, they have had to add a new product row with the new id to the BB_PRODUCT table, modify all the co

An analyst in the quality assurance office reviews the time lapse between receiving an order and shipping an order. Any orders that have not been shipped within a day of the order

What Is a Record  ? A record is a group of related data items that stored in the fields, each with its own name and datatype. Assume that you have different data about an em

ROWNUM The ROWNUM returns a number representing the order in which a row was selected from the table. The first row selected has a ROWNUM of 1; the second row has a ROWNUM of