Performing market-basket analysis

Market-basket analysis means, in its simplest implementation, finding which products tend to get purchased together, in the same basket. The basket might be either physical, such as a basket in a retail store, or a virtual one, such as a single Web order with one or more items. In the AdventureWorksDW2017 demo database, there isa dbo.vAssocSeqLineItems view with the web purchase transactions with the content that I am examining with the following query:

SELECT TOP 3 *FROM dbo.vAssocSeqLineItems;

The result is this:

OrderNumber LineNumber Model----------- ---------- ------------SO61313     1          Road-350-WSO61313     2          Cycling CapSO61313     3          Sport-100

The OrderNumber column defines the basket, and the Model column identifies ...

Get Data Science with SQL Server Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.