O'Reilly logo

Practical Business Intelligence by Ahmed Sherif

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting Excel to SQL Statements

Just as there are tables in SQL Server within our AdventureWorks2014 database for us to query on, there are also predefined views that are available for us to use; for all practical purposes, these views behave exactly the same as tables. The views are available at the following location within SQL Server:

Connecting Excel to SQL Statements

The following script can be used to pull store information such as postal codes and the number of employees:

 SELECT StoreAddress.City as 'City' ,StoreAddress.Name as 'Store Name' ,StoreAddress.PostalCode as 'Postal Code' ,sum(StoreDemo.NumberEmployees) as 'Number of Employees' FROM [AdventureWorks2014].[Sales].[vStoreWithAddresses] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required