1
Roadmap for OO Design
- RDBMS principles
- Implementing OO models in RDBMS
– Normalization and good models
- More OO design
– polymorphism, enhancing inheritance
- Architecture
– Alternate Data management – External control – Reuse
What is a Relational Database?
GS Jones 301 WM Smith 256 KS French 123 ID Faculty Name Student ID Student
Database = collection of tables Table = collections of rows Row = set of attributes(fields)
attributes
Students
Domains and Keys
Each attribute defines a Domain: Set of values for attribute Student ID={x | x is a valid student ID} Student Name={x | x is a student name} Faculty ID={x | x is faculty ID initials} A Key is a is a set of attributes that identifies a row.
Key Nomenclature
Candidate Key: Uniquely identifies a row. Primary Key: a Candidate Key used for main access Foreign Key: An attribute from one table that is a Primary Key in another table.
Keys Example
4444
- 355
Izzo PHY 1234
- 432
Leheay CEP 1212
- 353
Rover EEC 1111
- 355
Stockman CSE Fax# Chair Dept 001
- 45
CEP Crewe C00 321
- 12
CSE Stirewalt S56 3200 EEC Potter P01 3100 CSE McUmber M21 Office Dept Name ID Prof
Foreign key Primary key Primary key
Note: referential integrity
Why is it called Relational?
Recall:
C B A R relation C B A C c B b A a c b a C B A C B A × × ⊆ × × ∈ ∈ ∈ = × × : product cross the
- f
subset a is A Product Cross a called is that such sets Given . . , ) , , ( , , ,
- The sets A,B,C are the domains (attribute values)
b c R c a R b a B c b A a B A R = ⇒ ∈ ∧ ∈ ∈ ∈ × ⊂ ) , ( ) , ( , , if function a is relation A Potter = ) 01 (P f name