转入第二形态
伙计们,您将如何创建此表的第二种形式(主键是:{isbn,copy}):
isbn AB-1234-X
作者ID IC45
作者姓名 I.Conn
标题最后的帷幕
复制 2
分类侦探小说
用户ID xyz44
Guys, how would you create second form of this table (primary key is: {isbn,copy}):
isbn AB-1234-X
authorID IC45
authorName I.Conn
title The final curtain
copy 2
classification Detectivefiction
userID xyz44
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一个关系在 2NF 中当且仅当
依赖于每一个的整体
候选键(不只是部分
任何候选键)
唯一的候选键是 {isbn, copy}。所以问题就变成了三个问题。
{作者ID,作者姓名,标题,
仅与分类、userID}相关
在 {isbn} 上?
{作者ID,作者姓名,标题,
仅与分类、userID}相关
在{副本}上?
你怎么想?
稍后。 。 .
是的。在“关系语言”中,你用这两个投影替换了原来的关系R。
userid}
作者名、标题、分类}
如果您的操作正确,您应该能够通过在 {isbn} 上连接 R1 和 R2 来再次创建 R。
现在 R1 和 R2 都属于 2NF。 (我认为这就是作业问题的重点。)您可能需要考虑 R1 和 R2 是否在
稍后。 。 .
通俗地说,一个关系是 3NF 的,当且仅当
当我说“它在 2NF 中”时,我的意思是所讨论的关系在 2NF 中并且它尚未在 3NF、BCNF、4NF 或 5NF 中。
R1 和 R2 是什么范式?你需要解释你的推理,否则你的讲师很容易让你看起来很愚蠢。我们不希望这样。
userid}
作者名、标题、分类}
还有更晚的时间。 。 .
R1 属于 5NF。 R2 属于 2NF。
R2 不在 3NF 中,因为“isbn”和“authorname”之间存在传递依赖。
通过用这两个投影(R3 和 R4 替换 R2 来删除此传递依赖关系>)。
我认为标题和分类之间不存在功能依赖性。
A relation is in 2NF iff
dependent on the whole of every
candidate key (not on just part of
any candidate key)
The only candidate key is {isbn, copy}. So the question becomes three questions.
{authorID, authorName, title,
classification, userID} dependent only
on {isbn}?
{authorID, authorName, title,
classification, userID} dependent only
on {copy}?
What do you think?
Later . . .
Yes. In "relational speak", you replaced the original relation R with these two projections.
userid}
authorname, title, classification}
If you've done that correctly, you should be able to create R again by joining R1 and R2 on {isbn}.
Now both R1 and R2 are in 2NF. (I think that was the point of the homework question.) You might want to consider whether R1 and R2 are in
Still later . . .
Speaking informally, a relation is in 3NF iff
When I say "it's in 2NF", I mean the relation in question is in 2NF and it's not already in 3NF, BCNF, 4NF, or 5NF.
What normal form are R1 and R2 in? You'll want to explain your reasoning, otherwise your lecturer is liable to make you look foolish. And we don't want that.
userid}
authorname, title, classification}
And still later . . .
R1 is in 5NF. R2 is in 2NF.
R2 isn't in 3NF, because there's a transitive dependency between "isbn" and "authorname".
Remove this transitive dependency by replacing R2 with these two projections (R3 and R4).
I don't think there's a functional dependency between title and classification.
有你的分类和作者在单独的表中,如下所示:
图书表:
isbn AB-1234-X
authorID IC45
标题最终幕
副本 2
分类ID 1
用户ID xyz44
作者表:
作者ID
作者姓名
分类:
分类ID
分类名称
Have your classification & author in a separate table, like so:
Book Table:
isbn AB-1234-X
authorID IC45
title The final curtain
copy 2
classificationID 1
userID xyz44
Author Table:
AuthorID
AuthorName
Classfication:
ClassificationID
ClassificiationName