我正在寻找实现位置管理DB的建议/最佳实践。
位置有一个主接入点和潜在的无限个辅助接入点。它们必须有一个并且只有一个主接入点。这些接入点可以由其他位置以不同的方式引用。(一个地点的二级接入点可能是另一个地点的主要接入点)。为了干爽起见,我想要一张“地点”表和另一张"AccessPoints“表。为了执行这种行为,我正在努力处理中间表/规则。
发布于 2017-07-26 06:16:16
听起来很简单,所以也许有什么我不明白的?
CREATE TABLE LOCATIONS
( location_key ... primary key not null
, location attribute_1 ... not null
, ...
, location attribute_n ... not null );
CREATE TABLE ACCESS_POINTS
( access_point_key ... not null
, location_key ... not null
, access_point attribute_1 ... not null
, ...
, access_point attribute_m ... not null
, constraint ... primary key (access_point_key, location_key)
, constraint ... foreign key (location_key)
references LOCATIONS (location_key)
);这里假设多个位置可以共享相同的access_point。
https://dba.stackexchange.com/questions/181800
复制相似问题