Question 1
8 marks
Police investigation relational model, referential integrity, and database views
- Databases
(a)
2 marks
- Analyze the entity relationships described in the scenario:
- A police officer may conduct multiple interviews, but each interview is conducted by one officer (1-to-many relationship from POLICE_OFFICER to INTERVIEW).
- A witness may participate in multiple interviews, but each interview involves one specific witness (1-to-many relationship from WITNESS to INTERVIEW).
- Construct the Entity-Relationship Diagram (ERD):
- POLICE_OFFICER (1) -----< (conducts) >----- (M) INTERVIEW (M) -----< (involves) >----- (1) WITNESS
Mentor tip
Represent INTERVIEW as the junction entity with 'many' crow's feet terminating on it from both 1-side parent entities.
(b)
3 marks
- Reason 1 - Preventing orphan records: Enforcing foreign key constraints ensures that an interview record cannot reference a non-existent OfficerID or WitnessID.
- Reason 2 - Consistency across relational operations: Guarantees that linked attributes across related tables remain synchronized during insertions and modifications.
- Reason 3 - Cascading deletes and updates: Enables controlled cascading updates or deletions so that removing an officer or witness safely handles or restricts dependent interview logs.
Mentor tip
Focus on orphan record prevention, cross-table referential consistency, and cascading operations.
(c)
3 marks
- Virtual relation definition: A view acts as a saved SQL query (`CREATE VIEW ViewName AS SELECT ... WHERE ...`) presenting a customized subset of columns and rows without storing redundant data.
- Data abstraction and simplified reporting: Complex multi-table joins and filtering conditions are encapsulated into a simple virtual table for end users and routine weekly reports.
- Security and access control: Restricts visibility so officers only inspect fields necessary for their duties, shielding sensitive or confidential personal data.
Mentor tip
Describe a view as a stored query that provides a dynamic virtual subset without creating separate physical tables.

