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
Processing Transactions This part describes how to do the transaction processing. You learn the fundamental techniques that safeguard the consistency of your database, involvin

Expressions   An expression is a randomly complex combination of the constants, variables, literals, operators, & function calls. The simplest expression is the single variabl

SQL Functions The PL/SQL uses all the SQL functions involving the following aggregate functions that summarize the whole columns of the Oracle data: GROUPING, AVG, COUNT, STDDE

Use External Routines The PL/SQL is particular for the SQL transaction processing. Therefore, several tasks are more quickly completed in a lower-level language like C that is

Define basic operators of relational algebra with an example each

EXIT Statement   You can use the EXIT statement to exit a loop. The EXIT statement has 2 forms: the conditional EXIT WHEN and the unconditional EXIT. With the either form, you

Built-In Functions The PL/SQL provides a lot of powerful functions to help you to manipulate the data. These built-in functions fall into the categories as shown below: error r

Declaring Objects: You can use the object types wherever built-in types like CHAR or NUMBER can be used. In the block below, you can declare object r of type Rational. Then, yo

which operation is used if we are interested in only certain columns of a table?

Joining in SQL Joining IS_CALLED and IS_ENROLLED_ON in SQL SELECT * FROM IS_CALLED NATURAL JOIN IS_ENROLLED_ON This is an example of an SQL table expression. I have been