Max and min operator in sql, PL-SQL Programming

MAX and MIN operator in SQL

Example:

(SELECT MAX (Mark) FROM EXAM_MARK WHERE StudentId = 'S1')

(SELECT MIN (Mark) FROM EXAM_MARK WHERE StudentId = 'S1')

Example needs no further explanation. SQL also has AVG for averages. Its counterparts aggregate AND and OR are spelled, respectively, EVERY and either SOME or ANY, but all of these must be used with care because of the consequences of the aforementioned general rule concerning the treatment of NULL. For example, if the condition c evaluates to UNKNOWN for every row of table t, or t is empty, then (SELECT EVERY(c) FROM t) evaluates to UNKNOWN, whereas when t is empty it really ought to evaluate to TRUE.

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







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

Write discussion on Max and min operator in sql
Your posts are moderated
Related Questions
Using EXTEND To enlarge the size of a collection, use EXTEND. This process has 3 forms. The EXTEND appends one null element to a collection. And the EXTEND(n) appends n null e

ROWID The ROWID returns the rowid (binary address) of a row in the database table. You can use the variables of the type UROWID to store rowids in a readable format. In the il

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

Inner Join We have learned how to retrieve data from one table by using SELECT statement. But, as we have learned, normalized relational databases mean the data is spread betw

Procedures   The procedure is a subprogram which performs a specific action. You write procedures using the syntax as shown below: PROCEDURE name [(parameter[, parameter, .

Manipulating Objects: You can use an object type in the CREATE TABLE statement to indicate the datatype of a column. When the table is created once, you can use the SQL statem

SQL outer join SELECT * FROM IS_CALLED NATURAL LEFT JOIN IS_ENROLLED_ON Note that adding LEFT to an invocation of CROSS JOIN has no effect unless the right-hand operand

Overriding Default Locking By default, the Oracle locks the data structures for you automatically. Though, you can request exact data locks on rows or tables when it is to you

Package STANDARD package named STANDARD defines the PL/SQL atmosphere. The package specification globally declares the exceptions, types, and subprograms that are available a

Processing Transactions This part describes how to do the transaction processing. You learn the fundamental techniques that safeguard the consistency of your database, involvin