SQL/MP Installation and Management Guide

Creating a Database
HP NonStop SQL/MP Installation and Management Guide523353-004
5-24
Defining Columns
An item of type TIME indicates a time of day based on a 24-hour clock. An item of type
TIME is made up of these contiguous fields:
HOUR Hour of day 0 to 23
MINUTE Minute of hour 0 to 59
SECOND Second of minute 0 to 59
The TIME data type is equivalent to DATETIME HOUR TO SECOND.
A column value of type TIMESTAMP is made up of any subset of the following year-
month or day-time contiguous fields:
YEAR Year 1 to 9999
MONTH Month of year 1 to 12
DAY Day of month 1 to 31
HOUR Hour of day 0 to 23
MINUTE Minute of hour 0 to 59
SECOND Second of minute 0 to 59
FRACTION Fraction of second 0 to 0.9(6), in which
6 is the precision.
The TIMESTAMP data type is equivalent to DATETIME YEAR TO FRACTION(6). The
maximum value of DAY depends on the length of the month.
A column value of type INTERVAL is made up of these contiguous fields:
YEAR Number of years Not constrained
MONTH Number of months 0 to 11
or
DAY Number of days Not constrained
HOUR Number of hours 0 to 23
MINUTE Number of minutes 0 to 59
SECOND Number of seconds 0 to 59
FRACTION Fraction of second 0 to 0.9(n), in which n is
the precision. The
maximum precision is 6;
the default is 6.
An INTERVAL column is defined to have a range of these contiguous fields, specified
by a required start-date-time field and an optional end-date-time field. You can specify
a precision for any start-date-time field, but you cannot include the FRACTION
precision in the start-date-time specification.
Guidelines
When you define a column to hold date and time, date, time, or time interval values,
use these general guidelines:
A column of the DATETIME, DATE, TIME, or TIMESTAMP type holds a value that
represents a date or an instant in time, and a column of the INTERVAL type holds
a value that represents a time interval, or duration.
A column of the DATE, TIME, or TIMESTAMP type is equivalent to a DATETIME
type with a specific range of DATETIME fields.