尧图网站建设 尧图网络
  • 首页
  • 关于我们
  • 服务项目
  • 案例展示
  • 建站流程
  • 资讯中心
  • 联系我们
首页/资讯中心/详情

东南大学数据库课程06-Database Design

东南大学数据库课程06-Database Design
📅 发布时间:2026/6/19 16:19:44

Database Design

目录
  • Database Design
  • Data Dependency
  • Normalization of Relational Schema
    • 1NF
    • 2NF
    • Problems of non 2NF
    • 3NF
    • Problems of non 3NF
    • Summary
  • ER Model and ER Diagram
  • Database Design Method
    • Requirement Analysis
    • Concept Design
    • Logic Design
    • Physical Design
  • Summary

Data Dependency

Some dependent relations exit between attributes

  1. Function dependency(FD): the most basic kind of data dependencies. The value of one or a group attributes can decide the value of other attributes. FD is the most important in general database design.(学号可以决定其他属性的值,其他属性是函数依赖与学号的)

  2. Multi-valued Dependency(MVD):the value of some attribute can decide a group of values of some other attributes. (函数依赖是多值依赖的特例;决定一个值\决定一组值)

  3. Join Dependency (JD): the constraint of lossless join decomposition.

    SPJ(供应商,零件,项目)

    SPJ[S,P,J] = SPJ[S,P] join SPJ[S,J] join SPJ[p,j]
    无损连接分解
    SPJ三个属性存在连接依赖

💡 多值依赖与连接依赖并不常见,所以设计数据库时大多只考虑函数依赖

Normalization of Relational Schema

1NF

every attribute of a relation must be atomic.(不允许表中套表)

8ebcf975-ddea-4ca8-b037-be2fa780c87f

2NF

  1. R∈1NF
  2. no partially function dependency exists between attributes.(不存在属性对主键的部分函数依赖)

图56.png

