Showing entries 1 to 2
Displaying posts with tag: business rules (reset)
MariaDB's Virtual Columns

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:

MariaDB [test]> create table salespeople (id int unsigned not null auto_increment primary key, salesperson_id int unsigned not null , `date` datetime not null default 0, sold decimal(15,2) not null default 0, day_avg decimal(15,2) not null default 0,  above_avg char(1) as …

[Read more]
Computed/Virtual Columns

Some days a go I discovered a wonderful thing called computer columns when I stumbling on MS SQL server. There is a free MS SQL server 2005 express that you can download off a Microsoft site. Yes, I know, FREE and from microsoft.

(P.S. for those who didn’t read, Bill Gates is now the 3rd richest man in the world after 13 years of being number one.)

I also read a really good article that explains indexes on computed columns. The benefits of speeding up searches with them and adding business rules. Obviously, the business rules were particularly interesting to me.

Jay Pipes had a similar webinar

[Read more]
Showing entries 1 to 2