I'm designing an application that retrieves data from a (currently simple) .csv file and stores it's raw content. The application is intended to offer the user the possibility to define filters on the data and thus define sub-groups of data based on these filters. By filter, I mean a set of conditions that could be applied on the raw data. So I started thinking about the best way to model and store any filter in order to display those filters in the user interface once the application has started.
My first approach was to define what a condition really is. I thought of it as a set of 2 operands and an operator which would give something like "Operand_A Operator Operand_B" once injected in dynamic SQL.
Since an operand can either be a constant, a variable (property) or another condition, I set up this model :
I could create a filter class pointing to a set of conditions, but since a condition can contain several conditions, I thought it would be pointless...
So my question is : would you change anything to this model ? Have I missed anything ?
I know inheritance ins't really fitted for relational databases... but I'll deal with it later. I also read some people suggesting that it would be simpler to store the filter query itself, but this is not what I'm looking for.
I'm using SQL Server (LTS version).