Script for database (Select one table in database use function avg, min, max, sum, count)
Example of database table :
The table name is University
FROM Table_name
Example
SELECT avg(Value)
FROM University
Display : 95
FROM Table_name
Example
SELECT min(Value)
FROM University
Display : 90
FROM Table_name
Example
SELECT max(Value)
FROM University
Display : 100
FROM Table_name
Example
SELECT sum(Value)
FROM University
Display : 285
FROM Table_name
Example
SELECT count(*)
FROM University
Display : 3
The table name is University
Code | Names | Value |
A01 | Leo | 90 |
A02 | Aries | 100 |
A03 | Taurus | 95 |
- Select the average value
FROM Table_name
Example
SELECT avg(Value)
FROM University
Display : 95
- Select the minimal value
FROM Table_name
Example
SELECT min(Value)
FROM University
Display : 90
- Select the maximal value
FROM Table_name
Example
SELECT max(Value)
FROM University
Display : 100
- Select the sum value
FROM Table_name
Example
SELECT sum(Value)
FROM University
Display : 285
- Select the count data
FROM Table_name
Example
SELECT count(*)
FROM University
Display : 3
No comments