我Fine
在 MySQL 表中有一个派生属性,其值为
(CurrentDate - DueDate) * 0.5
CurrentDate
并以格式DueDate
存储在表中。Date
如何为Fine
表中的属性指定此公式
CREATE TABLE IF NOT EXISTS Loan (
loanID INT UNSIGNED NOT NULL AUTO_INCREMENT,
BorrowDate DATE DEFAULT NULL,
ReturnDate DATE DEFAULT NULL,
DueDate DATE DEFAULT NULL,
--- Fine... What do I write for Fine here-------
userID INT UNSIGNED NOT NULL,
itemID INT UNSIGNED NOT NULL,
PRIMARY KEY (loanID) ,
FOREIGN KEY (userID) REFERENCES LibraryUser (userID),
FOREIGN KEY (itemID) REFERENCES Items (itemID)
);