O'Reilly logo

Joe Celko's SQL for Smarties, 5th Edition by Joe Celko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12

Temporal Data Types in SQL

Abstract

SQL is the first programming language to have temporal data types in it. The problem is that our calendar system is irregular.

Keywords

Y2K problem

Common Era Calendar

ISO-8601

Universal Coordinated Time

YEAR

MONTH

DAY

HOUR

MINUTE

SECOND

Timestamp

Calendar date

Ordinal date

Week date

USNO

NIST

ITS

ACTS

Time zones

CURRENT_TIMESTAMP

LOCALTIMESTAMP

INTERVAL data types

Date arithmetic

OVERLAPS() predicate

History tables

State-transition constraints

Calendar tables

Report period tables

Clifford Simak wrote a science fiction novel entitled Time is the Simplest Thing in 1977. He was wrong. And the problems did not start with the Y2K problems we had in 2000, either. The calendar is irregular and the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required