Grouping and ungrouping in sql, PL-SQL Programming

Grouping and Ungrouping in SQL

Example specifying EXAM_MARK in place of COURSE in the main FROM clause.

Example: Obtaining C_ER2 from EXAM_MARK

SELECT CourseId,

CAST (

TABLE (SELECT DISTINCT StudentId, Mark

FROM EXAM_MARK AS EM2

WHERE EM1.CourseId = EM2.CourseId)

AS ROW ( StudentId SID, Mark INTEGER ) MULTISET )

AS ExamResult

FROM EXAM_MARK AS EM

Figure shows the result, named C_ER2 for convenience. It differs from the C_ER of Figure 5.3 only in the absence of a row for course C4, whose exam nobody sat.

140_Grouping and Ungrouping in SQL.png

Figure: Intermediate result C_ER2

Posted Date: 1/18/2013 6:42:15 AM | Location : United States







Related Discussions:- Grouping and ungrouping in sql, Assignment Help, Ask Question on Grouping and ungrouping in sql, Get Answer, Expert's Help, Grouping and ungrouping in sql Discussions

Write discussion on Grouping and ungrouping in sql
Your posts are moderated
Related Questions
Fetching with a Cursor The FETCH statements retrieve the rows in the result set one at a time. After each and every fetch, the cursor advance to the next row in the result set

Example of Cast Operator So long as CAST is used as shown, we could obtain the total marks for each exam in similar fashion, using SUM (Mark) AS TotalMarks. However, this giv

How Exceptions Propagate ? Whenever an exception is raised, and if the PL/SQL cannot find a handler for it in the present subprogram or block, the exception propagates. That is

Semidifference via EXCEPT and JOIN - SQL SELECT * FROM (SELECT StudentId FROM IS_CALLED WHERE Name = 'Devinder' EXCEPT DISTINCT CORRESPONDING SELECT StudentId

Declaring Exceptions The Exceptions can be declared only in the declarative part of the PL/SQL subprogram, block, or package. By introducing its name, you can declare an excep

Name Resolution   During the compilation, the PL/SQL compiler relates identifiers like the name of a variable with an address or memory location, actual value, or datatype. Th

What Is a Package? The package is a schema object that group logically related PL/SQL items, types, and subprograms. The Packages usually have 2 parts, a specification & a bo

At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean’s wants to create a trigger that automatically updates the stock level of all pr

THEO R Y OF ETERNITY OF LIFE (PRAYER - 1880) - The theory of eternity of life, also called the steady-state theory , states that life has ever been in existence as at presen

Project Description: This is stage 1 of a larger conversion project. We are converting a traditional Server/Client application written in Access 2007 into a web interface with S