Multivalue attribute contains more than one value Phone
• Multivalue attribute: contains more than one value Phone Employee Email Contrast with: Home Phone Mobile Phone Employee What are the pros and cons in terms of flexibility and preciseness in meaning? Personal Email Business Email Department of Computer Science and Engineering, HKUST Slide 1
Take Home Messages from the Customer. Depositor-Account Example • The exact meaning of a word may be ambiguous – What does “Amount” mean? – What does “Name” (of Customer and Account) mean? Are they the same? • Whether to put an attribute to an entity or a relationship is not easy to determine – In the example, we try to argue that if “Amount” represents the deposit amount of EACH transaction, it should be associated with the relationship, because • “Amount” is a property of the “deposit” action which is represented by the relationship between customer and account • If we associate the “Amount” of each deposit to the account or to the customer, then multi-value attributes must be used, which is discouraged (you would know why when we study the relational data model) Department of Computer Science and Engineering, HKUST Slide 2
Take Home Messages from the Customer. Depositor-Account Example – We further argue that if “Amount” is the balance of an account, there is always only one single balance for an account. It should be a property of account, not a property of the act of “depositing” money (though the act changes the balance) Department of Computer Science and Engineering, HKUST Slide 3
ISA (“is a”) Relationship + A university has both part-time and full-time students. They are largely the same but with some differences: Student-No Name Course-No Title Grade Advisor Student Course takes FT/PT Emp-Name + Problem: If only FT students have advisors and only PT students have employer names, there are lots of empty values in the database Department of Computer Science and Engineering, HKUST Slide 4
Separating the Students Student-No Name Course-No Title Grade Advisor FT Student Course takes Student-No Name takes PT Student Emp-Name Grade + Other problems are introduced + If a student changes from FT to PT, he will exist in both entities Department of Computer Science and Engineering, HKUST Slide 5
Introduce a new Relationship: ISA Name Student-No Course-No Title Grade Student Course takes ISA PT Student Emp-Name PT Student Advisor + A PT student “IS-A” Student + A FT student “IS-A” Student + A Professor “IS-A” Student Department of Computer Science and Engineering, HKUST Slide 6
- Slides: 6