Question 1
14 marks
Galaxy Bank relational database design, query construction, and concurrency
- Databases
(a)
2 marks
- Identify the entities and cardinality requirements from the scenario:
- A Bank Branch hosts multiple Customers (1-to-many relationship).
- A Customer can hold multiple Loans (1-to-many relationship).
- Construct the Entity-Relationship Diagram (ERD) structure:
- BRANCH (1) ----< (has / maintains) >---- (M) CUSTOMER (1) ----< (holds / takes out) >---- (M) LOAN
Mentor tip
Ensure both 1:N relationship links are clearly directed from Branch to Customer and Customer to Loan.
(b)
2 marks
- Examine the query conditions: Amount > 600000 AND (Type = 'Home' OR Type = 'Venture').
- Filter potential rows from LOANS:
- 1) RD050789: Customer 987887982, Amount 430,000,000, Type Venture -> Matches criteria (430M > 600K).
- 2) RG903540: Customer 124567552, Amount 231,900,000, Type Venture -> Matches criteria (231.9M > 600K).
- 3) XY348801: Customer 648782904, Amount 800,000, Type Home -> Matches criteria (800K > 600K).
- Format the query result table:
- RD050789 | 987887982 | 430000000 | Venture
- RG903540 | 124567552 | 231900000 | Venture
- XY348801 | 648782904 | 800000 | Home
Mentor tip
Carefully filter out XY080911 (500,000 is not > 600,000) and ED569891 (Education type does not match Home or Venture).
(c)
4 marks
- Outline the algorithmic steps to produce the required output:
- Step 1: Perform an equi-join between CUSTOMERS and ACCOUNTS on Customer_ID (e.g. CUSTOMERS.Customer_ID = ACCOUNTS.Customer_ID).
- Step 2: Filter merged records by applying the conditional predicate Balance > 300000.
- Step 3: Project the Family_name attribute (and optionally Acct_no / Balance) from the filtered relation.
- Step 4: Output or return the resulting set of family names.
Mentor tip
Explicitly identify the two tables, the join condition on the common foreign key, the numerical condition, and the projected attribute.
(d)
3 marks
- Explain role-based access control (RBAC):
- 1) The DBMS assigns granular permission levels to different categories of users (e.g. customers, tellers, DBAs).
- 2) Customers are restricted to read-only access for their own personal accounts and loan portfolios, preventing visibility into other patrons' records.
- 3) Elevated administrative privileges are reserved strictly for system operations, safeguarding confidential financial data against unauthorized inspection or modification.
Mentor tip
Connect user privilege levels directly to preventing unauthorized viewing of sensitive financial balances.
(e)
3 marks
- Explain the role of row locking in transaction processing:
- 1) Row locking places an exclusive lock on an individual record whenever an active transaction begins modifying it.
- 2) Concurrent transactions attempting to modify the exact same row are queued or suspended until the first transaction commits or rolls back.
- 3) This eliminates race conditions, lost updates, and dirty reads, thereby maintaining ACID data consistency across the banking system.
Mentor tip
Explain that row-level locks prevent simultaneous writes without having to lock the entire table, preserving concurrency.

