Documents:
- Conceptual model diagram
- Logical model diagram (Oracle Data Modeler)
- Schema file of CREATE TABLE statements (Oracle Data Modeler)
- PDF of full normalisation of 2 ReadMore Community Library (RCL) documents showing UNF, 1NF, 2NF and 3NF
- Output from the Oracle spool command showing the tables have been created (Oracle Data Modeler)
- Borrowers can register immediately without borrowing any books.
- A manager must be appointed to at least 1 branch.
- Borrowers register when they borrow their first book.
- A borrower can start multiple loans at the same time.
- The LGA related information is provided by Google and set to 5 characters in length.
- The amount of the transaction is retained to two decimal places of accuracy.
- Users may not pay fines on time, so the system should be able to record late fines.
- Users can borrow up to 10 books at a time and cannot continue to borrow books beyond this limit.
- The maximum period of each book borrowing is 6 months, after which the book has to be returned or renewed.
- Users must pay all fines before they can continue borrowing books, and the system should enforce this rule.
- No 2 report documents in the library may be borrowed at the same time.
Reason for adding the Surrogate Key (loan_id):Complex composite key: Since the LOAN entity has a composite key with several attributes, adding a surrogate key like loan_id simplifies the entity. This is beneficial because it:
- reduces complexity in queries, especially in joins between tables.
- improves performance when indexing the table.
- ensures each loan transaction can be uniquely identified by a simple key rather than multiple attributes.
Expected large data volume in LOAN entity: The LOAN entity is likely to hold a significant amount of data (many records), so using a simple surrogate key like loan_id can help streamline database operations and improve scalability.
Independence of Fines and Loans: While there is a correlation between Fines (FINE) and Loans (LOAN), they are of different business logic. Adding fine_id as a proxy key for the FINE entity ensures that each fine record has a separate, unique identifier that does not conflict with the loan_id in the LOAN entity.
Developed with Frank Zheng.