Example of table literal - sql, PL-SQL Programming

Example of Table Literal - SQL

Example: A Table Literal (correct version)

VALUES

('S1', 'C1', 'Anne'),

('S1', 'C2', 'Anne'),

('S2', 'C1', 'Boris'),

('S3', 'C3', 'Cindy'),

('S4', 'C1', 'Devinder')

Now, the question arises, what is the (table) type of the table shown in Example? For that matter, what is the (row) type of ('S1', 'C1', and 'Anne')? In particular, what are the field names of those three fields, which would become column names for the containing table? The short answer is that they are determined by the context in which the expression appears. Because the components are distinguished anyway by ordinal position, the field names sometimes serve little or no purpose. In fact several fields are permitted to acquire the same name. Also, sometimes the context does not provide any names at all, in which case, according to the standard, each field is assigned a unique but unpredictable name.

Examples arising as we go along will make this issue a little clearer. I shall use the term anonymous column to refer to a column whose name is unpredictable and therefore effectively undefined. Note carefully that if the word ROW is omitted and the row consists of a single field, then the parentheses can also be omitted. Thus, VALUES 'S1' denotes a table consisting of a single column and a single row, the SQL counterpart of RELATION { TUPLE { StudentId 'S1' } } (though the SQL counterpart has nothing corresponding to the attribute name).

Posted Date: 1/18/2013 2:14:25 AM | Location : United States







Related Discussions:- Example of table literal - sql, Assignment Help, Ask Question on Example of table literal - sql, Get Answer, Expert's Help, Example of table literal - sql Discussions

Write discussion on Example of table literal - sql
Your posts are moderated
Related Questions
LIKE Operator You use the LIKE operator to compare the character value to a pattern. The Case is significant. LIKE returns the Boolean value TRUE when the character patterns mat

Example of Shorthand for a row constraint Example: Shorthand for a row constraint ALTER TABLE EXAM_MARK ADD CONSTRAINT Mark_in_range CHECK (Mark BETWEEN 0 AND 100);

Exception handling In the PL/SQL, a warning or error condition is known as an exception. The Exceptions can be internally defined (by the run-time system) or user defined. The

MECHANISTI S THEORY-HAECKEL (1866) - Haeckel stating that after each catalysm, some new organism suddenly forms as a chance event in one stride from inanimate matter and sub

BETWEEN Operator The operator BETWEEN, tests whether the value lies in a specified series. That means "greater than or equivalent to low value and less than or equivalent to hig

THEO R Y OF CATASTROPHISM OR CATALYSM (CUVIER 1769-1832) - The world has passed thorugh several stages and at the end of each stage there was a catastrophe killing all the

Second Step at defining type SID in SQL CREATE TYPE SID AS VARCHAR(5) ; Explanation: TYPE SID announces that a type named SID is being defined to the system.

BEGIN Parameter Description in pl sql: BEGIN: This keyword signals the beginning of the executable section of a PL/SQL block, that contains executable statements. The execut

OUT Mode An OUT parameter returns values to the caller of a subprogram. Within the subprogram, an OUT parameter act like a variable. That means that you can use an OUT formal

Positional and Named Notation You can write the actual parameters when calling a subprogram, using either positional or named notation. That is, you can point to the relationsh