446 views
0 votes
0 votes

 Answer given is C . But count will ignore the null values therefore using sum and count, result must be greater . Am i right??

1 Answer

Best answer
2 votes
2 votes

This question is ambiguous, it has not been told that COUNT is applied on the attribute "rating" or on the whole table.
if count is applied on the attribute "rating" then sum(rating)/count(rating) will be equal to avg(rating)

and if count is applied on the whole table and then sum(rating) is divided by count(*) then, it will have smaller value than avg(rating) if rating contains few NULL values.

selected by

Related questions

2 votes
2 votes
2 answers
1
set2018 asked Jul 21, 2017
1,506 views
Can we apply min and max (aggregate function in sql) on strings and date datatype ?Query :SELECT max(Name) FROM EMPLOYEEwhat will be the result ?
2 votes
2 votes
1 answer
2
rohan mishra asked Jul 8, 2017
1,394 views
Given a column consisting of 12,19,12,13,14,NULL,NULL. What will be the answer1.If we apply count on the column.2.If we apply sum on the column.3.If we apply avg on the ...
0 votes
0 votes
1 answer
3
shivanisrivarshini asked May 15, 2016
463 views
2 votes
2 votes
4 answers
4
Keith Kr asked Jan 31, 2015
2,298 views
True or False: Relational algebra cannot perform aggregate function