Exploring data using T-SQL

For simple data exploration, we can use T-SQL queries. Here, we will explore the uniqueness of values in columns where we estimate the uniqueness, a quality of reference between the SourceData.Contracts and SourceData.Actions tables, and also a rate of NULLs in several columns.

First of all, let's query both tables to obtain a sample of data and the structures of the tables. The following queries will achieve this:

select top 10 * from SourceData.Contractsselect top 10 * from SourceData.Actions

The results of the preceding queries show the first 10 rows of each table. The result is shown in the following screenshot:

Queries presenting the first 10 rows of each table

The preceding screenshot shows the sample ...

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.