You administer a Microsoft SQL Server database that supports a banking transaction management application. You need to retrieve a list of account holders who live in cities that do not have a branch location.
Which Transact-SQL query or queries should you use?
A . SELECT AccountHolderID
FROM AccountHolder
WHERE CityID NOT IN (SELECT CityID FROM BranchMaster)
B . SELECT AccountHolderID
FROM AccountHolder
WHERE CityID <> ALL (SELECT CityID FROM BranchMaster)
C . SELECT AccountHolderID
FROM AccountHolder
WHERE CityID <> SOME (SELECT CityID FROM BranchMaster)
D . SELECT AccountHolderID
FROM AccountHolder
WHERE CityID <> ANY (SELECT CityID FROM BranchMaster)

Respuesta :

Answer:

A, B

Explanation:

A. selects accountholder's ids and check them with those who don't have cities in BranchMaster table.

B. We can use both NOT IN as well as <> operator for comparison so it selects accountholder's ids which are not in all of those account holders who have cities in BranchMaster.

ACCESS MORE