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


Please Help Members By Posting Answers For Below Questions

Mention what is the plv (pl/vision) package offers?

643


Difference between table function and pipelined function?

589


Is it possible to create startup or shutdown trigger for on-schema?

588


How do I know if I have sql express or standard?

606


What are inner and outer joins examples of both?

499






How do I run a pl sql procedure in sql developer?

517


What is meant by temporal data?

546


how to delete duplicate rows from a join tables(I have three tables on that join) how do you know which join is need to be used? The select statement I have is: SELECT gc_skill_type.skill_type, gc_area_tec.area, gc_technology.technology, gc_technology.id_technology, gc_area_tec.id_area_tec FROM gc_skill_type, gc_area_tec, gc_technology WHERE gc_area_tec.id_skill_type (+) = gc_skill_type.id_skill_type AND gc_technology.id_area_tec (+) = gc_area_tec.id_area_tec order by gc_skill_type.skill_type asc, gc_area_tec.area asc, gc_technology.technology asc

3246


State some properties of relational databases?

586


what is foreign key? : Sql dba

589


How to use sql*plus built-in timers?

578


what are the different type of sql's statements ? : Sql dba

522


What is replication id?

524


What is the difference between nvl function, ifnull function, and isnull function?

595


What is the file extension for sql database?

519