Learn How Data Mining Works on SQL Server Basically

Prediction, is this new to you? You won’t believe your predictions from bed to office and back to bed. Imagine having a meeting at 9 am in the office. If you are using public transport, you need to estimate the time you need to depart to get to the meeting office on time.

The time may differ depending on the time, day of the week, and traffic conditions. Before you leave home, you can predict if it will rain today, and you can bring an umbrella or the necessary clothes. If you use a vehicle, the estimated time will be different.

In this case, you don’t have to worry about rain, but you need to consider the level of fuel you need to get to your office. Looking at this simple example, you will understand how important it is to predict and understand that all these predictions are based on experience rather than scientific methods.

The next question is how to apply the mining data solution to the real world. Well, you’ve probably heard famous stories about beer diapers from famous supermarket chains. This is a simple example of applying mining data. So let’s see how we define mining data.

What is Data Mining?

There are several definitions of data mining in relation to business and academia. Data mining is a method of automatically finding large amounts of data to detect behaviors, patterns, and trends, which simple analysis cannot.

In addition to data handling, companies must be able to make proactive knowledge-based decisions to stay ahead of their competitors. Data warehouses have begun a mission to store large amounts of data, including data from the last few years.

Data warehouses are used for explanatory analysis (what happened) and diagnostic analysis (why it happened). But companies need to do more than that. Data mining can be used for predictive analysis (what will happen) and prescriptive analysis (how it can happen).

Data Mining in SQL Server

Many organizations primarily use SQL Server as a storage tool. However, as the needs of many companies grow, people are looking for various functions of SQL Server. People are thinking about storing data with SQL Server. SQL Server offers a data mining platform that can be used to predict data.

There are several tasks used to solve business problems. These tasks are classification, estimation, grouping, prediction, sequencing, and linking. SQL Server Data Mining has nine data mining algorithms with which you can solve the above mentioned business problems. Here is a list of algorithms broken down into several problems.

Classify: Classified according to different properties. Is the buyer a potential buyer based on other data, such as age, gender, marital status, job, educational qualifications, etc.

Estimate: Estimation is performed using parameters. For example, house prices are predicted based on the location of the house, the size of the house, etc.

Cluster: Also known as split. Natural grouping is done according to various properties. Customer segmentation is a classic business example of clustering.

Forecast: Predicting a continuous variable over time. Forecasting sales in the next few years is a very common scenario in the industry.

Associate: Finding common items or groups in a single transaction. The deal can be a supermarket sale, a pharmaceutical product or an online sale.

Sequence: Predict the order of events.


This document uses SQL Server 2017, but you can still follow along if you have SQL Server 2012 or higher.

In this article series, we use a copy of the dataset that you can download and use with the article. You can download the AdventureWorks database and install it on your SQL Server instance.

The sample database contains fact and dimension tables. But here I use the view below.

These views are described in detail in a series of articles.

Data Mining Project

Let us create a data mining project. Open Microsoft Visual Studio and create a Multidimensional project under Analysis Service and select Analysis Services Multidimensional and Data Mining project. Following is the Solution Explorer for the created project.

For data mining, we will be using three nodes, Data Sources, Data Source Views, and Data Mining.

Data Sources

You need to configure your project’s data source as shown below. The data source establishes a link to the AdventureWorksDW2017 sample database.

The next step is providing the credentials Analysis service to connect into the database, after provide all of the database source.

The filter function is used to store the type of input as well as the search function using the Windows scanner only. You can use any of the four methods to source the contacts you want.

This organized the data source into the project and of course can be changed later. You can also create multiple sources for your project.

Data Source View

The next step is to select the data source display. A data source view is a table or subset of a view. You may not need all the tables and views for your project, so you can select the objects you need from the data source view.

There should be one selected data source for a given data source view. You can create multiple data sources, but you can only link data sources to a single data source view. Also, if you have never created a data source before, you can use the View Data Source Wizard to create a data source.

You can select the objects you need from the available objects in the data source view. You can filter objects. When you select a table with foreign key constraints, you can choose Add Linked Table to automatically select the linked table.

As with data sources, you can create different ideas about data sources. However, you can only have one data source to provide the data source view.

Data Mining

You have now completed the basic setup to start your data mining project. Next is the creation of a data mining project. As with other configurations, the creation of the data processing structure is done with the help of a wizard.

Here is a wizard to create a data mining model.

Mining Model Views

After creating the model, the next step is to visualize the model. There are 5 tabs to display these models. There is a mining structure, a mining model, an overview of the mining model, a mining accuracy table, and a mining model prediction.

Most tabs refer to a pre-selected data mining algorithm. Therefore, this discussion has been saved for new articles. The Mining Model tab is common to all other mining algorithms.

There may be several mining models on this tab.

As you know, predictions can be wrong. However, you need to know the level of accuracy of the data mining models we provide. The accuracy table gives you more options for measuring the accuracy of the model you’ve built, which is discussed in a separate article.

We hope this article has helped you gain a basic understanding of data mining. If you’re ready to learn data mining with SKL Server, set up your environment, and join the journey of doing this, take a look at the Microsoft Naive Baies algorithm in the next article on Alfin Tech Computer.

Leave a Reply

Your email address will not be published. Required fields are marked *