Question 1
15 marks
Marble Reading Book Stores (MRBS) relational schema, queries, and ACID properties
- Databases
(a)
2 marks
- Identify the three core entities in the bookstore scenario: PUBLISHER, AUTHOR, and BOOK.
- Establish the cardinality from PUBLISHER to AUTHOR: one publisher publishes works from one or more authors (1-to-many relationship).
- Establish the cardinality from AUTHOR to BOOK: one author writes one or more books (1-to-many relationship).
- Construct the Entity-Relationship Diagram (ERD):
- PUBLISHER (1) ----< (publishes books from) >---- (M) AUTHOR (1) ----< (writes) >---- (M) BOOK
Mentor tip
Always label both the entities and the directional relationship verbs along with 1:M crow's foot or cardinality notation.
(b)
2 marks
- Recognize that Book_Title is stored as an arbitrary free-text string (VARCHAR / String data type).
- Because book titles can legitimately consist of almost any combination of words, numbers, or punctuation of varying lengths, standard automated rules like range checks, lookup lists, or strict format masks cannot verify whether a title is sensible.
Mentor tip
Contrast unrestricted string fields like titles with structured attributes like ISBN or Year_Pub, which easily support format, length, or range validation.
(c)
1 mark
- Locate the row in the BOOK table matching both conditions: Genre = "Non-fiction" AND ISBN = '0-98124-612-2'.
- Extract the projected Book_Title attribute:
- Seeking the truth
Mentor tip
Output only the exact attribute requested in the SELECT clause rather than the entire tuple.
(d)
4 marks
- Identify the required tables: BOOK (contains Book_Title) and AUTHOR (contains Publisher_Name and links to BOOK via Author_Num), optionally joining PUBLISHER.
- Join BOOK and AUTHOR on their common key: AUTHOR.Author_Num = BOOK.Author_Num.
- Filter the records where Publisher_Name = "Orlando Crux".
- Write the complete SQL statement:
- SELECT BOOK.Book_Title FROM BOOK INNER JOIN AUTHOR ON AUTHOR.Author_Num = BOOK.Author_Num WHERE AUTHOR.Publisher_Name = 'Orlando Crux';
Mentor tip
Since Publisher_Name is already present as a foreign key inside the AUTHOR table, a single INNER JOIN between BOOK and AUTHOR is sufficient, though joining PUBLISHER as well is also valid.
(e)
2 marks
- In transaction processing, atomicity ('all-or-nothing' execution) ensures that every operation within a database transaction completes successfully as a single indivisible unit.
- If any part of the transaction fails, the DBMS triggers a rollback to undo partial changes, preventing corrupted or half-updated bookstore records (note: at the attribute level, atomic fields also speed up searching and sorting by keeping values indivisible).
Mentor tip
Link transaction atomicity directly to full completion or complete rollback upon failure.
(f)
2 marks
- Provide each user with a consistent, isolated view of the data during active transactions so concurrent edits do not conflict.
- Enforce integrity constraints and validation rules before committing changes; if any constraint is violated during a transaction, reverse the uncommitted modifications via rollback to restore the database to its prior valid state.
Mentor tip
Mention how rollback mechanisms and integrity constraints work together to keep the database in a valid state before and after every transaction.
(g)
2 marks
- Redundant data duplicates the same attribute values across multiple records (for example, storing publisher details repeatedly).
- When a value changes (such as a publisher relocating to a new city), every occurrence must be updated; missing even one record causes an update anomaly and results in data inconsistency across the database.
Mentor tip
Focus on update anomalies and data inconsistency rather than minor disk storage concerns.

