Content
Conceptual model - ERD Logical model - schema, data dictionary, attributes mapping, ... Physical modelE-R Diagram (Conceptual Model)
How should I write a relationship in the diamond? Reading order: From left to right. For example, an employee manages other employees.
ERD could represent superclass-subclass relationships.
"O" is overlapping, meaning there could be overlapping between each subclass entities. (A manager could also be a salesperson) Besides, we can use "D" for disjoint subclasses.A single line between Employee and its subclasses implies an optinal participation (an employee may not belong to any subclass), while a double line implies a mandatory participation (an employee must be in one or more subclasses).An U-like symbol identify subclasses by pointing to them. (the entity the bottom of "U" points to is a subclass)
Logical Model
Schema represents abstract (strong and weak) entities and associated attributes and necessary relationships between entities.A schema looks like this: STUDENT( Stu_num, Stu_Lname, Stu_Fname, program_num@, age, gender) (PK "Stu_num" should be underscored. I use italic instead) Data dictionary contains metadata of attributes, with which you could understand the what, where, how, how much, who, when questions about data.
Normal Form
A good logical model should follow normal form of database.
UNF Contains repeating values.
1NF Each cell in the table contains only one value (so that the table can be represented in a relational database).
2NF Satisfies 1NF; No partial dependencies. Meaning: A non-primary-key attribute cannot be dependent on part of primary-key.
For example, in R( A B C D), if (A+B) -> C, D, (B) -> D, D is partially dependent on primary key (A+B), thus not satisfying 2NF.
3NF Satisfies 2NF; No transitive dependencies. Meaning: A non-primary-key attribute cannot determine non-primary-key attributes. (But a non-primary-key attribute can determine a primary-key attribute)
BCNF Satisfies 3NF; No non-CK dependencies. Another way to say this: For all functional dependencies exist in the table, all their determinants are candidate keys. Meaning: the second and third normal forms normalize non-prime attributes, and BCNF normalizes relationships between prime attributes.
For example (a model in 3NF but not in BCNF) In R( A B C D), there are (A+B) -> C, D; (A+C) -> B, D; (C) -> B. With a non-primary-key attribute C determines primary-key attribute B, the model does not satisfy BCNF.
4NF Satisfies BCNF; No multi-value attributes. 作者:jin2017 链接:https://www.jianshu.com/p/88dfcbc48106 来源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
编辑推荐:
相关推荐
-
雷神推出 MIX PRO II 迷你主机:基于 Ultra 200H,玻璃上盖 + ARGB 灯效
2 月 9 日消息,雷神 (THUNDEROBOT) 现已宣布推出基于英
-
制造商 Musnap 推出彩色墨水屏电纸书 Ocean C:支持手写笔、第三方安卓应用
2 月 10 日消息,制造商 Musnap 现已在海外推出一款 Oce
热文推荐
- Relationship Database Design
Relationship Database Design
26-03-03 - 数据库监控---PIGOSS BSM
数据库监控---PIGOSS BSM
26-03-03 - Oracle 自动化运维-Python监控Oracle告警日志
Oracle 自动化运维-Python监控Oracle告警日志
26-03-03 - 审计表AUD$引起system表空间异常增长
审计表AUD$引起system表空间异常增长
26-03-03 - Oracle 12C新特性-History命令
Oracle 12C新特性-History命令
26-03-03 - SQLPlus无法登录数据库提示密码不对或权限不足
SQLPlus无法登录数据库提示密码不对或权限不足
26-03-03 - Thread cannot allocate new log, sequence
- se://error/ Oracle 19c EM Exporess无法登陆
- ORACLE_CDB/PDB克隆迁移转换
ORACLE_CDB/PDB克隆迁移转换
26-03-03 - 修改undo表空间
修改undo表空间
26-03-03
