Entity-Relationship Diagram
Entity-Relationship Diagram (1/3) E-R Diagram Symbols Entity Set Relationship 1 N Attribute Functionality
Entity-Relationship Diagram (2/3) E-R Diagram Symbols (Cont’d) 1 Married-to (Monogamy) Men 1 Women One-to-one relationship 1 Advised-by Faculty N Students One-to-many relationship N Taken-by N Students Courses Many-to-many relationship
Entity-Relationship Diagram (3/3) Example F# S# Advised-by Faculty 1 N Students FName SName 1 N Taught-by Taken-by N N Courses C# CName
Composition by eliminating one-to-many relationship relations Relational Schema Universal Relation decomposition Composition by eliminating one-to-many relationship relations Faculty (F#, FName) Students (S#, SName) Courses (C#, CName) Advised-by (F#, S#) Taken-by (S#, C#) Taught-by (F#, C#) Faculty (F#, FName) Students (S#, SName, F#) Courses (C#, CName, F#) Taken-by (S#, C#)
Queries List the all the names of the students who are taking the classes that Prof. Suh, Euiho is teaching List the all the names of the students who are advised by the professors who are teaching the classes taken by Hong, gildong
2. Revise the relational schema April Exam Questions Suppose that (1) Adviser-Advisee relationship’s functionality is many-to-many, and (2) A specific place is assigned when a professor meet his/her advisee. In another word, the meeting place depends upon the unique combination of a professor and a student. 1. Revise the E-R 2. Revise the relational schema 3. Relational algebraic expression for a query (The query will be given in the exam)