Dr Derek Peacock14/08/20151 Database Design 1:1 Relationships Dr Derek Peacock
14/08/20152 Entity: Tutor l Nat Ins No l Surname l First Name l Initials l Gender l Job Title l Department l Date of Birth l Office Phone No l Lab Phone No l Home Phone No l Address l Fax No l Date Appointed
Dr Derek Peacock14/08/20153 Relevance l Not all attributes are relevant to the application (e.g. Height) l Not all attributes are important for deciding the appropriate design l Not all relevant attributes might have been identified yet
Dr Derek Peacock14/08/20154 Skeleton Tables Tutor (Nat Ins No, Surname, Department…..)
Dr Derek Peacock14/08/20155 Entity: Student l Enrolment No l Surname l First Name l Initials l Gender l Qualification l Date of Birth l Home Address l Term Address
Dr Derek Peacock14/08/20156 Student Table Student (Enrolment No, Surname, Qualification…..)
Dr Derek Peacock14/08/ :1 Relationships Student Tutee of Tutor Each student must have one personal tutor Each tutor must have one tutee
Dr Derek Peacock14/08/20158 Posted Key (Tutors) Tutor TableStudent Table
Dr Derek Peacock14/08/20159 Posted Key (Is Tutored By) Student TableTutor Table
Dr Derek Peacock14/08/ :1 Relationships Student Tutee of Tutor Each student must have one personal tutor A tutor may have one tutee
Dr Derek Peacock14/08/ Tutor May Have (non obligatory) Tutor TableStudent Table
Dr Derek Peacock14/08/ Student Must Have..(obligatory) Student TableTutor Table
Dr Derek Peacock14/08/ :1 Relationships Student Tutee of Tutor A student may have one personal tutor A tutor may have one tutee
Dr Derek Peacock14/08/ Is Tutored By
Dr Derek Peacock14/08/ :1 Non Obligatory Relationship Student (Stud ID, Name, Address…) Tutor (Tutor ID, Name, Address…) Is Tutored by (Stud ID, Tutor ID)
Dr Derek Peacock14/08/ Recursive Relationships Person Married to A male person may be married to a female person A female person may be married to a male person
Dr Derek Peacock14/08/ Recursive Relationship (Tables) Person (Person ID, Gender, Name …) Married To (Male ID,Female ID)
Dr Derek Peacock14/08/ Sample Question A firm assigns a car to each member of staff who are currently part of the sales team. Other staff are not assigned a company car. All company cars will be assigned to a member of staff. Suggest a suitable database design to keep track of the assignment of cars to staff