exam questions

Exam 70-761 All Questions

View all questions & answers for the 70-761 exam

Exam 70-761 topic 1 question 109 discussion

Actual exam question from Microsoft's 70-761
Question #: 109
Topic #: 1
[All 70-761 Questions]

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section. You will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have a database that tracks orders and deliveries for customers in North America. The database contains the following tables:

Sales.Customers -


Application.Cities -


Sales.CustomerCategories -

Your company is developing a new social application that connects customers to each other based on the distance between their delivery locations.
You need to write a query that returns the nearest customer.
Solution: You run the following Transact-SQL statement:

The variable @custID is set to a valid customer.
Does the solution meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
moehijawe
Highly Voted 5 years, 4 months ago
there is no order in the query so no guarantee what returned record is in top so answer is no
upvoted 6 times
moehijawe
5 years, 4 months ago
Plus it inner join
upvoted 5 times
...
...
Andy7622
Most Recent 4 years, 4 months ago
We depend on the shortest distance not on the same city. Answer should B
upvoted 2 times
...
stm22
4 years, 10 months ago
the ^ symbol being used here is just wrong...i thought answer to question was No as soon as i saw the ^ symbol
upvoted 1 times
Braindripper
4 years, 7 months ago
Today on the exams was the same symbol there... i choosed no
upvoted 1 times
...
...
Backy
4 years, 11 months ago
Can anybody illuminate on the role of operator ^ used in this question. ^ is used as exclusive OR but it is used on bitmasks like integer type values. It does not have any meaning on geography type variables
upvoted 2 times
...
Bartek
5 years, 7 months ago
I think there should be YES. Example: drop table [TSQLV4].[HR].[customers] create table [TSQLV4].[HR].[customers] ( customerid int identity (1,1), Deliverylocation geography ) set identity_insert [TSQLV4].[HR].[customers] on insert into [TSQLV4].[HR].[customers] (customerid) values (1),(2),(3) UPDATE [TSQLV4].[HR].[customers] SET Deliverylocation = geography::Point( 40.854078, -73.869043 ,4326 ) where customerid =1 -- bronx zoo, closest to wsq, far to airport UPDATE [TSQLV4].[HR].[customers] SET Deliverylocation = geography::Point( 40.730581, -73.997732 ,4326 ) where customerid =2 --washigton square park closest to airport UPDATE [TSQLV4].[HR].[customers] SET Deliverylocation = geography::Point( 40.657440, -73.776462,4326 ) where customerid =3 -- airport jfk declare @id int = 3 select top 1 b.customerid, a.Deliverylocation.STDistance(b.deliverylocation) as dist from [TSQLV4].[HR].[customers] as a cross join [TSQLV4].[HR].[customers] as b where a.customerid = @id and a.customerid <> b.customerid order by dist
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago