Consider the following schema,
考虑以下架构,
-- items which have periodic updates
CREATE TABLE items (
[id] int identity(1, 1) primary key,
[name] varchar(100) not null
);
-- item updates. updating an item generally means it has a new status, at a certain time.
CREATE TABLE updates (
[id] int identity(1, 1) primary key,
[item_id] int foreign key references items([id]),
[new_status] varchar(100) not null,
[update_date] datetime not null
);
-- i