Database Fundamentals — Question 146

You manage a database named Exams accessed via a website.
The website is regularly accessed by users in different countries.
You are redesigning a table named History that records when users have purchased and taken online exams.
You need one of the columns in the History table to record what time of day that a user has taken an exam.
Additionally, you need this column to have time zone awareness.
What data type should you use?

Answer options

Correct answer: A

Explanation

The correct answer is A, datetimeoffset, because it is specifically designed to store date and time values along with the time zone information, which is essential for this scenario. Option B, datetime, does not include time zone awareness, making it unsuitable. Option C, while it attempts to address the issue, adds unnecessary complexity by requiring two columns. Option D, datetime2, also lacks the time zone awareness needed for this requirement.