选项 3:您可以从元数据设计开始。这将允许您为每个项目或实体拥有多个记录。
这些事情通常会随着任务的发展、流程的发展和数据的学习或客户对随着时间推移提取的一些更精细的细节的理解而发展。
我看到过类似的事情,人们为标签或白名单设计,搜索可能会让你更接近你正在寻找的东西。这是一个帮助您入门的工作示例。
declare @venue as table(
VenueID int identity(1,1) not null primary key clustered
, Name_ nvarchar(255) not null
, Address_ nvarchar(255) null
);
declare @venueType as table (
VenueTypeID int identity(1,1) not null primary key clustered
, VenueType nvarchar(255) not null
);
declare @venueStuff as table (
VenueStuffID int identity(1,1) not null primary key clustered
, VenueID int not null -- constraint back to venueid
, VenueTypeID int not null -- constraint to dim or lookup table for ... attribute types
, AttributeValue nvarchar(255) not null
);
insert into @venue (Name_)
select 'Bob''s Funhouse'
insert into @venueStuff (VenueID, VenueTypeID, AttributeValue)
select 1, 1, 'Scarrrrry' union all
select 1, 2, 'Food Avaliable' union all
select 1, 3, 'Game tables provided' union all
select 1, 4, 'Creepy';
insert into @venueType (VenueType)
select 'Haunted House Theme' union all
select 'Gaming' union all
select 'Concessions' union all
select 'post apocalyptic';
select a.Name_
, b.AttributeValue
, c.VenueType
from @venue a
join @venueStuff b
on a.VenueID = b.VenueID
join @venueType c
on c.VenueTypeID = b.VenueTypeID