The present invention provides an efficient method and system of data mining
using SQL queries for model building and scoring. The invention provides a database
management system having a database containing data, a database engine operatively
connected to process the data, a SQL server operatively connected to the database
and a data mining tool, whereby the data mining tool is based on a Nave Bayes
model. The SQL server uses the data and the Nave Bayes model to develop the
data mining tool. The data mining tool is located is located in the database management
system. The data mining tool has a model building system based on at least one
SQL query and training data, and a scoring system based on SQL queries.