You administer a Microsoft SQL Server database that supports a shopping application.
You need to retrieve a list of customers who live in territories that do not have a sales person.
Which Transact- SQL query or queries should you use? (Each correct answer presents a complete
solution. Choose all that apply.)

A.
SELECT CustomerID FROM Customer
WHERE TerritoryID <> SOME(SELECT TerritoryID FROM Salesperson)
B.
SELECT CustomerID FROM Customer
WHERE TerritoryID <> ALL(SELECT TerritoryID FROM Salesperson)
C.
SELECT CustomerID FROM Customer
WHERE TerritoryID <> ANY(SELECT TerritoryID FROM Salesperson)
D.
SELECT CustomerID FROM Customer
WHERE TerritoryID NOT IN(SELECT TerritoryID FROM Salesperson)
?
0
0
D
0
0
B and D
0
0
TEST
0
0
A and C. Link: https://technet.microsoft.com/en-us/library/ms187074(v=sql.105).aspx
0
0
Agree with Petrovich. Take a look at his reference link. This is what I understood.
“The ANY operator means not = a, or not = b, or not = c. NOT IN means not = a, and not = b, and not = c. ALL means the same as NOT IN. SOME is an ISO standard equivalent for ANY.”
which means:
territoryID Any(list of territoryID) will return true if one territoryID in the list equals territoryID
while territoryID All(list of territoryID) will only return true if all territoryID on the list = territoryID which in this case will be false since every territory has their own territoryID
Just keep in mind that:
“The =ANY operator is equivalent to IN.”
0
0
If ALL is equivalent to NOT IN then B and D are the same.
The ANY operator, however, differs from NOT IN: ANY means not = a, or not = b, or not = c. NOT IN means not = a, and not = b, and not = c. ALL means the same as NOT IN.
ANY is not the same as NOT IN.
0
0
BD
0
0
Correct!
0
0
Besides, part of that new 200Q 70-461 dumps are available here:
https://drive.google.com/open?id=0B-ob6L_QjGLpfnJldlZxTklTaHM0akpJUzhja2pETHJOS0owMzd4eVk1UTVNQUpvdlVxVWM
Best Regards!
0
0
B,D
The ANY operator, however, differs from NOT IN: ANY means not = a, or not = b, or not = c. NOT IN means not = a, and not = b, and not = c.
ALL means the same as NOT IN.
0
0