Sales.vStoreWithDemographics
| Documentation | AdventureWorks |
| Schema | Sales |
| Name | vStoreWithDemographics |
| Module | Sales |
Stores (including demographics) that sell Adventure Works Cycles products to consumers.
Columns
| Key | Name | Data type | Null | Attributes | References | Description | ||
|---|---|---|---|---|---|---|---|---|
| 1 | BusinessEntityID | int | ||||||
| 2 | Name | nvarchar(50) | ||||||
| 3 | AnnualSales | money | ||||||
| 4 | AnnualRevenue | money | ||||||
| 5 | BankName | nvarchar(50) | ||||||
| 6 | BusinessType | nvarchar(5) | ||||||
| 7 | YearOpened | int | ||||||
| 8 | Specialty | nvarchar(50) | ||||||
| 9 | SquareFeet | int | ||||||
| 10 | Brands | nvarchar(30) | ||||||
| 11 | Internet | nvarchar(30) | ||||||
| 12 | NumberEmployees | int |
Uses
| Name |
|---|
|
Sales.vStoreWithDemographics
|
|
s.Demographics.value
|
Script
CREATE VIEW [Sales].[vStoreWithDemographics] AS SELECT s.[BusinessEntityID] ,s.[Name] ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; (/StoreSurvey/AnnualSales)[1]', 'money') AS [AnnualSales] ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; (/StoreSurvey/AnnualRevenue)[1]', 'money') AS [AnnualRevenue] ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; (/StoreSurvey/BankName)[1]', 'nvarchar(50)') AS [BankName] ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; (/StoreSurvey/BusinessType)[1]', 'nvarchar(5)') AS [BusinessType] ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; (/StoreSurvey/YearOpened)[1]', 'integer') AS [YearOpened] ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; (/StoreSurvey/Specialty)[1]', 'nvarchar(50)') AS [Specialty] ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; (/StoreSurvey/SquareFeet)[1]', 'integer') AS [SquareFeet] ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; (/StoreSurvey/Brands)[1]', 'nvarchar(30)') AS [Brands] ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; (/StoreSurvey/Internet)[1]', 'nvarchar(30)') AS [Internet] ,s.[Demographics].value('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"; (/StoreSurvey/NumberEmployees)[1]', 'integer') AS [NumberEmployees] FROM [Sales].[Store] s; |
Exported: 2019-02-04 23:13, Last imported: 2018-03-07 11:56
