50 likes | 196 Views
Primary key and foreign key relationships. IST359 M005. Yang Wang ywang@syr.edu 342 Hinds http://blackboard.syr.edu. Cardinality. 1-1 relationship 1-many relationship Many-many relationship. 1-1 relationship. Students table student_id (primary key) student_ssn (foreign key)
E N D
Primary key and foreign key relationships IST359 M005 Yang Wang ywang@syr.edu 342 Hinds http://blackboard.syr.edu
Cardinality • 1-1 relationship • 1-many relationship • Many-many relationship
1-1 relationship • Students table • student_id (primary key) • student_ssn (foreign key) • SSNs table • ssn (primary key) Students (student_ssn) references to SSNs (ssn) 1 student has only 1 SSN
Many-many relationship This M-M Relationship has been resolved into two 1-M relationships