Contents
How does the account table show the current balance?
The Account table has the current balance, as of the last transaction that has “posted”. A modern “online” system will post transactions immediately, but older systems would capture transactions online, but run “batch” to post the transactions later.
How are payment methods stored in a table?
In the past I stored payment methods in a table, but after some thinking I conclude that an IPaymentMethod interface with derived classes (eg. class CreditCard : IPaymentMethod ), would be easier to extend and maintain. 1. Partial PaymentMethods Table Name (eg.
What to do with three different payment methods?
Of course if you have three different methods, you’ll have to check first to see which kind of payment it is first and then use the appropriate SELECT statement: Once you determine with method, you can use pre-made SELECT statements that call from your different payment method tables. Hope this helps! I think the wrong answer is to have 3 tables.
How should I write a simple bank schema?
I am writing the schema for a simple bank database. Here are the basic specifications: The database will store transactions against a user and currency. Every user has one balance per currency, so each balance is simply the sum of all transactions against a given user and currency. A balance cannot be negative.
What does PK mean on the transaction table?
A modern “online” system will post transactions immediately, but older systems would capture transactions online, but run “batch” to post the transactions later. PK on the transaction table would normally be (AccountId,TransactionId), which balances the cost of insert and the cost of pulling the transactions for a single account.
How to create trigger function on transaction table?
Create a trigger function on the transaction table to be called only after update or insert. Create a column having name in the master table of account naming Opening Balance. save your opening balance in array in the opening balance column in master table.
Is there an opening balance on the movement table?
The movement table has an ‘opening balance’ transaction for each and every account. You’ll need this in a few year’s time when you need to move old movements out of the active movement table to a history table. There is a trigger on the movement table which updates the account balances for the credited and debited accounts.