SlideShare a Scribd company logo
1 of 24
ฐฐาานขข้้อมมูลูลเเชชิงิงสสัมัมพพัันธธ์์ 
RReellaattiioonnaall DDaattaabbaassee
ศศัพัพทท์์เเททคนนิคิค 
ศัพท์เทคนิค ศัพท์ทั่วไป 
•รีเลชั่น (Relation) ตาราง (Table) 
•ทูเพลิ (Tuple) แถว (Row) หรือ 
Reccord 
•แอททริบวิต์ (Attribute) คอลัมน์ 
(Column), Field 
•คาร์ดินาลิตี้ (Cardinality) จำานวนแถว 
(Number of Rows) 
•คยี์หลัก (Primary Key) ค่าเอกลักษณ์
ความหมมาายของฐฐาานขข้้อมมูลูลเเชชิิง 
สสัมัมพพันันธธ์์ 
เป็นการจัดเก็บรวบรวมข้อมูลเป็นแถว 
และคอลัมน์ในลักษณะตารางสองมิติ ที่ 
ประกอบไปด้วย Attribute ที่แสดง 
คุณสมบัติของ Relation หนึ่งๆ 
โดย Relation ต่างๆ ได้ผ่าน 
กระบวนการทำาให้ Relation เป็น 
บรรทัดฐาน (Normalized) ในระหว่าง 
การออกแบบเพอื่ลดความซำ้าซ้อน และเพอื่ 
ให้การจัดการฐานข้อมูลเป็นไปอบ่างมี
ขข้้อดดีีของฐฐาานขข้อ้อมมูลูลเเชชิิง 
สสัมัมพพันันธธ์์ 
1. ผู้ใช้งานเห็นภาพของข้อมูลได้ง่าย 
2. ผู้ใช้ไม่ต้องรู้ว่าข้อมูลจัดเก็บจริง 
อย่างไร รวมถึงการเข้าถึง 
วิธีการเรียกใช้ข้อมูล 
3. ภาษาที่ใชใ้นการเรียกดูข้อมูล มี 
ลักษณะคล้ายภาษาอังกฤษ 
และไม่จำาเป็นต้องเขียนเป็นลำาดับขั้น 
ตอน 
4. การเรียกใช้หรือเชื่อมโยงข้อมูลทำาได้
คคุุณลลัักษณณะะใในนกกาารจจักักเเกก็บ็บ 
ขข้้อมมูลูลของรรีีเเลลชชั่นั่น 
1. ข้อมูลในแต่ละแถวจะไม่ซำ้ากัน
คคุุณลลัักษณณะะใในนกกาารจจักักเเกก็บ็บ 
ขข้้อมมูลูลของรรีีเเลลชชั่นั่น 
2. การเรียงลำาดับของข้อมูลในแต่ละแถว 
ไม่เป็นสาระสำาคัญ
คคุุณลลัักษณณะะใในนกกาารจจักักเเกก็บ็บ 
ขข้้อมมูลูลของรรีีเเลลชชั่นั่น 
3. การเรียงลำาดับของ Attribute จะเรียง 
ลำาดับก่อนหลังอย่างไรก็ได้
คคุุณลลัักษณณะะใในนกกาารจจักักเเกก็บ็บ 
ขข้้อมมูลูลของรรีีเเลลชชั่นั่น 
4. ค่าของข้อมูลในแต่ละ Attribute ของ 
Tuple หนึ่งๆ จะบรรจุ 
ข้อมูลได้เพียงค่าเดียว (Single Value)
คคุุณลลัักษณณะะใในนกกาารจจักักเเกก็บ็บ 
ขข้้อมมูลูลของรรีีเเลลชชั่นั่น 
5. คา่ของข้อมูลในแต่ละ Attribute จะ 
บรรจุค่าของข้อมูล 
ประเภทเดียวกัน
ปรระะเเภภทของคคีียย์์ 
11.. คคียีย์์หลลััก ((PPrriimmaarryy KKeeyy)) 
เป็น Attribute ที่มีคุณสมบัติของ 
ข้อมูลที่มีคา่เป็นเอกลักษณ์ หรือไม่มีค่าซำ้า 
กัน 
โดยคุณสมบัตินั้นจะสามารถระบุว่า 
ข้อมูลนั้นเป็นของ Tuple ใด
ปรระะเเภภทของคคีียย์์ 
เป็น Attribute ที่มีคณุสมบัติเปน็คยี์ 
หลักอาจจะประกอบด้วยหลาย Attribute 
รวมกันเรียกว่า คคียีย์์ผสม ((CCoommppoossiittee 
KKeeyy))
ปรระะเเภภทของคคีียย์์ 
นอกจากนี้… ในแต่ละ Relation 
อาจมี Attribute ที่ทำาหน้าที่เป็นคยี์หลักได้ 
มากกว่าหนึ่ง Attribute โดยเรียก 
Attribute เหล่านี้ว่า คคีียย์์คคู่แู่แขข่ง่ง 
((CCaannddiiddaattee KKeeyy)) 
และถ้า Attribute หนึ่งถูกกำาหนด 
เป็นคยี์หลัก โดยมีอีก Attribute หนึ่งที่มี 
คุณสมบัติเปน็คยี์หลัก แต่ไมถู่กเลือกเปน็คยี์ 
หลัก จะเรียกว่า คคีียย์์สสำาำารอง ((AAlltteerrnnaattee
ปรระะเเภภทของคคีียย์์ 
22.. คคียีย์์นอก ((FFoorreeiiggnn KKeeyy)) 
เป็น Attribute ใน Relation ที่ใช้ 
ในการอ้างถึง Attribute เดียวกันในอีก 
Relation หนึ่ง โดยที่ Attribute นี้มี 
คุณสมบัติเปน็คยี์หลัก การมี Attribute 
นี้ปรากฎอยู่ใน Relation ทั้งสองก็เพื่อ 
ประโยชน์ในการเชื่อมโยงข้อมูลซึ่งกันและ 
กัน
กฎเเกกยี่วขข้้องกกับับคคีียย์ใ์ในนฐฐาาน 
ขข้้อมมููลเเชชิิงสสัมัมพพันันธธ์์ 
11.. กฎกกาารบบููรณภภาาพของเเออนตติติตีี้้ ((TThhee 
EEnnttiittyy IInntteeggrriittyy RRuullee)) 
Attribute ใดที่เปน็คยี์หลัก ข้อมูล 
ใน Attribute นั้นจะต้องมีค่าเป็น 
เอกลักษณ์ (Unique) และเปน็คา่ว่าง 
(Null) ไม่ได้
กฎเเกกยี่วขข้้องกกับับคคีียย์ใ์ในนฐฐาาน 
ขข้้อมมููลเเชชิิงสสัมัมพพันันธธ์์ 
22.. กฎกกาารบบููรณภภาาพของกกาารออ้า้างออิงิง 
((TThhee RReeffeerreennttiiaall IInntteeggrriittyy 
RRuullee)) 
2.1 การลบหรือแก้ไขข้อมูลแบบมีข้อ 
จำากัด (Restrict) 
2.2 การลบหรือแก้ไขข้อมูลแบบต่อเรียง 
(Cascade) 
2.3 การลบหรือแก้ไขข้อมูลโดยเปลี่ยน 
เป็นคา่ว่าง (Nullify)
ปรระะเเภภทของรรีีเเลลชชั่นั่น 
11.. รรีีเเลลชชั่นั่นหลลักัก ((BBaassee RReellaattiioonn)) 
Relation ที่ถูกกำำหนดขึ้นเพื่อเก็บ 
ข้อมูลเพื่อนำำไปใช้ 
โดย Base Relation จะเป็น relation ที่ 
เก็บข้อมูลอยู่จริง
ปรระะเเภภทของรรีีเเลลชชั่นั่น 
22.. ววิวิว ((VViieeww)) 
Relation ที่ถูกสร้ำงขึ้นตำมควำม 
ต้องกำรของผู้ใช้งำนแต่ล่ะคน โดยจะ 
กำำหนด view ของตนขึ้นมำจำกรีเลชั่น 
หลัก
Virtual Table Or Derived Table
ผู้จัดทำำ 
1. นำย พิศษิฐ ์ อัจฉรยิหิรัญชัย 
เลขที่ 6 
2. นำย สฤษฏ์พนธ์ สุโนภกัดิ์ 
เลขที่ 7 
3. นำย นิธินันท์ วิมลพันธ์ เลข 
ที่10 
4. นำย เอกพล ปุณณะกำรี เลขที่ 
11 
5. นำงสำว อรนุช เวียงสมุด เลข 
ที่ 23 
ชั้น ม. 6/4

More Related Content

Featured

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
ThinkNow
 
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
Kurio // The Social Media Age(ncy)
 

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...
 

Db chapter3