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
- Applies to: SQL Server 2016 (or higher), Azure SQL Database
- Key features: PolyBase
- Workload: Analytics
- Programming Language: T-SQL
- Authors: Greg Low, Jos de Bruijn
- Update history: 26 May 2016 - initial revision
Before you begin
To run this sample, you need the following prerequisites.
Software prerequisites:
- SQL Server 2016 (or higher) with PolyBase, connected to the internet.
- SQL Server Management Studio
- The WideWorldImportersDW database (Full version).
Running the sample
-
Execute the sample script.
-
Inspect external tables in the database.
-
Review query results.
Sample details
The sample script performs a configuration and runs three queries:
-
An external table
dbo.CitePopulationStatisticsis created in the database, pointing to a data set in Azure blob storage. -
The data in Azure storage is queried through Transact-SQL, showing all the data in the data source.
-
Cities with a significant growth rate (>= 20%) are identified.
-
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.
Related Links
For more information, see these articles: