exam questions

Exam 70-461 All Questions

View all questions & answers for the 70-461 exam

Exam 70-461 topic 1 question 190 discussion

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

You develop a Microsoft SQL Server database that contains a table named Employee, defined as follows:

You need to create a view that contains two computed columns representing the month and the year of the [HireDate] of each Employee.
Which function should you use?

  • A. DATENAME( )
  • B. CONVERT( )
  • C. TRYDATEDIFF( )
  • D. MONTH( ) and YEAR( )
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
The Month function returns an integer that represents the month of the specified date.
The Year function an integer that represents the year of the specified date.
References:
https://docs.microsoft.com/en-us/sql/t-sql/functions/month-transact-sql?view=sql-server-2017 https://docs.microsoft.com/en-us/sql/t-sql/functions/year-transact-sql?view=sql-server-2017

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
lilupv
4 years, 9 months ago
There are no requirements for month and year format. DATENAME can provide year and month but as string ('2007' and 'October', for example).
upvoted 1 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 ...