I wanted to evaluate MariaDB's virtual column and see if it could
store business rules next to table data. With
virtual columns this could be done and if you specify as
'virtual', would not even take up space on disk.
The imaginary use case is that there is a sales team in a company and you would like to evaluate if a particular salesperson is eligible for a bonus. In order to get a bonus, you need to sell above the average for the day and be in the top 5 amongst the salespeople.
So here is what I did: