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
Projection and Existential Quantification - SQL Intuitively it might seem that projection in SQL is simply a matter of specifying the required columns in the SELECT clause, a

Restriction in SQL Syntax: SELECT DISTINCT StudentId FROM IS_CALLED WHERE Name = 'Boris' The WHERE clause operates on the result of the FROM clause in analogo

Use the RETURNING Clause Frequently, the application requires information about the row affected by a SQL operation, for illustration, to produce a report or take a subsequent

Special cases of projection This section describes the identity projection, r {ALL BUT}, and the projection on no attributes, r { }, which yields TABLE_DUM when r is empty, ot

Positional and Named Notation You can write the actual parameters when calling a subprogram, using either positional or named notation. That is, you can point to the relationsh

Using LOCK TABLE You use the LOCK TABLE statement to lock the whole database tables in the specified lock mode so that you can share or deny the access to them. For illustrati

Logical Connectives - SQL SQL's extended truth tables in which the symbol, for unknown, appears along with the usual T and F. Negation (NOT, ¬) Conjunction (

Disjunction (OR, ∨) Again we have nine rows instead of just four and again, when unknown is not involved, the rows are as for 2VL. Also, when anything is paired with true, t

Truth Tables: However in propositional logic - here we are restricted to expressing sentences and where the propositions are true or false - so we can check where a particular

Scope Rules You cannot declare an exception twice in the similar block. Though, you can, declare the similar exception in 2 different blocks. The Exceptions declared in a bloc