exam questions

Exam 70-761 All Questions

View all questions & answers for the 70-761 exam

Exam 70-761 topic 1 question 63 discussion

Actual exam question from Microsoft's 70-761
Question #: 63
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 -

The company's development team is designing a customer directory application. The application must list customers by the area code of their phone number. The area code is defined as the first three characters of the phone number.
The main page of the application will be based on an indexed view that contains the area and phone number for all customers.
You need to return the area code from the PhoneNumber field.
Solution: You run the following Transact-SQL statement:

Does the solution meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️
The following indicates a correct solution:
✑ The function returns a nvarchar(10) value.
✑ Schemabinding is used.
✑ SELECT TOP 1 "¦ gives a single value
Note: nvarchar(max) is correct statement.
nvarchar [ ( n | max ) ]
Variable-length Unicode string data. n defines the string length and can be a value from 1 through 4,000. max indicates that the maximum storage size is 2^31-1 bytes (2 GB).
References:
https://docs.microsoft.com/en-us/sql/t-sql/data-types/nchar-and-nvarchar-transact-sql https://sqlstudies.com/2014/08/06/schemabinding-what-why/

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
geekeek1
4 years, 5 months ago
it is correct
upvoted 1 times
...
Vermonster
4 years, 5 months ago
This is correct. The phone number is explicity defined to have the format ###-###-####. TOP 1 of STRING_SPLIT will return the first portion which is the area code
upvoted 1 times
...
BabyBee
4 years, 7 months ago
I think that, STRING_SPLIT won't return the 3 rows in any particular order, so with this query how can you ensure it's gonna be the first 3 characters?
upvoted 2 times
...
Barbedx
5 years, 4 months ago
But there are can be more than 3 symbols, in requierements says: The area code is defined as the first three characters of the phone number. So, this is UNCORRECT
upvoted 3 times
eduardogtc
4 years, 9 months ago
Agree. It doesn't meet the requirement.
upvoted 1 times
...
Braindripper
4 years, 9 months ago
no matter how many symbols they are we need the first value only which will be given by top 1
upvoted 1 times
...
PanMarcepan
4 years, 9 months ago
In table definition it says that phone number is formated as 425-555-0187, so starts with 3 symbols.
upvoted 4 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 ...