491 views
0 votes
0 votes

what will be the output of the query ?

SELECT A, Avg(B)

FROM R 

GROUP BY A:

Table R

A B C
a1 b1 80
NULL b2 90
a3 b5 40
NULL b2 30
a1 b1 90
a3 b6 NULL

 

2 Answers

0 votes
0 votes
Avg(B) A(group by A)
(b1+b1)/2 a1
(b5+b6)/2 a3
b2 Null
b2 Null

 

Null is non  zero and two null value may not same 
Null is a sequence of ASCII character assigned by DBMS in such way two nulls may not same  --->(Code Rule)

 

edited by

Related questions

0 votes
0 votes
0 answers
1
kd..... asked Apr 30, 2019
701 views
Here why does the 5th query select * from employees natural join works_on where PID = 'X' AND PID='Y'; is not workingThe queries are The output are
0 votes
0 votes
1 answer
2
Satbir asked Dec 4, 2018
304 views
please give an example to differentiate between self join , natural join and join operation.
0 votes
0 votes
2 answers
4
Mk Utkarsh asked Dec 2, 2018
1,050 views
Select Rating From professor P2 Where 5>=(Select count (*) From professor P3 Where P2.Rating <= P3.Rating);Can someone please explain the query?