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
Updating Variables For assignment, SQL uses the key word SET, as in SET X = X + 1 (read as "set X equal to X+1") rather than X: = X + 1 as found in many computer languages.

The accuracy of product table data is critical and the Brwebean's. owner wants to have an audit file that contains information regarding all DML activity on the BB_PRODUCT table. T

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

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

Multiset types - SQL An SQL multiset is what in mathematics is also known as a bag-something like a set except that the same element can appear more than once. The body of an

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 WHE

SQL Database: So, an SQL database is one whose symbols are organized into a collection of tables. Now, shows an SQL table as the current value of an SQL variable, ENROLMENT, b

Relational Algebra - SQL It describes some operators, that together constitute an algebra that is not only relationally complete but also irreducibly so (very nearly- apart f

Database Values You can use the SELECT statement to have the Oracle assign values to a variable. For Each and every item in the select list, there must be a matching, type-compa

Write a stored procedure that accepts the post code in which the customer resides as the input parameter. The procedure should then use an explicit cursor to display comprehensive