In: Computer Science
How to determine what type of attribute the following attributes are in an Entity-Relationship Model? I just want to know if each of these can be considered as a composite attribute, a multi-valued attribute or neither:
Suppose we have:
1. Name : A person's full name
2. Address : A residential address
3. Account Balance : A bank account balance
4. Monthly fees: Monthly fees associated with a chequing account, which are unique to each account holder
5. Minimum Balance: The minimum balance needed to maintain a chequing account, which is unique to each account holder
6. Interest Rate: Interest rate associated with a savings account that changes over time.
7. Loan Payment Amount: Amount paid towards a loan.
8. Date-Time: YYYY-MM-DD HH-MI-SS
9. Type of Transaction: Deposit or withdrawl from an account
10. Date of Birth: A person's date of birth
11. Date-Time: YYYY-MM-DD HH-MI-SS
12. Service Details: Details regarding the services a bank has provided for a customer
Solution:
Composite attributes are made up of more than one simple attribute. For example, if the attribute is Name, then it may have first name and last name.
Multi valued attributes are the attributes that may contain more than one values. For example, a person can have more than one phone no. or email id.
1. Name - Composite Attribute
2. Address - Composite Attribute, as it can have Block number, House number, City Name and Pin code
3. Account Balance - Multivalued as a person can have more than one account for which he might have different balances for each account.
4. Monthly fees - Multivalued, as it is unique to every chequing amount and a person can have more than one chequing account
5. Minimum Balance - Multivalued as a person can have more than one account for which he might have different minimum balances for each account.
6. Interest Rate - Multivalued as a person can have more tha one savings account and for each of the sangs account he will have different interest rates.
7. Loan Payment - Multivalued, as for different accounts a person might have taken different loans.
8. Date-Time - Composite Attribute, as it has different components such as Year, Month, Date, Hours, Minutes and Seconds
9. Type of Transaction - Composite attribute, as it can be either deposit or withdrawal.
10. Date of Birth - Composite Attribute, as it has different components Year, Month and Date.
11. Date-Time - Composite Attribute, as it has different components such as Year, Month, Date, Hours, Minutes and Seconds
12. Service Details - Multivalued attribute, as details regarding the sevices a bank has provided for a customer will be different.