Which data type stores only the time of day without a date?

Study for the SQL Basics Test. Improve your knowledge with multiple choice questions and detailed explanations. Prepare effectively to master SQL concepts!

Multiple Choice

Which data type stores only the time of day without a date?

Explanation:
Storing a time of day without any date is what the TIME data type is for. TIME holds values like 08:30:00 or 23:59:59, and may include fractions of a second, but it does not store any calendar date. This makes it ideal for fields such as start_time or alarm_time where only the clock time matters. Date stores just the calendar date, without any time component. DATETIME or TIMESTAMP include both date and time, so they would carry information about a specific day as well as the time, which isn’t what you want here. So the best choice for representing a time-of-day only is TIME.

Storing a time of day without any date is what the TIME data type is for. TIME holds values like 08:30:00 or 23:59:59, and may include fractions of a second, but it does not store any calendar date. This makes it ideal for fields such as start_time or alarm_time where only the clock time matters.

Date stores just the calendar date, without any time component. DATETIME or TIMESTAMP include both date and time, so they would carry information about a specific day as well as the time, which isn’t what you want here. So the best choice for representing a time-of-day only is TIME.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy