The National Bank of Erehwon handles money and maintains bank accounts on behalf of clients. A client is a person who does business with the bank. A client may have any number of accounts, and an account may belong to multiple clients (e.g., spouses, business partners). The client record is used for identification and contact data. For each account, the bank maintains the current balance on hand. Clients are identified by a five digit number starting with 10001. Accounts are identified by a seven digit number starting with 1000001.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter14: Introduction To Swing Components
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

The National Bank of Erehwon handles money and maintains bank accounts on behalf of clients.

  • A client is a person who does business with the bank.

  • A client may have any number of accounts, and an account may belong to multiple clients (e.g., spouses, business partners).

  • The client record is used for identification and contact data.

  • For each account, the bank maintains the current balance on hand.

  • Clients are identified by a five digit number starting with 10001.

  • Accounts are identified by a seven digit number starting with 1000001.

When an account is first opened, its balance is set to zero. During the course of day-to-day business, Erehwon Bank applies transactions to accounts, including deposits, withdrawals, bill payments, and debit purchases or returns. For each transaction, the date and time, amount, and account are recorded, along with reference data applicable to that type of transaction:

  • Deposits and withdrawals require the branch number to be recorded.

  • Bill payments, and debit purchases or returns require the merchant number.

Code the PL/SQL module for each of the following:

  • Trigger to enforce the referential integrity for the Transaction Ref_Nbr: 

    • Deposit or Withdrawal transaction to Bank Branch

    • Bill Payment, Debit Purchase, or Return transaction to Merchant

  • Trigger to update the Account balance for each new transaction entered (assume that a transaction will never be updated or deleted). 
  • A procedure that displays a nicely formatted audit statement for a given account number (as a parameter). This will show each transaction in date / time sequence along with the running balance. 

DATABASE INFO BELOW AND ATTACHED

