Let's say this is my database with 3 tables.
token - id, Name, Price,.
users - Id, AcctNo, Balance, Username, Fullname, Email, Password, Role.
usertoken - id, AcctNo, TokenName, Amount, Quantity, Totalbuy, Interest.
The table named 'token' is where products are stored and registered users can buy. On the html form I have a drop-down option, a text field labelled 'Price', 'Quantity' and 'Total' with the button 'BUY', the drop-down option is where the token's names are fetched from the database, when a user selects a particular token he wants to buy and the price will display in the Price text field then the user will input the quantity in the Quantity text field and it will auto calculate in the Total text field, now, after the user clicks on buy button the system will calculate a 3 percent interest as a discount from the Totalbuy for the user this value will be stored in the 'Interest' column on the usertoken table.
When user submits form, system will check if user has enough fund in his 'Balance' else displays error of 'not enough fund'