所以一开始我在想这样的事情。
CREATE TABLE `events` (
`event_id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`event_name` VARCHAR(200),
`date_added` DATETIME
PRIMARY KEY(event_id)
);
CREATE TABLE `event_date` (
`event_id` INTEGER UNSIGNED NOT NULL,
`start_date` DATE,
`end_date` DATE,
FOREIGN KEY event_id REFERENCES events(event_id) ON DELETE CASCADE
);
CREATE TABLE `event_times` (
`event_id` INTEGER UNSIGNED NOT NULL,
`event_date` DATE,
`start_time` TIME,
`end_time` TIME,
FOREIGN KEY event_id REFERENCES events(event_id) ON DELETE CASCADE
);
是否可以使用此模式确保 even_times.event_date 在 event_date.start_date 和 event_date.end_date 范围内?