IFB105 — Database Management
Practice Examination
Time allowed: 2 hours | Total: 100 marks | Conditions: Open book — paper notes permitted (no digital).
This paper has two sections. Section A is multiple choice (20 marks). Section B is short answer (80 marks). Answer all questions. Where a question says "explain", a one-sentence reason is enough. SQL questions use the GigHub case-study database on the next page. Steps 6–7 of the CSDP are not examined.
Sit it like the real thing: phone away, paper notes only, 2-hour timer. Then mark yourself against _PRACTICE_EXAM_Solutions.
The GigHub case-study database (for the SQL questions)
A live-music ticketing system. The schema (primary keys bold, foreign keys italic):
- Venue(venueID, venueName, city, capacity)
- Event(eventID, eventName, eventDate, venueID) — venueID → Venue
- Customer(customerID, firstName, lastName, email (UNIQUE), city)
- Ticket(ticketID, eventID, customerID, ticketType, price) — eventID → Event, customerID → Customer
Current data:
Venue
| venueID | venueName | city | capacity |
|---|---|---|---|
| 1 | The Triffid | Brisbane | 800 |
| 2 | The Zoo | Brisbane | 500 |
Event
| eventID | eventName | eventDate | venueID |
|---|---|---|---|
| 1 | Night Beats | 2026-07-10 | 1 |
| 2 | Indie Night | 2026-07-12 | 2 |
| 3 | Jazz Eve | 2026-07-15 | 1 |
Customer
| customerID | firstName | lastName | city | |
|---|---|---|---|---|
| 1 | Mia | Cole | mia@x.com | Brisbane |
| 2 | Leo | Park | leo@x.com | Gold Coast |
| 3 | Ana | Ruiz | ana@x.com | Brisbane |
Ticket
| ticketID | eventID | customerID | ticketType | price |
|---|---|---|---|---|
| 1 | 1 | 1 | GA | 60 |
| 2 | 1 | 2 | VIP | 120 |
| 3 | 1 | 3 | GA | 60 |
| 4 | 2 | 1 | GA | 45 |
| 5 | 3 | 3 | VIP | 90 |
| 6 | 1 | 1 | GA | 60 |
Section A — Multiple choice (20 × 1 mark = 20 marks)
Circle the single best answer.
A1. Which of the following is an elementary fact? (a) Tom is happy and Sara is sad. (b) The Student with ID 'n7' is enrolled. (c) All students passed. (d) If it rains, the match is cancelled.
A2. In "The Lecturer with StaffID 'E22' teaches IFB105", what is StaffID? (a) entity type (b) reference mode (c) value (d) predicate
A3. "The Seat with number 'A4' is reserved." What is the arity of this fact? (a) unary (b) binary (c) ternary (d) it is not a fact
A4. Each passport belongs to exactly one person, and each person has exactly one passport. This association is: (a) 1:1 (b) 1:n (c) n:1 (d) m:n
A5. Which statement is true? (a) Every super key is a candidate key. (b) Every candidate key is a super key. (c) A primary key may contain nulls. (d) An alternate key is the chosen primary key.
A6. A non-key attribute that depends on only part of a composite key is a: (a) transitive dependency (b) partial dependency (c) full dependency (d) trivial dependency
A7. A table with composite PK (StudentID, UnitID) has StudentName depending only on StudentID. It is at best in: (a) 0NF (b) 1NF (c) 2NF (d) 3NF
A8. To move a relation into 2NF you eliminate: (a) repeating groups (b) partial dependencies (c) transitive dependencies (d) foreign keys
A9. To move a relation into 3NF you eliminate: (a) partial dependencies (b) transitive dependencies (c) non-atomic values (d) candidate keys
A10. Which relational-mapping rule maps a many-to-many fact type to its own table? (a) Rule 1 (b) Rule 2 (c) Rule 3 (d) Rule 4
A11. In RMap notation, a double underline indicates: (a) a foreign key (b) an optional column (c) the primary key (d) a uniqueness constraint that is not the key
A12. Which SQL clause filters groups after aggregation? (a) WHERE (b) GROUP BY (c) HAVING (d) ORDER BY
A13. SELECT name FROM Staff WHERE name LIKE '%n'; returns names that:
(a) start with n (b) end with n (c) contain n (d) equal "n"
A14. Which statement removes all rows from table T but keeps the table?
(a) DROP TABLE T; (b) DELETE FROM T; (c) REMOVE FROM T; (d) ALTER TABLE T DROP;
A15. An INSERT supplies a foreign-key value with no matching parent row. It fails due to: (a) entity integrity (b) domain integrity (c) referential integrity (d) a syntax error
A16. Which set operator returns rows in the first query but not the second? (a) UNION (b) INTERSECT (c) EXCEPT (d) JOIN
A17. A join returning all rows from the left table plus matched right rows (NULLs where none) is a: (a) INNER JOIN (b) LEFT JOIN (c) RIGHT JOIN (d) CROSS JOIN
A18. Which mechanism hides sensitive columns from a user by exposing only a stored query? (a) Index (b) View (c) Trigger (d) Commit
A19. In the CARE principles, the principle that the community decides what data is collected and shared is: (a) Collective Benefit (b) Authority to Control (c) Responsibility (d) Ethics
A20. Which transaction (ACID) property guarantees that all operations occur or none do? (a) Atomicity (b) Consistency (c) Isolation (d) Durability
Section B — Short answer (80 marks)
B1 — Elementary facts & objects (12 marks)
(a) Write one elementary fact for each fact type represented by this table (4 marks):
| eventID | eventName | venue |
|---|---|---|
| E1 | Night Beats | The Triffid |
(b) How many objects are in this fact? (2 marks) "The Customer with customerID 'C3' bought the Ticket with ticketID 'T8' for the Event with eventID 'E1'."
(c) State the arity of: "The Ticket with ticketID 'T8' is refunded." (2 marks)
(d) Explain why elementary facts must not use logical connectives (and, or, not, if) or quantifiers (all, some). (4 marks)
B2 — Reading an ORM schema (10 marks)
An ORM schema contains the binary fact type Customer (.custID) — places — Order (.orderNr). There is a uniqueness bar under the Order role only, and a mandatory-role dot on the Customer side of places.
(a) What is the multiplicity of places (Customer to Order)? (2 marks) (b) What does the mandatory-role dot on Customer mean in plain English? (2 marks) (c) For "exactly one" to be enforced on a role, which two constraints must both be present? (2 marks) (d) State whether each CS-diagram fragment is legal or illegal, with a one-line reason (4 marks): (i) Two entity-type boxes joined directly by a line (no role box between them). (ii) A single role box connected to two different entity-type boxes.
B3 — Relational mapping (12 marks)
An ORM conceptual schema has these fact types and constraints:
- Member (.memberID) has MemberName — 1:1, functional & mandatory on Member
- Member (.memberID) has email — optional (may be null)
- Member enrolled in Class (.classID) — many-to-many
- Class (.classID) has ClassName — 1:1, functional
- Class (.classID) is led by Trainer (.trainerID) — each class has one trainer; a trainer leads many classes
- Trainer (.trainerID) has TrainerName — 1:1, functional
Produce the full relational mapping: list every relation with its columns, underline primary keys, mark optional columns with [ ], and note each foreign key (which column references which table). Apply the rules in order. (12 marks)
B4 — Normalisation to 3NF (14 marks)
The relation ENROLMENT has primary key (StudentID, UnitCode) and is in 1NF:
| StudentID | UnitCode | StudentName | UnitName | Grade | TutorID | TutorName |
|---|---|---|---|---|---|---|
| s1 | IFB105 | Mia Cole | Databases | 6 | T2 | Dahlia |
| s1 | IFB104 | Mia Cole | Building IT | 5 | T1 | Evan |
| s2 | IFB105 | Leo Park | Databases | 4 | T2 | Dahlia |
The functional dependencies are:
StudentID → StudentName · UnitCode → UnitName · (StudentID, UnitCode) → Grade, TutorID · TutorID → TutorName
(a) Is ENROLMENT in 2NF? Identify every partial dependency. (4 marks) (b) Identify the transitive dependency. (2 marks) (c) Give the 3NF schema: list each relation with PK underlined and FKs noted. (8 marks)
B5 — SQL: Data Definition (8 marks)
Write a CREATE TABLE statement for Ticket:
ticketID— integer, auto-incrementing primary keyeventID— integer, mandatory, foreign key toEvent(eventID)customerID— integer, mandatory, foreign key toCustomer(customerID)ticketType— may only be'GA','VIP', or'Backstage'price— decimal
B6 — SQL: Data Manipulation & Select (16 marks)
Use the GigHub data on page 2.
(a) For each statement, write Executed or Fail, and if it fails give the reason (6 marks):
(i) INSERT INTO Ticket VALUES (7, 2, 3, 'GA', 45);
(ii) INSERT INTO Customer VALUES (4, 'Sam', 'Day', 'mia@x.com', 'Cairns');
(iii) INSERT INTO Ticket VALUES (8, 9, 1, 'GA', 50);
(b) Write a query returning the first and last name of every customer who bought a VIP ticket. (4 marks)
(c) Write a query returning each eventName and the number of tickets sold, but only for events with more than 2 tickets. (4 marks)
(d) What does this query return (give the actual rows)? (2 marks)
SELECT eventName FROM Event
WHERE venueID = (SELECT venueID FROM Venue WHERE venueName = 'The Triffid');
B7 — Ethics: the CARE principles (8 marks)
A university obtains health data from an Indigenous community after gaining consent for a diabetes study only. Two years later, researchers reuse the same data for an unrelated genetics study without returning to the community, and publish findings that portray the community negatively.
(a) Does this comply with Authority to Control (A)? Explain. (3 marks) (b) Does this comply with Ethics (E)? Explain. (3 marks) (c) State one thing the researchers should have done to act ethically. (2 marks)
END OF PAPER — 100 marks. Now check yourself against _PRACTICE_EXAM_Solutions.
IFB105 — Practice Exam
Marking Guide & Worked Solutions
Mark Section A as 1 mark each (20). For Section B, award the marks shown; partial credit for correct method. Total 100.
Section A — answers (20 marks)
| Q | Ans | Why |
|---|---|---|
| A1 | (b) | Only "The Student with ID 'n7' is enrolled" is atomic — (a) uses and, (c) uses all, (d) uses if. |
| A2 | (b) | StaffID is the reference mode; Lecturer is the entity type, 'E22' the value. |
| A3 | (a) | One object (the Seat) plays one role → unary. |
| A4 | (a) | One-to-one — unique on both sides. |
| A5 | (b) | Every candidate key is a super key (the irreducible ones). A super key need not be a candidate key. |
| A6 | (b) | Depends on part of a composite key → partial dependency. |
| A7 | (b) | A partial dependency blocks 2NF, so it is stuck at 1NF. |
| A8 | (b) | 2NF removes partial dependencies. |
| A9 | (b) | 3NF removes transitive dependencies. |
| A10 | (a) | Rule 1 maps m:n (and ternary+) fact types to their own table. |
| A11 | (c) | Double underline = primary key (single underline = a UC). |
| A12 | (c) | HAVING filters groups after aggregation; WHERE filters rows before. |
| A13 | (b) | '%n' = ends with n. |
| A14 | (b) | DELETE FROM T; removes rows; DROP removes the whole table. |
| A15 | (c) | A dangling FK violates referential integrity. |
| A16 | (c) | EXCEPT = in first, not in second. |
| A17 | (b) | LEFT JOIN keeps all left rows. |
| A18 | (b) | A View exposes a stored query, hiding base columns. |
| A19 | (b) | Authority to Control — communities decide. |
| A20 | (a) | Atomicity = all or nothing. |
Section B — worked solutions (80 marks)
B1 — Elementary facts & objects (12)
(a) (4) One fact per fact type — two fact types here (event→name, event→venue):
- The Event with eventID 'E1' has the EventName 'Night Beats'.
- The Event with eventID 'E1' is held at the Venue named 'The Triffid'.
(Mark: 2 marks per correctly-formed elementary fact. Each must name entity type + reference mode + value and contain no connectives.)
(b) (2) 3 objects — the Customer, the Ticket, and the Event.
(c) (2) Unary (arity 1) — one object (the Ticket) plays one role (is refunded).
(d) (4) Because an elementary fact must be atomic — a single, indivisible assertion.
- Connectives (and/or/not/if) bundle several facts or conditions into one sentence, so it can be split (e.g. "Mary and David work in Sales" = two facts).
- Quantifiers (all/some) describe a set/rule rather than one specific fact about specific objects. Either makes the statement non-elementary, so it can't be drawn as a single fact type.
B2 — Reading an ORM schema (10)
(a) (2) UC under the Order role only → each Order links to at most one Customer, but a Customer can place many Orders → one-to-many (1:n) from Customer to Order.
(b) (2) The mandatory dot on Customer means every Customer must place at least one Order (each Customer instance must play the places role).
(c) (2) Uniqueness (at most one) and mandatory (at least one) — together they give exactly one.
(d) (4)
- (i) Illegal — objects must play a role; two entity types cannot be joined directly without a role box between them. (2)
- (ii) Illegal — a role can be played by only one object type. (2)
B3 — Relational mapping (12)
Apply Rule 1 (m:n) → Rule 2 (functional roles) → Rule 4 (1:1 onto the entity tables).
Member {memberID, memberName, [email]}
Class {classID, className, trainerID} FK trainerID → Trainer.trainerID
Trainer {trainerID, trainerName}
EnrolledIn {memberID, classID} FK memberID → Member.memberID,
FK classID → Class.classID
(PKs underlined in your answer.)
Marking (12):
EnrolledIntable with composite PK {memberID, classID} and both FKs — Rule 1. (3)Memberwith PK memberID, memberName mandatory,[email]optional. (3)Classwith PK classID, className, andtrainerIDplaced here as an FK (Class is the "many" side of the n:1 to Trainer → group on Class). (3)Trainerwith PK trainerID, trainerName. (2)- Foreign keys all correctly directed (point to the PK they reference). (1)
B4 — Normalisation to 3NF (14)
(a) (4) Not in 2NF. Two partial dependencies on the composite key (StudentID, UnitCode):
StudentID → StudentName(depends on only part of the key)UnitCode → UnitName(depends on only part of the key)
(b) (2) Transitive dependency: TutorID → TutorName (TutorName depends on a non-key attribute, TutorID, which itself depends on the key).
(c) (8) 3NF schema:
Student {StudentID, StudentName}
Unit {UnitCode, UnitName}
Tutor {TutorID, TutorName}
Enrolment {StudentID, UnitCode, Grade, TutorID}
FK StudentID → Student.StudentID
FK UnitCode → Unit.UnitCode
FK TutorID → Tutor.TutorID
(PKs underlined.)
Marking: Student table (2), Unit table (2), Tutor table (removing the transitive dep) (2), Enrolment fact table keyed on (StudentID, UnitCode) with Grade, TutorID and all three FKs (2).
B5 — SQL: Data Definition (8)
CREATE TABLE Ticket (
ticketID INT PRIMARY KEY AUTO_INCREMENT,
eventID INT NOT NULL,
customerID INT NOT NULL,
ticketType ENUM('GA','VIP','Backstage'),
price DECIMAL(6,2),
FOREIGN KEY (eventID) REFERENCES Event(eventID),
FOREIGN KEY (customerID) REFERENCES Customer(customerID)
);
Marking: PK + AUTO_INCREMENT (2), both NOT NULL (1), both FOREIGN KEY clauses correct (3), ticketType restricted via ENUM/CHECK (1), price decimal (1). (A CHECK (ticketType IN ('GA','VIP','Backstage')) is equally acceptable.)
B6 — SQL: DML & Select (16)
(a) (6, 2 each)
- (i) Executed — ticketID 7 is new, eventID 2 and customerID 3 both exist.
- (ii) Fail —
email 'mia@x.com'already exists for customer 1, violating the UNIQUE constraint on email. - (iii) Fail —
eventID 9does not exist in Event → referential integrity violation (the ticketID 8 and customerID 1 are fine; the eventID is the problem).
(b) (4)
SELECT DISTINCT c.firstName, c.lastName
FROM Customer c
JOIN Ticket t ON c.customerID = t.customerID
WHERE t.ticketType = 'VIP';
Result: Leo Park (ticket 2) and Ana Ruiz (ticket 5). (Marking: correct join 2, WHERE ticketType='VIP' 1, returns the right two names 1. DISTINCT not strictly required here but good practice.)
(c) (4)
SELECT e.eventName, COUNT(*) AS ticketsSold
FROM Event e
JOIN Ticket t ON e.eventID = t.eventID
GROUP BY e.eventID, e.eventName
HAVING COUNT(*) > 2;
Result: Night Beats, 4. (Event 1 has tickets 1, 2, 3, 6 → 4; events 2 and 3 have 1 each.) (Marking: join 1, GROUP BY 1, COUNT 1, HAVING > 2 (not WHERE) 1.)
(d) (2) The Triffid is venueID 1. Events at venue 1 are eventID 1 and 3, so it returns: Night Beats and Jazz Eve (i.e. the events held at The Triffid).
B7 — Ethics: CARE (8)
(a) Authority to Control — does NOT comply (3): the community gave informed consent only for the diabetes study. They had no say in the reuse of their data for the genetics study and no governance over how it was stored or applied — control was taken from them.
(b) Ethics — does NOT comply (3): the reuse caused harm (negative, stigmatising findings), ignored the power imbalance, and used the data for a future purpose the community never agreed to — failing minimise-harm, justice, and appropriate future-use.
(c) (2) Any one of: return to the community for fresh, informed consent before reuse; give the community governance/authority over the data; or assess and avoid harm before publishing.
That's the full marking guide. Aim for ≥ 50% on a first sit; anything you missed, jump back to the matching PART in the Study Guide.