Home > Articles > Data

SQL Performance Tuning: Dates in SQL

  • Print
  • + Share This
  • 💬 Discuss
Using dates in database-management systems (DBMSs) brings up some portability problems and uncovers some undocumented and underexplained features. Peter Gulutzan and Trudy Pelzer explore the DATE data type and its impact on eight SQL DBMSs.

During research for our book SQL Performance Tuning (Addison Wesley Professional, 2002), we found that using dates brings up some portability problems, some undocumented features, and some areas that cry out for more explanation. This article shows how the DATE data type works with eight SQL database-management systems: IBM DB2, Informix, Ingres, InterBase, Microsoft SQL Server, MySQL, Oracle, and Sybase (we'll call these "the Big Eight DBMSs").

Our concern is what you can do with dates, so we'll leave aside information on how to format a date and other locale-specific trivia. We'll use extended dates such as January 4 1970 throughout, except when we're showing a value in ANSI/ISO SQL Standard form (such as 1970-01-04).

  • + Share This
  • 🔖 Save To Your Account

Discussions

comments powered by Disqus