SlideShare a Scribd company logo
1 of 32
第五讲 关系数据库设计理论 本讲主要介绍数据库的设计理论和方法,以解决如下问题:给定一批需要在数据库中管理的数据,如何设计出存放这批数据的关系,使得数据库管理系统能够方便高效地管理这批数据,同时易于被用户使用。
引例 ,[object Object],[object Object],[object Object],[object Object],[object Object]
学生关系 … … … … … … … … … 67 会计 20 理财 01 20 女 陈百 100 理财 理财 … 理财 理财 专业名称 李二 张一 … 张一 张一 姓名 85 计算机 01 01 19 男 2 91 会计 20 01 20 男 1 … … … … … … … 78 英语 02 01 20 男 1 80 计算机 01 01 20 男 1 成绩 课程名称 课程编号 专业编号 年龄 性别 学号
对学生关系的分析 … … … … … … … … … 67 会计 20 理财 01 20 女 陈百 100 理财 理财 … 理财 理财 专业名称 李二 张一 … 张一 张一 姓名 85 计算机 01 01 19 男 2 91 会计 20 01 20 男 1 … … … … … … … 78 英语 02 01 20 男 1 80 计算机 01 01 20 男 1 成绩 课程名称 课程编号 专业编号 年龄 性别 学号
问题 … … … … … … … … … 67 会计 20 理财 01 20 女 陈百 100 理财 理财 … 理财 理财 专业名称 李二 张一 … 张一 张一 姓名 85 计算机 01 01 19 男 2 91 会计 20 01 20 男 1 … … … … … … … 78 英语 02 01 20 男 1 80 计算机 01 01 20 男 1 成绩 课程名称 课程编号 专业编号 年龄 性别 学号 冗余度大 插入异常 删除异常
问题产生的原因 ,[object Object],[object Object]
函数依赖 ,[object Object],[object Object],[object Object]
平凡函数依赖与非平凡函数依赖 ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object]
函数依赖的类型 ,[object Object],[object Object],[object Object],[object Object],t f p
[object Object],[object Object]
码、主属性与非主属性 ,[object Object],[object Object],[object Object],f
[object Object],[object Object]
范式 ,[object Object],[object Object]
规范化 ,[object Object],低级范式的关系模式 关系模式 1 关系模式 k 高级范式 规范化
函数依赖范畴中的范式 ,[object Object],[object Object],[object Object],85 物理 c3 80 数学 c2 … .. … … … 英语 课程名 90 分数 课程号 c1 成绩 张山 姓名 s1 学号
第二范式 (2NF) ,[object Object],[object Object],[object Object],[object Object]
第三范式 (3NF) ,[object Object],[object Object],[object Object],[object Object]
BC 范式 (BCNF) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
关系的规范化 ,[object Object],[object Object],[object Object],[object Object],[object Object],投影 破坏非主属性对码的部分函数依赖 不丢失属性 维持原有数据间的关系
关系的规范化 ,[object Object],[object Object],[object Object],[object Object],投影 破坏非主属性对码的传递函数依赖 不丢失属性 维持原有数据间的关系
关系的规范化 ,[object Object],[object Object],[object Object],[object Object],投影 确保每一个函数依赖的决定因素中含有码 不丢失属性 维持原有数据间的关系
多值依赖引例 ,[object Object],请思考:该关系属于第几范式?它的码是什么?该关系完美吗? … … … 高等数学 高等代数 微分方程 高平 王行军 数学 普通物理学 力学原理 物理学试验 参考书 B 李明 刘华 教师 T 物理 课程 C
多值依赖引例 ,[object Object],X Z Y 本关系的码是全码,属 BCNF ,存在数据冗余,修改复杂等诸多问题! … … … 高等数学 高等代数 微分方程 高平 王行军 数学 普通物理学 力学原理 物理学试验 参考书 B 李明 刘华 教师 T 物理 课程 C
多值依赖的定义 ,[object Object]
多值依赖的性质 ,[object Object],[object Object],[object Object],[object Object],[object Object]
第四范式( 4NF ) ,[object Object],[object Object],[object Object]
解决方法 ,[object Object],CT( 课程,教师 ) CB( 课程,参考书 ) 投影 消去非平凡且非函数依赖的多值依赖 不丢失属性 维持原有数据间的关系
模式设计的方法学 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
关系模式分解的标准 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
分解标准(续) ,[object Object],[object Object],[object Object]
模式分解的标准与范式的关系 ,[object Object],[object Object],[object Object],[object Object]

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

香港六合彩