1
0
mirror of https://github.com/Microsoft/sql-server-samples.git synced 2025-12-08 14:58:54 +00:00
Files
sql-server-samples/samples/databases/wide-world-importers/sample-scripts/polybase
2016-05-31 13:36:13 -07:00
..
2016-05-27 08:47:28 -07:00

Sample Querying of External Data Source in WideWorldImportersDW

This script demonstrates the use of PolyBase to query an external data source.

Demographics data is available in Azure blob storage. This data is joined with sales data recorded in the local database to determine which would be good candidates for future expansion of the business.

Contents

About this sample
Before you begin
Running the sample
Sample details
Disclaimers
Related links

About this sample

  1. Applies to: SQL Server 2016 (or higher), Azure SQL Database
  2. Key features: PolyBase
  3. Workload: Analytics
  4. Programming Language: T-SQL
  5. Authors: Greg Low, Jos de Bruijn
  6. Update history: 26 May 2016 - initial revision

Before you begin

To run this sample, you need the following prerequisites.

Software prerequisites:

  1. SQL Server 2016 (or higher) with PolyBase, connected to the internet.
  2. SQL Server Management Studio
  3. The WideWorldImportersDW database (Full version).

Running the sample

  1. Execute the sample script.

  2. Inspect external tables in the database.

  3. Review query results.

Sample details

The sample script performs a configuration and runs three queries:

  1. An external table dbo.CitePopulationStatistics is created in the database, pointing to a data set in Azure blob storage.

  2. The data in Azure storage is queried through Transact-SQL, showing all the data in the data source.

  3. Cities with a significant growth rate (>= 20%) are identified.

  4. Top cities for potential expansion are identified based on external data as well as sales data in the local database.

Disclaimers

The code included in this sample is not intended to be used for production purposes.

For more information, see these articles: