Download presentation
Presentation is loading. Please wait.
1
Introduction to Relational Database ISYS 464
2
Introduction to Relational Model Data is logically structured within relations. Each relation is a table (file) with named columns (attributes, fields) and rows (records). –Fixed format, structured data
3
Properties of a Relation Simple attribute –No composite, no multivalued attribute Each relation must have a primary key: –Simple or composite key –May have other keys (candidate keys) –Key cannot be null –Cannot be duplicated
4
Integrity Constraints Domain constraints Entity integrity: –Primary key cannot be null, cannot be duplicated Referential integrity Other constraints
5
Relational Database Design Strong entity: Create a table that includes all simple attributes –Composite Weak entity: add owner primary key Multi-valued attribute: Create a table for each multi- valued attribute –Key + attribute Relationship: –1:1, 1:M Relationship table: for partial participation to avoid null values Foreign key –M:M: relationship table –N-ary relationship: relationship table –Recursive relationship Attribute of relationship Superclass and subclass
6
Online Shopping Cart Customer ShoppingCart Product Has 1 M M M CID Cname EmailAddr CartIDDate Qty PID Pname Price
7
Recursive Relationship Note: Partial participation
8
Strong/Weak Entities Employee: EmployeeID, Employee_Name EmpDependent: EmployeeID, First_Name, Middle_Initial, LastName, Date_of_Birth
9
Ternary Relationship
10
Superclass/Subclass
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.