I create feetbl having following fields:
f_id bigint
f_receipt char
f_totalfee bigint
f_paidfee bigint
f_remainingfee bigint
f_paid_date datetime
f_due_date datetime
when I insert records in feetbl by following values
1 rec1 40000 20000 20000 20/07/2012 30/09/2012
Here I added one record but when candidate approach to me for giving all remaining fees with new receipt number then How can I update this remaining fees by new receipt number??
Give me solution of this by considering multiple records.
Thanks in advance.


Sukesh MarlaRank #461 · 5.4K reputationPosted Aug 19, 2012, 5:37 AM EDT
Fees_Master inner join Fee_detail
On Fees_Master. FeeId = Fee_detail.FeeId
group by StudentId , TotalFee
Please mark this as correct answer if it helepd
Sukesh MarlaRank #461 · 5.4K reputationPosted Aug 18, 2012, 8:48 AM EDT
Table Fees_Master
Fields
FeeId----------->PK
StudentId
TotalFee
Fee_detail
FeeDetailId-------->Pk
FeeId-------------->FK
PaidFee
PaidDAte
DueDate
For every student say with total fee of 50000, there will be multiple entries for everry fee paid
Dont use separate column for Remaining fee
Always try to create normalized database...Try to avoid redundant data, By removing repeating rows and avoiding unecessary columns
http://www.sukesh-marla.com/2010/12/normalization.html
Refer above link for normalization..
Please check this answer as correct answer
kishor choure83 reputationPosted Aug 19, 2012, 3:53 AM EDT
Sukesh MarlaRank #461 · 5.4K reputationPosted Aug 19, 2012, 4:14 AM EDT
Please mark this as correct answer if it helepd
kishor choure83 reputationPosted Aug 19, 2012, 5:34 AM EDT
kishor choure83 reputationPosted Aug 19, 2012, 6:46 AM EDT
Sukesh MarlaRank #461 · 5.4K reputationPosted Aug 19, 2012, 6:48 AM EDT
let me knw if anythng required.