Re: Overriding derived values



CREATE TABLE Discounts
(player_id CHAR(15) NOT NULL
REFERENCES Players (player_id)
ON DELETE CASCADE
ON UPDATE CASCADE,
start_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
end_date DATETIME,
discount_percent DECIMAL (3,2) DEFAULT 0.00 NOT NULL,
CHECK (start_date < end_date),
PRIMARY KEY (player_id, start_date));

Use a NULL to represent "eternity" and use a stored procedure to add
one-month rows based on the bowler's average.

If they are not on the "permanent bad guy list" as shown by (end_date
IS NULL), then leave the row until it is manually overridden.

.



Relevant Pages

  • Re: Deriving unique rows from historical data
    ... ON UPDATE CASCADE, ... REFERENCES Locations ... start_time DATETIME NOT NULL, ... Google how to code for this schema. ...
    (comp.databases.ms-sqlserver)
  • Re: Custom data type
    ... tablesdbdesign group, here's my proposed design: ... key_date DATETIME NOT NULL ... ON UPDATE CASCADE, ... where calculated values normally belong: ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Modeling independent attributes on m:n links
    ... NOT NULL PRIMARY KEY, ... ON UPDATE CASCADE ... bookmark_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, ... -- this is the history what web sites were visited chronologically ...
    (comp.databases)