S(S#, SNAME, AGE, ADDR, C#, GRADE)
--- non 2NF

(S,C)是主键,S可以决定SNAME,AGE,ADDR。三者对主键存在部分函数依赖,不属于2NF

Problems of non 2NF

  • Insert abnormity: can not insert the students’
    information who have not selected course.【因为SC都是主键】
  • Delete abnormity: if a student unselect all courses, his
    basic information is also lost.【C是主键,存在实体性约束】
  • Hard to update: because of redundancy, it is hard to
    keep consistency when update.【比如一个学生选了50门课,那么它的基本信息没有必到地存了50次,这个更新带来了麻烦】

Resolving:
According to the rule of “one fact in one place”【一事一地的原则】 to decompose the relation into 2 new relations:
S(S#, SNAME, AGE, ADDR)
SC(S#, C#, GRADE)

3NF

  1. R∈2NF
  2. no transfer function dependency exists between attributes.【属性对主键没有传递依赖】

EMP(EMP#, SAL_LEVEL, SALARY)
--- non 3NF

【SALARY依赖于SAL_LEVEL,SALE_LEVEL依赖于EMP】

Problems of non 3NF

  • Insert abnormity: before the employees’s sal_level are
    decided, the correspondence between sal_level and
    salary can not input.
  • Delete abnormity: if some sal_level has only one man,
    the correspondence between sal_level and salary of
    this level will be lost when the man is deleted.
  • Hard to update: because of redundancy, it is hard to
    keep consistency when update.【SALE_LEVEL和SALE只需要知道一个,冗余了】

Resolving:
According to the rule of “one fact in one place” to
decompose the relation into 2 new relations:
EMP(EMP#,SAL_LEVEL)
SAL(SAL_LEVEL,SALARY

Summary

图57.png

一般到3NF即可,必要时会根据实际情况逆范式。基本原则是“一事一地”

ER Model and ER Diagram

d66997d5-4ee4-47e4-9188-e0c4076f2ee7

Database Design Method

  • Procedure oriented method[类似于面向过程]
    This method takes business procedures as center, the database
    schema is designed basically in accordance directly with the
    vouchers, receipts, reports, etc. in business. Because of no
    detailed analysis on data and inner relationships between data,
    although it is fast at the beginning of the project, it is hard to
    ensure software quality and the system will be hard to fit future
    changes in requirement and environment. So this method is not
    suitable for the development of a large, complex system.
  • Data oriented method[类似于面向对象]
    This method design the database schema based on the detailed
    analysis on data and inner relationships between data which are
    involved in business procedures. It takes data as center, not
    procedures. It can not only fulfill the current requirements, but
    also some potential requirements. It is liable to fit future changes
    in requirement and environment. It is recommended in the
    development of large, complex systems

41bff2f5-310b-4b5a-acf8-ba44caba3c67

Requirement Analysis:定义数据字典,DFD(数据流图)

Concept Desing:画出ER图,与具体的DBMS无关

Logic Design:将er图转换为具体的表

Physical Design:物理实现

Requirement Analysis

A very important part of system requirement analysis. In requirement analysis phase, the data dictionary and DFD (or UML) diagrams are the most important to database design.

Dictionary and DFD

  • Name confilicts

    ➢ Homonym(the same name with different meanings)
    ➢ Synonym(the same meaning in different names)

  • Concpet confilicts

    dept在一个表中是一个属性,在另一个表中是一个实体

  • Domain conflicts

    性别的取值:男女,0,1,MW

About coding
➢ Standardization of information
➢ Identifying entities
➢ Compressing【压缩】 information

Through requirement analysis, all information must be with unique source and unique responsibility

Concept Design

70ad78cf-404a-4a0a-bd02-e567309d6555

Logic Design

从此处开始都是技术活儿了,与甲方无关了

denormalization:逆范式

denormalization:逆范式

Physical Design

227da5cb-f412-4f8c-96d4-59915334a29e

Summary

本质:原子数据

本质:原子数据

https://www.bilibili.com/video/BV1Xt4y1L7S1/?spm_id_from=333.1007.tianma.1-1-1.click

相关新闻

  • 东南大学数据库课程07-Distributed Database Systems
  • Xdebug安装与PhpStorm调试配置
  • 快速搞定Dify+Chrome MCP:打造能操作网页的AI助手

最新新闻

  • 2026 年 6 月西安雁塔区黄金回收耀辉门店指南:行业避坑与渠道甄选全攻略 - 奢侈品回收
  • 从微分到积分:Fourier变换的微积分性质对偶关系解析
  • AI辅助决策在一线管理中的落地实践
  • 对比7种视频去水印工具,哪个最省心 - 软件工具教程方法
  • 技术深度解析:微信聊天记录本地化解析与结构化数据导出完整解决方案
  • 电瓶车跨省托运2026全流程 新手3分钟避坑指南 - 快递物流资讯

日新闻

  • 5分钟掌握Python进化算法:Geatpy高性能优化工具完全指南
  • Microchip 24AA044 EEPROM选型与应用全指南:从参数解析到实战编程
  • 华为的鸿蒙到底有多牛?为什么称作遥遥领先?

周新闻

  • 3步解锁iOS设备:applera1n激活锁绕过完全指南
  • 39 2026 人工智能证书终极盘点,普通人选 AI 证书可以从这些方向入手
  • Redis 暴露公网有多危险?从端口检查到补救步骤

月新闻

  • 【总结】入门篇:50句话让你记住架构核心概念
  • WeChatMsg技术方案解析:实现Mac微信数据自主管理的完整解决方案
  • WeChatMsg:革新性微信数据备份方案,打造你的专属数字记忆库

关于尧图

  • 公司简介
  • 团队介绍
  • 企业文化
  • 荣誉资质

服务项目

  • 定制开发
  • 电商建站
  • UI 设计
  • 运维服务

快速链接

  • 案例展示
  • 建站流程
  • 常见问题
  • 资讯中心

联系方式

  • 📍北京市朝阳区互联网产业园 A 座 10 层
  • 📞400-888-8888
  • ✉️contact@rkmt.cn
  • 🕐周一至周日 9:00-21:00

© 2024 北京尧图网络科技有限公司 版权所有 | 京 ICP 备 XXXXXXXX 号