Creato da pastuweb.com
Share My Page
My Social Accounts
Account FaceBook Account LinkedIn Account Twitter Account Google Plus Account Git Hub

Example 1:

SELECT [DISTINCT] list of attributes to display
FROM listing tables to use
[WHERE conditions tuple]
[GROUP BY list grouping attributes]
[ORDER BY sort attributes list]


Example 2:

SELECT [DISTINCT] list of attributes to display
FROM listing tables to use
[WHERE conditions tuple]
[GROUP BY list grouping attributes]
[HAVING conditions on aggregate]
[ORDER BY sort attributes list]


Nested statements:
In SQL you can write nested queries with operators:

- IN
- NOT IN
- EXISTS
- NOT EXISTS

You can create constructors tuple, correlations betweenqueries, operations division and table functions.

=

You can use '=' only if it is known a priori that the result of the nested SELECT is always a single value.

EXISTS

Containing EXISTS predicate is:
- True if the inner query returns at least one tuple
- False if the inner query returns the empty set

In the inner EXISTS in the SELECT clause is mandatory,but irrelevant, because the attributes are not displayed.

The condition of correlation links the internal running of question the value of attributes of the tuple in the queryexternal current.

Correlation

- Is indicated in the WHERE clause of question thatrequires nested;
- Is a predicate that binds attributes of tables in the FROMinterrogation nifìdificata with attributes of tables in the FROM clause of queries outer

Can not be expressed in terms of correlation queries at the same level of nesting or containing references to attributes of a nested table in the FROM clause of a query.

Table Function

defines a temporary table that can be used for furthercalculations.
The table has the structure function of a SELECT statement, is defined in a FROM clause and can be referenced like a normal table.
The table function allows to calculate multiple levels ofaggregation and equivalently formulate queries thatrequire correlation.

Average (1 Vote)
The average rating is 5.0 stars out of 5.