avatar
C*n
1
Table:
User: UserID,...
Portal: PortalID,...
Role: RoleID, PortalID, ....
UserRole: UserID, RoleID
Question: Is this model 3NF? if not how to change it?
My problem is that: I want to constraint a User should belong to a paticular
portal. But right now, a User doesn't belong to any portal if he doesn't have
any ROLE associated, and I don't want a user has role from more than 1 portal.
Thanks,
Calvin
avatar
s*e
2
The definition of 3rd normal form is:
A relation that is in first and second normal form, and in which no
non-primary-key
attribute is transitively dependent on the primary key.
I think you need to create a new table user_portal, which has userid and
portalid.

have
portal.

【在 C****n 的大作中提到】
: Table:
: User: UserID,...
: Portal: PortalID,...
: Role: RoleID, PortalID, ....
: UserRole: UserID, RoleID
: Question: Is this model 3NF? if not how to change it?
: My problem is that: I want to constraint a User should belong to a paticular
: portal. But right now, a User doesn't belong to any portal if he doesn't have
: any ROLE associated, and I don't want a user has role from more than 1 portal.
: Thanks,

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。