Which one of the following pairs of aggregate functions do
you use with character fields?
1. COUNT(field) and MAX(field)
2. AVG(field) and COUNT(field)
3. MIN(field) and SUM(field)
4. AVG(field) and MAX(field)
5. COUNT(field) and SUM(field)
Answer Posted / guru manohar
You can use COUNT(field),MIN(field),MAX(field) functions for
character fields.
For example there is a table called DEPARTMENTS contains the
data as shown below:
DEPARTMENT_ID DEPARTMENT_NAME
---------------------------------
10 Administrator
20 Marketing
50 Shipping
60 IT
1)SELECT COUNT(department_name)
From DEPARTMENTS;
Output: 4
Note: Bcoz there are 4 rows with DEPARTMENT_NAME
2)SELECT MAX(department_name)
From DEPARTMENTS;
Output: Shipping
Note: Bcoz Shipping comes last in sorting by Ascending
3)SELECT MIN(department_name)
From DEPARTMENTS;
Output: Administrator
Note: Bcoz Administrator comes first in sorting by Ascending
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
What is sql scripting?
What is having clause in sql?
What is graph sql?
What does stand for in sql?
Why do we use sql constraints?
What is rtm in testing?
Can we have two clustered index on a table?
How many types of cursors are available in pl/sql?
How does postgresql compare to "nosql"?
What is difference between cursor and trigger?
What are the different types of dbmss?
What is mutating trigger?
what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba
how to fetch alternate records from a table? : Sql dba
What is the difference between count 1 and count (*) in a sql query?