Data transformation

The last section explained several very useful techniques of data exploration. In our real-world example, we explored the data and decided that we need to transform it before we continue working with it. In this section, we will make all desired transformations. The most comfortable way of making transformations is to use T-SQL, because all transformations that we need are rather straightforward.

The first of the transformations is just a join of both source tables. This will eliminate records from the SourceData.Actions table that do not have contracts, and it will also create a base for further analytical datasets. The following statement joins both tables together:

select    contracts.PhoneId    , contracts.IsCorporate , ...

Get Hands-On Data Science with SQL Server 2017 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.