42 exam-style questions on Database fundamentals — topic A3.1 of Databases in the IB Computer Science syllabus — with answers and explanations. Samples below; the full set is free with an account.
A room booking table identifies each row by the combination of ROOMID and BOOKINGDATE, because neither attribute is unique on its own. What is that combination called?
Answer: A composite primary key
A primary key may be formed from more than one attribute provided the combination is unique and no smaller part of it would do. A surrogate key is the alternative design, in which an artificial identifier is added so that a single attribute can serve as the key.
A membership table is searched by surname hundreds of times a day, and new members are added to it every few minutes. The designer creates an index on surname. Which pair of effects does this have?
Answer: Searches on surname become faster, and each new insertion becomes slower.
An index is a second, ordered structure over the surname values, so a search can go straight to the matching entries instead of examining every record. That structure has to be maintained on every insertion, so the gain in reading is paid for in writing.
A database management system enforces referential integrity. An administrator tries to delete a course record while enrolment records still refer to that course, and the deletion is refused. Which single condition would allow the same deletion to succeed?
Answer: No enrolment record refers to that course any more.
Referential integrity forbids a foreign key that points at nothing. While enrolment rows still carry that course's identifier, removing the course would leave them orphaned, so the deletion is refused; once those rows are deleted or repointed, it is allowed.
One attribute of a table is being examined. Which single observation shows that it is acting as a foreign key rather than as the primary key of that table?
Answer: The same value occurs in many rows and names a row of another table.
A primary key identifies the rows of its own table, so its values are unique and never empty. A foreign key is a copy of another table's primary key, so the same value may appear in many rows here while each value points at exactly one row over there.
A stock table stores a reorderLevel for each product. For several products the attribute is left empty, because no reorder level has been agreed. Which statement about those empty values is correct?
Answer: A null records that no value is known, and it is not the same as zero.
Null means that no value has been recorded. Zero is a value, and it would claim that the product is reordered only once the shelf is empty. Entity integrity forbids nulls in the primary key only, so a null in reorderLevel is permitted.
A club is deciding whether to keep its records in a set of separate spreadsheet files or in a relational database run by a database management system. Which single fact about the club's working practice settles the question in favour of the database?
Answer: Several officers change the same details at the same time.
A database management system controls access by several users at once and applies one set of rules to all of them, which separate files cannot do. Volume, printing habits and personal preference do not decide the question; shared editing does.
That was 6 of 42 Database fundamentals questions.
Practise all 42 freeOutlineAO1 · 1–2 marks
A brief account or summary: the main points in two or three sentences, no evaluation.
DistinguishAO2 · 2–4 marks
Make the difference clear for BOTH terms — a definition of one of them is only half an answer.
ExplainAO2 · 2–4 marks
Give reasons or causes: say what happens AND why, linking each step with 'because' or 'so that'.
42 Database fundamentals questions — free with an account. Spaced repetition, streaks and full exam simulations included.
Practise them freeThis platform is independently developed and is not endorsed by, affiliated with, or sponsored by the International Baccalaureate Organization. “International Baccalaureate” and “IB” are registered trademarks of the IBO.