200 likes | 371 Views
DBST 652 – lecture 2 . Lecture 2. DBST 652. Next slide reflects math set theory that is basis of relational databases. Entity Types and Member Entities. Elmasri, p. 66. “Car” Entity Type. { } - Multi-valued Attributes ( ) - Composite Attributes. Elmasri, p. 67.
E N D
DBST 652 – lecture 2 Lecture 2
DBST 652 • Next slide reflects math set theory that is basis of relational databases
Entity Types and Member Entities Elmasri, p. 66
“Car” Entity Type { } - Multi-valued Attributes ( ) - Composite Attributes Elmasri, p. 67
Multivalued Composite Attribute - “AddressPhone” {AddressPhone( {Phone(AreaCode,PhoneNumber)}, Address(StreetAddress(Number,Street,ApartmentNumber), City,State,Zip) ) Elmasri, p.65
Preliminary Design of Entity Types for Company Database DEPARTMENT Name, Number, {Locations}, Manager, ManagerStartDate PROJECT Name, Number, Location, ControllingDepartment EMPLOYEE Name (FName, MInit, LName), SSN, Sex, Address, Salary, BirthDate, Department, Supervisor, {WorksOn (Project, Hours)} DEPENDENT Employee, DependentName, Sex, BirthDate, Relationship Elmasri, p. 69
Look at book • As we step through next slides, keep book open to p. 62
Instances of the WORKS_FOR Relationship Elmasri, p. 71
Recursive Relationship - SUPERVISION Elmasri, p. 73
1:1 Relationship - MANAGES Elmasri, p. 74
M:N Relationship - WORKS_ON Elmasri, p. 75
ER Diagram Notation (1) Meaning Symbol Elmasri, p. 80
ER Diagram Notation (2) Meaning Symbol Elmasri, p.80
ER Diagram Notation Symbol Meaning R E1 E2 1 N R E2 E1 R E Elmasri, p. 80
DBST 652 • Confused by participation • Does it work if total participation means “mandatory” and partial participation means “optional”? I think it does. • Mandatory requires at least one. • Optional allows zero rows.
Look at p. 54 again • Look at ERD now - apply previous slides and be sure we understand notation • so…go to next slide and walk thru • confirm - if need be - p. 245
ER Schema Diagram for COMPANY Database Elmasri, p.62
Another way • Slight difference in notation - look at differences on next slide • But…says the same thing. That is, it is the same data model
ER Diagram for COMPANY Schema Elmasri, p.83