I m a MySQL newbie, I just discovered that it doesn t support assertions.
我来此表:
CREATE TABLE `guest` (
`ssn` varchar(16) NOT NULL,
`name` varchar(200) NOT NULL,
`surname` varchar(200) NOT NULL,
`card_number` int(11) NOT NULL,
PRIMARY KEY (`ssn`),
KEY `card_number` (`card_number`),
CONSTRAINT `guest_ibfk_1` FOREIGN KEY (`card_number`) REFERENCES `member` (`card_number`)
)
What I need is that a member can invite maximum 2 guests.
So, in table guest
I need that a specific card_number
can appear maximum 2 times.
我如何在没有断言的情况下加以管理?
感谢。