← All tables and views

AdventureWorks OLTP view

Sales.vStoreWithContacts

Native view in the AdventureWorks OLTP sample database.

753rows

12 columns

Schema from the provider contract
ColumnTypeNullableKeyReferences
BusinessEntityIDyes——
Nameyes——
ContactTypeyes——
Titleyes——
FirstNameyes——
MiddleNameyes——
LastNameyes——
Suffixyes——
PhoneNumberyes——
PhoneNumberTypeyes——
EmailAddressyes——
EmailPromotionyes——

View definition

CREATE VIEW "Sales.vStoreWithContacts" AS
SELECT
    s."BusinessEntityID"
    ,s."Name"
    ,ct."Name" AS "ContactType"
    ,p."Title"
    ,p."FirstName"
    ,p."MiddleName"
    ,p."LastName"
    ,p."Suffix"
    ,pp."PhoneNumber"
	,pnt."Name" AS "PhoneNumberType"
    ,ea."EmailAddress"
    ,p."EmailPromotion"
FROM "Sales.Store" s
    INNER JOIN "Person.BusinessEntityContact" bec
    ON bec."BusinessEntityID" = s."BusinessEntityID"
	INNER JOIN "Person.ContactType" ct
	ON ct."ContactTypeID" = bec."ContactTypeID"
	INNER JOIN "Person.Person" p
	ON p."BusinessEntityID" = bec."PersonID"
	LEFT OUTER JOIN "Person.EmailAddress" ea
	ON ea."BusinessEntityID" = p."BusinessEntityID"
	LEFT OUTER JOIN "Person.PersonPhone" pp
	ON pp."BusinessEntityID" = p."BusinessEntityID"
	LEFT OUTER JOIN "Person.PhoneNumberType" pnt
	ON pnt."PhoneNumberTypeID" = pp."PhoneNumberTypeID"

Data preview

Sample records

753 rows available
BusinessEntityIDNameContactTypeTitleFirstNameMiddleNameLastName
292Next-Door Bike StoreOwnerMr.GustavoNULLAchong
294Professional Sales and ServiceOwnerMs.CatherineR.Abel
296Riders CompanyOwnerMs.KimNULLAbercrombie
298The Bike MechanicsOwnerSr.HumbertoNULLAcevedo
300Nationwide SupplyOwnerSra.PilarNULLAckerman
302Area Bike AccessoriesOwnerMs.FrancesB.Adams
304Bicycle Accessories and KitsOwnerMs.MargaretJ.Smith
306Clamps & Brackets Co.OwnerMs.CarlaJ.Adams