Consider an Account class and a TransactionActivity class in a banking system.

a. Posit ODMG ODL class de?nitions for them. The Account class must include a relationship to the set of objects in the TransactionActivity class corresponding to the deposit and withdraw transactions executed against that account.
b. Give an example of a database instance satisfying that description.
c. Write an OQL query against that database that will return the account numbers of all accounts for which there was at least one withdrawal of more than $10,000.


a.


class Account {
attribute Integer AcctId;
relationship Set Owner;
relationship Set Transactions
inverse TransactionActivity::ActivityAccount;
}

class TransactionActivity {
attribute enum TransType {deposit,withdraw} Type;
attribute Float Amount;
attribute Date ActivityDate;
relationship Account ActivityAccount
inverse Account::Transactions;
}


Note that Transactions and ActivityAccount are declared to be inverses of each other. This means that if ta is a transaction activity and ac is an account such that ta ? ac.Transactions then ac = ta.ActivityAccount,andviceversa, if ac = ta.ActivityAccount then ta ? ac.Transactions.

b. An account:

(#123, [12345,
{#p4345, #p0987},
{#t435, #t8132}
])
...


Some transactions:

(#t435, [withdraw, 58.34, 2001-3-4, #123])
(#t8132, [deposit, 231.99, 2001-4-5, #123])


c.

SELECT A.AcctId
FROM AccountExt A, A.Transactions T
WHERE T.Type = withdraw AND T.Amount > 10000

Computer Science & Information Technology

You might also like to view...

A report allows you to enter, edit, and delete data

Indicate whether the statement is true or false

Computer Science & Information Technology

A SmartArt graphic and its shapes are deselected by clicking the document text

Indicate whether the statement is true or false

Computer Science & Information Technology

Describe how to move and copy text using drag and drop.

What will be an ideal response?

Computer Science & Information Technology

String firstString = "Oak Maple Pine" String secondString = "spruce Maple elm" ? firstCompare.regionMatches(4, secondString, 7, 5) ? Using the above code, what will be the Boolean value after execution of the regionMatches statement? Explain how the Strings are compared using the regionMatches() method.

What will be an ideal response?

Computer Science & Information Technology