How Are Date and Time Values Stored?

Date and time values are stored in table columns like any other data. Some sort of a Date data type is assigned to columns with date values. Dates can be stored as either a character string, or stored internally by the database in the available Date data type format. Each implementation has a default storage format for the date and time. The default format often varies among different implementations as do other data types for each implementation. In the following subsections, we study the standard format of the DATETIME data type and its elements. Later, we show you the data types for date and time in some popular implementations of SQL, including Oracle, Sybase, MySQL, and Microsoft SQL Server.

ANSI Standard ...

Get Sams Teach Yourself SQL in 21 Days, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.