physics chemistry maths science forums
become expert I help I sign up I login
refer a friend - earn nickels!!   
 advanced
 
Home
Ask & Discuss Questions
Study Material
Experts Zone
Hang Out!

Ask & Discuss Questions with Community & Experts

Moderation Team
 90 chars left    advanced
Ask iit jee aieee pet cbse icse state board community Community Discussion Question: tell the difference between them
Forum Index -> Computer Science like the article? email it to a friend.  
Author Message
v_gurucharan (278)

Blazing goIITian

Olaaa!! Perrrfect answer. 46  [70 rates]

v_gurucharan's Avatar

total posts: 459    
offline Offline
1  SELECT AVG(FEES) FROM STUDENT WHERE SUM(FEES)>1500;

AND


2 SELECT AVG(FEES) FROM STUDENT GROUP BY GRADE HAVING SUM(FEES)>1500;
    
umang (229)

Blazing goIITian

Olaaa!! Perrrfect answer. 35  [62 rates]

umang's Avatar

total posts: 873    
offline Offline
hey !
correct me if i am wrong, but the 2nd statement is same as the 1st
 
SELECT AVG(FEES) FROM STUDENT GROUP BY GRADE HAVING SUM(FEES)>1500;
 
what does GROUP BY has to do here ???
we r selecting average of fees.
the output will be a number.
so, both r same.
 
i hope u got it !
rate me if found useful !!!


Umang
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
jv604 (0)

New kid on the Block

Olaaa!! Perrrfect answer. 0  [0 rates]

jv604's Avatar

total posts: 22    
offline Offline
the groupby clause combines all records that have identical value in a particular field or a group of fields.
in 1st case only d sum condition will be checked
but in d 2nd the condition for each grade grouped will also be checked.
also in 2nd case the having clause is used since having clause works only wid groups.
hope im rite!!
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
RyuAmakusa (451)

Blazing goIITian

Olaaa!! Perrrfect answer. 75  [113 rates]

RyuAmakusa's Avatar

total posts: 357    
offline Offline
ofcoooourse they are different in the first case all the fees are added and if it is greater than 1500 then the avg of all the fees is printed . in the second case the fees of each grade is added and if the sum is > 1500 then the avg. of feesof that grade is printed 
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
 
Forum Index -> Computer Science
Go to:   

Top Offers for goIITians
Correspondence Courses
Brilliant Tutorials
Narayana Institute
Aakash Institute
Classroom/Crash Courses
Narayana - Kota , Delhi , Others
Brilliant Tutorials - Class , Crash
Aakash Institute - Medical , Engg
Online Test Series
Brilliant Tutorials
Narayana Institute
Aakash Institute
Mahesh Tutorials
AMITY      Sri Chaitanya