Sales.vStoreWithDemographics View
In This Topic
Description
Stores (including demographics) that sell Adventure Works Cycles products to consumers.
Properties
Creation Date | 27/10/2017 14:33 |
Is Schema Bound |  |
Encrypted |  |
Ansi Nulls |  |
Columns
| Column Name | Description | Datatype | Length | Allow Nulls | Default | Formula |
| BusinessEntityID | | Integer | 4 | | | |
| Name | | dbo.Name | 50 | | | |
| AnnualSales | | Currency | 8 |  | | |
| AnnualRevenue | | Currency | 8 |  | | |
| BankName | | VarWChar | 50 |  | | |
| BusinessType | | VarWChar | 5 |  | | |
| YearOpened | | Integer | 4 |  | | |
| Specialty | | VarWChar | 50 |  | | |
| SquareFeet | | Integer | 4 |  | | |
| Brands | | VarWChar | 30 |  | | |
| Internet | | VarWChar | 30 |  | | |
| NumberEmployees | | Integer | 4 |  | | |
Objects that Sales.vStoreWithDemographics depends on
| Database Object | Object Type | Description | Dep Level |
 | Person.BusinessEntity | Table | Source of the ID that connects vendors, customers, and employees with address and contact information. | 2 |
 | Person.CountryRegion | Table | Lookup table containing the ISO standard codes for countries and regions. | 4 |
 | HumanResources.Employee | Table | Employee information such as salary, department, and title. | 3 |
 | dbo.Flag | User Defined Data Type | | 4 |
 | dbo.Name | User Defined Data Type | | 2 |
 | dbo.NameStyle | User Defined Data Type | | 5 |
 | Person.Person | Table | Human beings involved with AdventureWorks: employees, customer contacts, and vendor contacts. | 4 |
 | Sales.SalesPerson | Table | Sales representative current information. | 2 |
 | Sales.SalesTerritory | Table | Sales territory lookup table. | 3 |
 | Sales.Store | Table | Customers (resellers) of Adventure Works products. | 1 |
View Definition
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;
|
See Also