
-- Distribution Name and Distribution Center Zones
SELECT 
	z.Zone, t.ZoneCategory
FROM tbZone z with (nolock) 
INNER JOIN tbZoneType t with (nolock) ON t.ZoneTypeId = z.ZoneTypeId
WHERE t.ZoneCategory like 'DistributorName' OR t.ZoneCategory like 'DistributionCenter'

-- Associations between Vendors and Zones
SELECT 
	v.VendorName, z.Zone, t.ZoneCategory
FROM tbVendorZone vz with (nolock)
INNER JOIN tbVendor v with (nolock) ON v.VendorId = vz.VendorId
INNER JOIN tbZone z with (nolock) ON z.ZoneId = vz.ZoneId
INNER JOIN tbZoneType t with (nolock) ON t.ZoneTypeId = z.ZoneTypeId
ORDER BY v.VendorName, t.ZoneCategory Desc