### Instruction: CREATE TABLE Vw_AssetDetails (InventoryId INT, ManufacturerId INT, VendorId INT, SerialNumber NVARCHAR, AssetTag NVARCHAR, ModelNo NVARCHAR, MACAddress NVARCHAR, Description NVARCHAR, AssetCost DECIMAL, PurchaseDate DATETIME, WarrantyInDays INT, ExpiryDate DATETIME, Remarks VARCHAR, Status INT, ManufacturerName VARCHAR, VendorName NVARCHAR, CompName NVARCHAR, CompCode NVARCHAR, InventoryStatus VARCHAR, companyid INT, AssetType NVARCHAR)
CREATE TABLE AM_AssetAllocateToBranch (AssetAllocationId INT, ComapnyId INT, BranchId INT, AssetTypeId INT, ManufactureId INT, SerialNumberId INT, Remarks NVARCHAR, CreatedOn DATETIME, CreatedBy INT, CreatedMachineIp NVARCHAR, UpdatedOn DATETIME, UpdatedBy INT, UpdatedMachineIp NVARCHAR, IsApproved BIT, Status INT, Tag NVARCHAR)
CREATE TABLE CompanyBranchMaster (BranchID INT, BranchName NVARCHAR, CompanyID INT, ParishId INT, Address NVARCHAR, Country NVARCHAR, City NVARCHAR, ZipCode NVARCHAR, Telephone NVARCHAR, FaxNumber NVARCHAR, SkyPayID NVARCHAR, Email NVARCHAR, IsActive BIT, CreatedBy INT, CreatedDate DATETIME, CreatedMachineIP NVARCHAR, UpdatedBy INT, UpdatedDate DATETIME, UpdatedMachineIP NVARCHAR, TimeZone_Id INT, Latitude DECIMAL, Longitude DECIMAL, Radius DECIMAL, BranchLocation NVARCHAR, IsRemote BIT) --Using valid MS SQL Server, answer the following questions for the tables provided above. -- How many assets are unassigned to any location? 
### Response: SELECT isnull(count(*),0) UnallocatedAssetCount   FROM Vw_AssetDetails AS e   LEFT OUTER JOIN [AM_AssetAllocateToBranch] B ON e.InventoryId=b.SerialNumberId left outer join CompanyBranchMaster br on b.BranchId= br.BranchID WHERE b.SerialNumberId is  null