# About Rule-Based Systems: Single Database Queries for Decision Making
## 2 Background  
We are thinking about rule-based systems through the prism of the rough set theory-see [PERSON] [4]. Where we start from the definition of the decision system as a triple \((U,A,d)\), where \(U\) is a universe of objects, \(A\) is a set of conditional attributes, \(d\) is a decision attribute fulfilling a condition (\(d\
ot\in A\)). To clarify this definition, see Table 1 for a sample decision system. In our example, the universe of objects \(U=\{\mathit{person}_{1},\mathit{person}_{2},\mathit{person}_{3}\}\), the set of conditional attributes \(A\) is \(\{\mathit{color},\mathit{body\_temperature}\}\) and the decision attribute \(d\in D=\{\mathit{Yes},\mathit{No}\}\).  
For the formal representation of decision rules, we need to introduce a descriptor notation \((a_{i}=\mathit{value})\). For example \((a_{1}=1)\) is a general reference to all objects of the decision system that have the value 1 on the conditional attribute \(a_{1}\). Exemplary IF THEN rules can be defined as:  
\[IF(a_{1}=1)\ THEN\ (d=YES)\]  
\[IF(\mathit{color}=\mathit{red})\ OR\ (\mathit{temperature}>100)\ THEN\ (d=\mathit{potential\_ danger})\]  
\[IF(\mathit{time}=\mathit{free})\ AND\ (\mathit{attitude}=\mathit{good})\ THEN\ (d=\mathit{go\_to\_the\_ park})\]  
There are several basic types of rule generation algorithms, for instance an exhaustive set of rules [5] is dedicated to problems, where the decision must be made with the greatest possible raw knowledge available-this is a Brute Force technique. The sequential covering type [6] gives brief solutions to all problems by using short rules, which fully cover the universe of objects. The last important family of techniques worth mentioning is based on Modules of data (non conflicting data blocks), an example method is the LEM2 algorithm [7], which allows to create long characteristic, most trusted patterns from data. Such methods are used for medical data. Most other methods use elements of these basic three approaches. If someone would like to use decision rules in uncertain conditions, the indiscernibility degree of descriptors should be defined. It is not our goal to review all available variants of rule generation algorithms, but to present system operation on a representative set of rules.  
Let us move on to a discussion of selected work on the application of decision-making rules in databases. The seemingly simple subject of using rule-based systems in databases is a specific niche, in which there is not much research or many technical reports. We will mention the following examples of work on this subject. In [8] authors use a database (ORACLE) to implement the functionality of an expert system shell by a simple rule language which is automatically translated into SQL. In [9] we have a presentation on how to maintain rule-based knowledge in temporal databases. In the paper [10] we have implementation of a rule based system at MTBC, for applying billing compliance rules on medical claims. In article [11] the author considers the problem of searching for rules in relational databases for potential use in data mining. Then in the article [12] we can see discussion of generation of Apriori-Based Rules in SQL. Finally, at work [13] authors apply an active database system in an academic information system, to plan academic business rules.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline  & \(\mathit{Color}\) & \(\mathit{body\_temperature}\) & \(\mathit{d}\) \\ \hline \(\mathit{person}_{1}\) & red & 40. & _Yes_ \\ \(\mathit{person}_{2}\) & green & 36.6 & _No_ \\ \(\mathit{person}_{3}\) & blue & 36.5 & _No_ \\ \hline \hline \end{tabular}
\end{table}
Table 1: The exemplary decision system \((U,A,d)\).