You appear to have these relationships:
So when i try to create new records in transaction table, i can select which account and which sub accounts that transaction is related
That would suggest that you really need these relationships:
Accounts::pk_account_id = Subaccounts::fk_account_id
Subacounts::pk_Subaccount_id = Transactions::fk_SubAccount_id
There are two options for getting a specified total of all transactions for a given subaccount record (601, 602, 603)
From a list view layout based on SubAccounts, you can use either a summary field defined in transactions or a calculation field defined in subaccounts as: Sum ( transactions::Amount ) to get the total of all transaction amounts for that sub account.
From a list view layout based on Transactions, you can define a summary field that computes the "total of" the amount field. You can place this field in a sub summary part "when sorted by fk_subAccount_id" to get a total for each sub account. You can also set up a summary field to get a running total that starts over with each sub account.