--- title: "Lesson 3: Processing the Market Basket Mining Structure | Microsoft Docs" ms.custom: "" ms.date: "03/06/2017" ms.prod: "sql-server-2014" ms.reviewer: "" ms.technology: analysis-services ms.topic: conceptual ms.assetid: 095a043f-cf6f-45bb-a021-ae4e1b535c65 author: minewiskan ms.author: owend manager: kfile --- # Lesson 3: Processing the Market Basket Mining Structure In this lesson, you will use the [INSERT INTO (DMX)](/sql/dmx/insert-into-dmx) statement and the vAssocSeqLineItems and vAssocSeqOrders from the [!INCLUDE[ssSampleDBDWobject](../includes/sssampledbdwobject-md.md)] sample database to process the mining structures and mining models that you created in [Lesson 1: Creating the Market Basket Mining Structure](../../2014/tutorials/lesson-1-creating-the-market-basket-mining-structure.md) and [Lesson 2: Adding Mining Models to the Market Basket Mining Structure](../../2014/tutorials/lesson-2-adding-mining-models-to-the-market-basket-mining-structure.md). When you process a mining structure, [!INCLUDE[ssASnoversion](../includes/ssasnoversion-md.md)] reads the source data and builds the structures that support mining models. When you process a mining model, the data defined by the mining structure is passed through the data mining algorithm that you chose. The algorithm searches for trends and patterns, and then stores this information in the mining model. The mining model, therefore, does not contain the actual source data, but instead contains the information that was discovered by the algorithm. For more information about processing mining models, see [Processing Requirements and Considerations (Data Mining)](../../2014/analysis-services/data-mining/processing-requirements-and-considerations-data-mining.md). You only have to reprocess a mining structure if you change a structure column or change the source data. If you add a mining model to a mining structure that has already been processed, you can use the `INSERT INTO MINING MODEL` statement to train the new mining model on the existing data. Because the Market Basket mining structure contains a nested table, you will have to define the mining columns to be trained using the nested table structure, and use the `SHAPE` command to define the queries that pull the training data from the source tables. ## INSERT INTO Statement In order to train the Market Basket mining structure and its associated mining models, use the [INSERT INTO (DMX)](/sql/dmx/insert-into-dmx) statement. The code in the statement can be broken into the following parts. - Identifying the mining structure - Listing the columns in the mining structure - Defining the training data using `SHAPE` The following is a generic example of the `INSERT INTO` statement: ``` INSERT INTO MINING STRUCTURE [] ( [] ( SKIP, ) ) SHAPE { OPENQUERY([],'') } APPEND ( {OPENQUERY([],'''') } RELATE [] TO [] ) AS [] ``` In this lesson, you use `OPENQUERY` to define the source data. For information about other methods of defining a query on the source data, see [<source data query>](/sql/dmx/source-data-query). ## Lesson Tasks You will perform the following task in this lesson: - Process the Market Basket mining structure ## Processing the Market Basket Mining Structure #### To process the mining structure by using INSERT INTO 1. In **Object Explorer**, right-click the instance of [!INCLUDE[ssASnoversion](../includes/ssasnoversion-md.md)], point to **New Query**, and then click **DMX**. Query Editor opens and contains a new, blank query. 2. Copy the generic example of the INSERT INTO statement into the blank query. 3. Replace the following: ``` [] ``` with: ``` Market Basket ``` 4. Replace the following: ``` [] ( SKIP, ) ``` with: ``` [OrderNumber], [Products] (SKIP, [Model]) ``` In the statement, `Products` refers to the Products table defined by the SHAPE statement. `SKIP` is used to ignore the Model column, which exists in the source data as a key, but is not used by the mining structure. 5. Replace the following: ``` SHAPE { OPENQUERY([],'