Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Example of Using Aggregation on Nested Tables
Example: How many students sat each exam
WITH C_ER AS (SELECT CourseId, CAST (TABLE (SELECT DISTINCT StudentId, Mark FROM EXAM_MARK AS EM WHERE EM.CourseId = C.CourseId) AS ROW ( StudentId SID, Mark INTEGER ) MULTISET) AS ExamResult FROM COURSE AS C) SELECT CourseId, (SELECT COUNT (*) FROM TABLE (ER (ExamResult)) AS t) AS n FROM C_ER
Explanation
CREATE FUNCTION ER
(SM ROW ( StudentId SID, Mark INTEGER ) MULTISET )
RETURNS TABLE (StudentId SID, Mark INTEGER)
RETURN SM;
The type name TABLE ( StudentId SID, Mark INTEGER ) is actually just a synonym for ROW (StudentId SID, Mark INTEGER ) MULTISET). The misleading synonym is available only in a RETURNS clause and not as a parameter type, for example. So ER is actually a no-op, returning its input.
Create a Oracle procedure to produce vertical output format when selecting rows from a database table.
Table Literals - SQL One might expect SQL to support table literals in the manner illustrated in Example 2.2, but in fact that is not a legal SQL expression. Example: Not a
Using %ROWTYPE The %ROWTYPE attribute gives a record type which represents a row in a table (or view). The record can store the whole row of data selected from the table or fetc
Deriving Predicates from Predicates in SQL The corresponding section in the theory book describes how predicates can be derived from predicates using (a) the logical connectiv
Loop Labels Like the PL/SQL blocks, loops can also be labeled. The label, an undeclared identifier enclosed by double angle brackets, should appear at the beginning of the LOOP
Understanding Nested Tables Within the database, the nested tables can be considered as one-column database tables. The Oracle stores the rows of a nested table in no specific o
TYPES OF EVOLUTION - Sequential evolution : Minor changes in the gene pool of a population from one generation to the next, with the resul
Difference between 9i & 10G When Oracle releases any new databases then it are having some discrepancy with them. But 10G is having much difference than oracle 9i has. Oracle
Keyword and Parameter Description select_statement: This is a query which returns a result set of the rows. Its syntax is such that of select_ into_statement without the IN
Need for Dynamic SQL: You need dynamic SQL in the situations as follows: 1) You would like to execute a SQL data definition statement (like CREATE), a data control statemen
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd