Extended Operators ใน Relational Algebra
นอกจาก Basic Operators (Selection, Projection, Union, Set Difference, Cartesian Product, Rename) แล้ว มี Extended Operators 3 กลุ่มหลัก:
1. Intersection (∩)
คืน Tuple ที่ปรากฏใน ทั้งสอง Relation (R1 ∩ R2)
2. Join Operators
- Conditional Join (θ-Join): Join ตามเงื่อนไขเฉพาะ (เช่น R.A > S.B)
- Natural Join (⋈): Join อัตโนมัติบน Attribute ที่ชื่อเหมือนกันและค่าเท่ากัน
- Left Outer Join (⟕): รวม Tuple ทั้งหมดของ Left Relation และ Tuple ที่ match ของ Right (ไม่ match ใส่ NULL)
- Right Outer Join (⟖): ตรงข้าม Left Outer Join
- Full Outer Join (⟗): รวม Tuple ทั้งหมดจากทั้งสอง Relation (ไม่ match ใส่ NULL)
3. Division (÷)
ใช้สำหรับ Query แบบ "For All" (เช่น หานักเรียนที่เรียนวิชาทุกวิชา)
เงื่อนไข: Attribute ของ Divisor (B) ต้องเป็น Subset ของ Dividend (A)
ผลลัพธ์มี Attribute = Attributes(A) - Attributes(B)
สรุป
Extended Operators ช่วยให้เขียน Query ที่ซับซ้อนได้สะดวกขึ้น โดยเฉพาะ Join และ Division ที่ใช้บ่อยในระบบฐานข้อมูล