TX_TYPE      
Code Description    
D Deposit    
W Withdrawal    
B Bill Payment    
P Purchase    
R Return    
       
       
BRANCH      
Nbr Name    
101 … make up your own name  
102 … make up your own name  
103 … make up your own name  
104 … make up your own name  
       
       
MERCHANT      
Nbr Name    
301 … make up your own name  
302 … make up your own name  
303 … make up your own name  
304 … make up your own name  
CLIENT
ClientNbr FName
LName
Street
10001... your own names goes here
10002 ... make up other names, etc.
10003 ... make up other names, etc.
10004 ... make up other names, etc.
10005 ... make up other names, etc.
10006 ... make up other names, etc.
ACCOUNT
AccountNbr Balance
1000001
1000002
1000003
1000004
1000005
1000006
0
0
0
0
0
0
OWNS
ClientNbr AccountNbr
10002
10003
10003
10004
10004
10005
10005
10006
10007
1000001
1000002
1000003
1000002
1000003
1000004
1000005
1000006
1000001
City
Notes
owner 10002
owner 10003, 10004
owner 10003, 10004
owner 10005
owner 10005
owner 10006
Notes
1st shared account
2nd shared account
1st shared account
2nd shared account
1st account
2nd account
Prov
PostCd Phone Email
ERROR join non-existing client to account
Notes
No account
Single account
Share accounts with 10004
Share accounts with 10003
Two accounts
Single account but no transactions
Transcribed Image Text:CLIENT ClientNbr FName LName Street 10001... your own names goes here 10002 ... make up other names, etc. 10003 ... make up other names, etc. 10004 ... make up other names, etc. 10005 ... make up other names, etc. 10006 ... make up other names, etc. ACCOUNT AccountNbr Balance 1000001 1000002 1000003 1000004 1000005 1000006 0 0 0 0 0 0 OWNS ClientNbr AccountNbr 10002 10003 10003 10004 10004 10005 10005 10006 10007 1000001 1000002 1000003 1000002 1000003 1000004 1000005 1000006 1000001 City Notes owner 10002 owner 10003, 10004 owner 10003, 10004 owner 10005 owner 10005 owner 10006 Notes 1st shared account 2nd shared account 1st shared account 2nd shared account 1st account 2nd account Prov PostCd Phone Email ERROR join non-existing client to account Notes No account Single account Share accounts with 10004 Share accounts with 10003 Two accounts Single account but no transactions
10001 has no account, so no transactions
10002 account will have deposits and withdrawals only spread over 2 months
10003, 10004 will have all types of transactions
10005 will have deposits, then bill payments only
10006 account will have no transactions
TRANSACTION
TxNbr TxCode AccountNbr Amount Date
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
20
21
22
23
24
25
26
X
D
D
D
D
D
W
W
D
D
W
D
W
D
P
B
P
R
D
D
D
B
B
B
B
1000001
1000000
1000001
1000001
1000001
1000001
1000001
1000001
1000001
1000002
1000002
1000003
1000003
1000003
1000003
1000002
1000002
1000002
1000004
1000005
1000005
1000005
1000005
1000005
1000005
123.45 May 1 2019
234.56 May 1 2019
345.67 May 1 2019
100.00 May 1 2019
200.00 May 11 2019
300.00 May 21 2019
50.00 May 29 2009
75.00 May 29 2009
123.45 Jun 15 2019
1000.00 May 15 2019
456.78 May 15 2019
456.78 May 15 2019
500.00 May 18 2019
100.00 May 20 2019
65.78 May 20 2019
100.00 May 21 2019
200.00 May 21 2019
50.00 May 26 2019
2000.00 Jun 1 2019
2000.00 Jun 1 2019
2000.00 Jun 1 2019
3456.78 Jun 10 2019
432.10 Jun 15 2019
100.00 Jun 20 2019
80.00 Jun 25 2019
Time
12:00
12:00
12:00
10:00
11:00
12:00
10:00
11:00
13:00
9:00
9:05
9:10
14:00
13:00
14:50
9:00
10:00
12:34
13:00
13:00
14:00
12:00
14:30
15:55
16:56
RefNbr
101
101
111
101
101
101
102
103
101
104
104
104
104
104
304
301
302
301
101
101
102
301
302
303
304
Balance
*
*
*
100.00
300.00
600.00
550.00
475.00
598.45
1000.00
543.22
456.78
-43.22
56.78
-9.00
443.22
243.22
293.22
2000.00
2000.00
4000.00
543.22
111.12
11.12
-68.88
Notes
ERROR no such TxType
ERROR non-existing Account
ERROR no such Branch
Two tx same day diff time
Two tx same day diff time
Two tx same day diff time
Two tx same day diff time
Transcribed Image Text:10001 has no account, so no transactions 10002 account will have deposits and withdrawals only spread over 2 months 10003, 10004 will have all types of transactions 10005 will have deposits, then bill payments only 10006 account will have no transactions TRANSACTION TxNbr TxCode AccountNbr Amount Date 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 21 22 23 24 25 26 X D D D D D W W D D W D W D P B P R D D D B B B B 1000001 1000000 1000001 1000001 1000001 1000001 1000001 1000001 1000001 1000002 1000002 1000003 1000003 1000003 1000003 1000002 1000002 1000002 1000004 1000005 1000005 1000005 1000005 1000005 1000005 123.45 May 1 2019 234.56 May 1 2019 345.67 May 1 2019 100.00 May 1 2019 200.00 May 11 2019 300.00 May 21 2019 50.00 May 29 2009 75.00 May 29 2009 123.45 Jun 15 2019 1000.00 May 15 2019 456.78 May 15 2019 456.78 May 15 2019 500.00 May 18 2019 100.00 May 20 2019 65.78 May 20 2019 100.00 May 21 2019 200.00 May 21 2019 50.00 May 26 2019 2000.00 Jun 1 2019 2000.00 Jun 1 2019 2000.00 Jun 1 2019 3456.78 Jun 10 2019 432.10 Jun 15 2019 100.00 Jun 20 2019 80.00 Jun 25 2019 Time 12:00 12:00 12:00 10:00 11:00 12:00 10:00 11:00 13:00 9:00 9:05 9:10 14:00 13:00 14:50 9:00 10:00 12:34 13:00 13:00 14:00 12:00 14:30 15:55 16:56 RefNbr 101 101 111 101 101 101 102 103 101 104 104 104 104 104 304 301 302 301 101 101 102 301 302 303 304 Balance * * * 100.00 300.00 600.00 550.00 475.00 598.45 1000.00 543.22 456.78 -43.22 56.78 -9.00 443.22 243.22 293.22 2000.00 2000.00 4000.00 543.22 111.12 11.12 -68.88 Notes ERROR no such TxType ERROR non-existing Account ERROR no such Branch Two tx same day diff time Two tx same day diff time Two tx same day diff time Two tx same day diff time
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Probability Problems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning