CREATE TABLE Rates
(
fromtime SMALLDATETIME NOT NULL,
totime SMALLDATETIME NOT NULL,
rate MONEY NOT NULL,
PRIMARY KEY(fromtime, totime),
CHECK (totime > fromtime)
)
INSERT INTO Rates VALUES('00:00', '07:59', 0.02)
INSERT INTO Rates VALUES('08:00', '21:59', 0.05)
INSERT INTO Rates VALUES('22:00', '23:59', 0.02)