Use SQL:2003 with the MULTISET construct to represent a bank database with UDTs for Account and Customer. The list of attributes should be short, but reasonable for this problem. Formulate the following query:
Find all customers whose combined balances in all accounts is 500000 or more.
Solution:
CREATE TABLE Customer (
Id CHAR(10),
Name CHAR(20),
Accounts Ref( AccountType) MULTISET SCOPE Account
)
CREATE TABLE Account OF AccountType
CREATE TYPE AccountType (
Id INTEGER,
Balance INTEGER
)
SELECT C.Name
FROM Customer C
GROUP BY C.Id
HAVING SUM(C->Accounts.Balance) >= 500000
You might also like to view...
The definition of PII:
a. Is name, date of birth, and home address b. Is name, date of birth, home address, and home telephone number c. Is name, date of birth, and social insurance number d. Varies by jurisdiction and regulation
When an array is sorted from highest to lowest, it is said to be in
a. reverse order b. forward order c. ascending order d. descending order e. None of these
The _____________ manager is the simplest layout manager. It arranges components one after the other, going from left to right, in the order in which you add them.
(a) BorderLayout (b) FlowLayout (c) GridLayout (d) AbsoluteLayout
Design an experiment for a paged system to demonstrate the phenomena of temporal and spatial locality.
What will be an ideal response?