Breaking News

Script for database (Select one table in database use function avg, min, max, sum, count)

Example of database table :
The table name is University


CodeNamesValue
A01Leo90
A02Aries100
A03Taurus95

  •  Select the average value
SELECT avg(Field_name)
FROM Table_name
Example
SELECT avg(Value)
FROM University
Display  : 95

  • Select the minimal value
SELECT min(Field_name)
FROM Table_name
Example
SELECT min(Value)
FROM University
Display  : 90

  • Select the maximal value
SELECT avg(Field_name)
FROM Table_name
Example
SELECT max(Value)
FROM University
Display  : 100

  • Select the sum value
SELECT sum(Field_name)
FROM Table_name
Example
SELECT sum(Value)
FROM University
Display  : 285

  • Select the count data
SELECT count(*)
FROM Table_name
Example
SELECT count(*)
FROM University
Display  : 3

No comments