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
Anatomy of a Table: Figure shows the terminology used in SQL to refer to parts of the structure of a table. As you can see, SQL has no official terms for its counterpa

Closing a Cursor Variable The CLOSE statement disables the cursor variable. After that, the related result set is undefined. The syntax for the same is as shown below: CLOS

Ending Transactions A good quality programming practice is to commit or roll back every transaction explicitly. Whether you rollback or issue the commit in your PL/SQL program

Example of ADD CONSTRAINT in SQL Example: Alternative formulation for MAX_ENROLMENTS ALTER TABLE IS_ENROLLED_ON ADD CONSTRAINT MAX_ENROLMENTS CHECK ((SELECT COUNT (*)

DELETE Command - SQL Loosely speaking, DELETE removes some existing rows from its target table. Suppose the university decides that course C3 is to be withdrawn. Example shows

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

Cursor Variables:   To execute the multi-row query, the Oracle opens an unnamed work region that stores the processing information. You can use an explicit cursor that names

#quesWrite a cursor to open an employee database and fetch the employee record whose age is greater than 45.tion..

Processing Transactions This part describes how to do the transaction processing. You learn the fundamental techniques that safeguard the consistency of your database, involvin

Object Types An object type is a user-defined complex datatype which encapsulates the data structure along with the functions and procedures required to manipulate the data. Th