Presentation is loading. Please wait.

Presentation is loading. Please wait.

Department of Computer Science and Engineering, HKUST Slide 1 Multivalue attribute: contains more than one value Employee Phone Email Employee Mobile PhoneHome.

Similar presentations


Presentation on theme: "Department of Computer Science and Engineering, HKUST Slide 1 Multivalue attribute: contains more than one value Employee Phone Email Employee Mobile PhoneHome."— Presentation transcript:

1 Department of Computer Science and Engineering, HKUST Slide 1 Multivalue attribute: contains more than one value Employee Phone Email Employee Mobile PhoneHome Phone Personal EmailBusiness Email Contrast with: What are the pros and cons in terms of flexibility and preciseness in meaning?

2 Department of Computer Science and Engineering, HKUST Slide 2 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)

3 Department of Computer Science and Engineering, HKUST Slide 3 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)

4 Department of Computer Science and Engineering, HKUST Slide 4 ISA (“is a”) Relationship +A university has both part-time and full-time students. They are largely the same but with some differences: Student takes Course Grade Student-No Name Course-No Title FT/PT Emp-Name Advisor +Problem: If only FT students have advisors and only PT students have employer names, there are lots of empty values in the database

5 Department of Computer Science and Engineering, HKUST Slide 5 Separating the Students takes Course Grade Course-No Title FT Student Student-No Name Advisor +Other problems are introduced +If a student changes from FT to PT, he will exist in both entities PT Student Student-No Name Emp-Name takes Grade

6 Department of Computer Science and Engineering, HKUST Slide 6 Introduce a new Relationship: ISA takes Course Grade Course-No Title Student Student-No Name +A PT student “IS-A” Student +A FT student “IS-A” Student +A Professor “IS-A” Student PT Student Emp-Name PT Student Advisor ISA


Download ppt "Department of Computer Science and Engineering, HKUST Slide 1 Multivalue attribute: contains more than one value Employee Phone Email Employee Mobile PhoneHome."

Similar presentations


Ads by Google