Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 select query

Author  Topic 

atulsql
Starting Member

2 Posts

Posted - 2012-09-22 : 01:55:37
there is a problem scenario..in which there are two tables.

1:studentinfo(grno,totalfees,paid,balance,installments).(no primary key)

eg: 1 50000 20000 30000 1
2 20000 15000 5000 1
1 50000 30000 0 2
3 10000 8000 2000 1

in the above example it is shown that grno=1 hav submit his
fee(50000) in two installments.

second table....
2:studentpersonalinfo(grno,category)(no primary key)

eg: 1 OC
2 OBC
3 OC


Objective:

1:we have to write a query in sql to find the output in following
way for the above example.
(for example for category OC)

category total student total fees paid balance
2 60000 2000


2:we have to calculate alsooutput in following way.

grno totalpaid balance totalinstallments

1 50000 0 2
2 15000 5000 1
3 10000 2000 1

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-09-22 : 12:49:24
show us what you've done so far. Unless you attempt it yourself we're not going to help you with your assignment questions

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -