从模式创建 ERD? [英] Creating a ERD from schema?

查看:87
本文介绍了从模式创建 ERD?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被告知要根据以下内容创建 ERD 图

学院记录每个学生的姓名、学号、社会保障号码、地址、电话、出生日期和性别.– 每个程序都由程序代码、名称、描述、持续时间描述(年数)、级别和成本.– 每个模块都有一个模块代码、名称、描述、持续时间(周数),级别(入门、中级、高级).– Grade 存储学号、模块代码和字母等级(A、B、C、D、E、F).每个项目都招收学生.然后学生注册模块.在结束时一个模块的学习时间学生会收到他们的成绩.

我为每个实体都做了属性

学生(sNmber、SSN、sName、地址、电话、出生日期、性别)程序(代码、名称、描述、持续时间、级别、成本)模块(mCode、名称、描述、持续时间、级别)年级(sNumber、mCode、等级)

我的最终图表也与实体关系类似,我知道我必须将 M:N 关系分解为两个 1:M 关系.包含 - program_ Modules (pCode, mCode)

但是我的图表似乎与连接模块和学生的评分不一致??

我对此很陌生,因此非常感谢您的指点

解决方案

首先,模式"还不够明确,不能称为模式.尽管这些键对您来说可能很明显,但它们并没有被识别出来.充其量只是一种描述,而且是不完整的描述.例如.如果是模式,则 M::N 问题将得到解决,表将被命名,所有键将被识别.

在 ERD 中,您没有显示属性,这是必需的.接下来,您需要显示哪些属性是键.

ERD

这是一个 ERD,使用稍微改进的符号,根据您的描述建立.

注意关系键:

  • 它们是复合的

  • 他们必须:

    • 防止重复行
    • 强制关系完整性,这是合乎逻辑的(与参照完整性不同,后者是物理的)
      例如,我们希望限制学生注册他参加的计划中的模块.

关系数据模型

显然,ERD 非常有限,它无法显示关系数据模型中所有可能和所需的定义.此外,正如所证明的那样,它很快就会变得拥挤.

教授关系数据库的 ERD 是非常荒谬的.在现实世界中,我们不使用 ERD 建模数据,我们使用

  • 我的IDEF1X 简介是初学者必备读物

  • 注意 • 内容

    • 主键和备用键都是明确的.

    • 理解Module中的Level.Programme中的Level不清楚.它可能与前者有关,也可能没有.

    • 谓词可以直接从模型中读取.如果您需要文本形式的内容,请询问.

    I was told to create a ERD diagram given the following

    The college keeps track of each student’s name, student number, social security
    number, address, phone, date-of-birth, and gender.
    
    – Each programme is described by a programme code, name, description, duration
    (number of years), level, and the cost.
    
    – Each module has a module code, name, description, duration (number of weeks),
    level (introductory, intermediate, advance).
    
    – Grade stores student number, module code, and a letter grade (A, B, C, D, E, F).
    
    Each program enrolls students. Students then register modules. At the end of the
    study duration of a module students receive their grades.
    

    I have made attributes for each entity

    Student
    (sNmber, SSN, sName, address, phone, DOB, gender)
    
    Programme
    (pCode, name, description, duration, level, cost)
    
    Module
    (mCode, name, description, duration, level)
    
    Grade
    (sNumber, mCode, grade)
    

    My final diagram looks like this with entity relationships as well, I know I will have to break the M:N relationships down to two 1:M ex. Contains - programme_ Modules (pCode, mCode)

    But my diagram seems off with the connecting Modules and Students to grade??

    I am very new to this so would really appreciate some pointers

    解决方案

    The first thing is, that "schema" is not definitive enough to be called a schema. Although the Keys may be obvious to you, they are not identified. At best, it is a description, and an incomplete one. Eg. if it were a schema, the M::N issue would be resolved, the table would be named, and all Keys would be identified.

    In the ERD, you have not shown the attributes, which is required. Next, you need to show which attributes are Keys.

    ERD

    Here is an ERD, using somewhat improved symbols, erected from your description.

    Note the Relational Keys:

    • They are composites

    • They are required to:

      • prevent duplicate rows
      • enforce Relational Integrity, which is logical (as distinct from Referential Integrity, which is physical)
        Such as, we want to constrain a Student to register for a Module that is in the Programme that he is enrolled in.

    Relational Data Model

    Obviously, the ERD is very limited, it does not have the capability to show all the definitions that are possible, and desired, in a Relational data model. Further, as evidenced, it gets crowded very quickly.

    It is quite ridiculous to teach ERD for Relational databases. In the real world, we do not use ERD for modelling data, we use IDEF1X, the Standard for Relational data modelling since 1993. This is what it looks like.

    Note • Notation

    Note • Content

    • The Primary Keys, as well as Alternate Keys, are explicit.

    • The Level in Module is understood. The Level in Programme is not clear. It may or may not have some relation to the former.

    • The Predicates can be read directly from the model. If you need them in text form, please ask.

    这篇关于从模式创建 ERD?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