Jump to content

Sql Interview Question


Recommended Posts

Posted

This question has been asked in valuelabs company,hyd

 

emp table(empid,empname,mgrid and sal)

 

empid  empname  mgrid     sal

1              scott        2        10000

2               nik          2        5000

3               tom         2         15000

4               sam         4         10000

5               sid           4          5000

6               fin           4          25000

 

 

i want to display like this

 

mgrid   sum(sal)

2            30000

4             40000

Posted

i think mgrname (Instead of mngrid) emo mari intha easy kademo. sorry if i am wrong

Posted

its a group by thing..

Posted

:o select mgrid, sum(sal) from emp group by mgrid

 u r rite bro

 

 

 select mgrid, sum(sal) as sal  from emp group by mgrid 

 

 

i have tested too..

Posted

 u r rite bro

 select mgrid, sum(sal) as sal  from emp group by mgrid 

i have tested too..

test aa..why test bro..chusi chepochu adhi

Posted

indhuke sql chaala kastam antaaru .. better go for easy techinologies like linux etc ..

Posted

indhuke sql chaala kastam antaaru .. better go for easy techinologies like linux etc ..

LOL
Posted

i think mgrname (Instead of mngrid) emo mari intha easy kademo. sorry if i am wrong


Self join cheyali.. Standard interview question adhi kuda
Posted

indhuke sql chaala kastam antaaru .. better go for easy techinologies like linux etc ..

hmm...its not tht prblematic bro

×
×
  • Create New...