数据库实例

时间:2010-04-10 22:14:18

标签: entity relationship

I read a statement from an exercise: construct a database instance which conforms to diagram 1 but not to diagram 2. The diagrams are different n-ary relationships that have different relationships. Diagram 1 has a many to one to many to one relationship. Diagram 2 has many to many to many to one relationship. So, to really understand this problem, what does a database instance mean? Is it to make an example or abstract entities like a1, a2, or a3. Thanks for your time.  
EDIT: Here is the exercise: Consider the E/R diagrams in figure (2).
a: Construct a database instance which conforms to diagram 2 but not to diagram 1
b: Construct a database instance which conforms to diagram 3 but not to diagram 2
The instances may assume values like a1, a2, a3 for the entity A, b1, b2, b3 for the entity B, and so on. (If you are unable to come up with an instance explain why.).
                                   |---|
                     Diagram 2     | C |
                                   |---|
                                     |
                                    / \
                |---|              /   \            |---|
                | A |-------------     -------------| B |
                |---|              \   /            |---|
                                    \ /
                                     |
                                     |
                                    \ /  -- arrow
                                   |---|
                                   | D |
                                   |---|
Diagram 1 
                                   |---|
                                   | C |
                                   |---|
                                     ^
                                     |
                                    / \
                |---|              /   \            |---|
                | A |-------------     -------------| B |
                |---|              \   /            |---|
                                    \ /
                                     |
                                     |
                                    \ /  -- arrow
                                   |---|
                                   | D |
                                   |---|
Diagram 3 
                                   |---|
                                   | C |
                                   |---|
                                     |
                                    / \
                |---|              /   \            |---|
                | A |-------------     -------------| B |
                |---|              \   /            |---|
                                    \ /
                                     |
                                     |
                                   |---|
                                   | D |
                                   |---|

1 个答案:

答案 0 :(得分:2)

在这种情况下,它可能只意味着“构建一个数据库”,因此您只需构建数据库结构(表,外键等)

更新:是的我认为我会坚持自己的观点。您必须设计一个符合该图的数据库结构(该图描述了数据库中的表关系),实体是表。数据库实例只是指数据库。谷歌上的快速搜索提供了答案:

“具有员工数据库的组织可能有三个不同的实例:生产(用于包含实时数据),预生产(用于在发布到生产之前测试新功能)和开发(由数据库开发人员使用)创建新功能。“ http://databases.about.com/od/administration/g/instance.htm

祝你好运:)