Querying Microsoft SQL Server 2012/2014 — Question 19
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series.
You develop a database for a travel application. You need to design tables and other database objects.
You create the Airline_Schedules table.
You need to store the departure and arrival dates and times of flights along with time zone information.
What should you do?
Answer options
- A. Use the CAST function.
- B. Use the DATE data type.
- C. Use the FORMAT function.
- D. Use an appropriate collation.
- E. Use a user-defined table type.
- F. Use the VARBINARY data type.
- G. Use the DATETIME data type.
- H. Use the DATETIME2 data type.
- I. Use the DATETIMEOFFSET data type.
- J. Use the TODATETIMEOFFSET function.
Correct answer: I
Explanation
The correct answer is I, as the DATETIMEOFFSET data type allows you to store date and time values along with time zone information, which is essential for flight schedules. The other options either do not support time zone data or are not suitable for storing date and time information effectively.