Count operator in sql, PL-SQL Programming

Count Operator in SQL

Example: Counting the students who have scored more than 50 in some exam

(SELECT COUNT (*) FROM

(SELECT DISTINCT StudentId

FROM EXAM_MARK

WHERE Mark > 50) AS T)

Example is a direct translation of the corresponding example in the theory book but it can be abbreviated-and is much more likely to be written-as

(SELECT COUNT (DISTINCT StudentId )

FROM EXAM_MARK

WHERE Mark > 50)

Posted Date: 1/18/2013 6:04:40 AM | Location : United States







Related Discussions:- Count operator in sql, Assignment Help, Ask Question on Count operator in sql, Get Answer, Expert's Help, Count operator in sql Discussions

Write discussion on Count operator in sql
Your posts are moderated
Related Questions
Entering and Exiting If you enter the executable part of an autonomous routine, the major transaction suspends. When you exit the routine, the major transaction resumes. To ex

Example of Check Constraints Example: Workaround for when subqueries not permitted in CHECK constraints CREATE FUNCTION NO_MORE_THAN_20000_ENROLMENTS ( ) RETURNS BOOLEAN

Remote Operations: As the illustration shows below, the PL/SQL subprograms can execute the dynamic SQL statements which refer to the objects on a remote database: PROCEDURE

GOTO Statement The GOTO statement branches to a label unconditionally. The label must be exclusive within its scope and should precede an executable statement or a PL/SQL block.

Using Host Arrays The Client-side programs can use anonymous PL/SQL blocks to bulk-bind input and output host arrays. However, this is the well-organized way to pass the colle

SQL Operators The PL/SQL uses all the SQL set, comparison, and row operators in the SQL statements. This part briefly describes some of these operators.  1. Comparison Opera

Cursor Variables Similar to a cursor, cursor variable points to the current row in the result set of a multi-row query. But, dissimilar a cursor, a cursor variable can be opene

Using Aliases The Select-list items fetched from a cursor related with the %ROWTYPE should have simple names or, if they are expressions, should have aliases. In the example bel

If two relations R and S are joined, then the non matching tuples of both R and S are ignored in __________________.

Advantages of PL/SQL The PL/SQL is a high-performance transaction processing, completely portable language that offers the following advantages as shown: 1) Support for SQL