- Subjects
- Computer Science
- Question bank
- A3.2 Database design
A3.2 Database design questions for IB Computer Science
91 questions on Database design, written by Augment in the style of IB exam papers. Six of them are below in full, to answer on paper.
- IB Computer Science
- Part of A3 Databases
- SL and HL
Questions by paper and level
SL and HL questions are for students at either level. HL only questions cover what only HL students study.
| Paper | SL and HL | HL only | All |
|---|---|---|---|
| Paper 1 | 85 | 4 | 89 |
| Paper 2 | 2 | 0 | 2 |
| Every paper | 87 | 4 | 91 |
Counted on
Questions to try
Written by Augment in the style of IB exams, not past papers. Answer them on paper, then check each one against its markscheme with a free account.
A secondary school records the grade each student achieves in each course. Students who fail a course may retake it in a later term. Sample data from the Result table is shown.
StudentID | CourseCode | Term | Grade |
|---|---|---|---|
S2231 | CHEM1 | 2025-T1 | 3 |
S2231 | CHEM1 | 2025-T3 | 5 |
S2231 | HIST2 | 2025-T1 | 6 |
S2304 | CHEM1 | 2025-T1 | 4 |
S2304 | HIST2 | 2025-T3 | 7 |
- (a)
Explain why StudentID cannot be the primary key of the Result table on its own.
2 marks
- (b)
Identify a suitable composite primary key for the Result table and justify your choice.
3 marks
A dog-grooming salon is designing a database to store details of dogs, their owners and their grooming appointments. The owner of the salon has written out some sample records by hand. Several owners have more than one dog, and their names, phone numbers and addresses appear again in every one of their dogs' records.
- (a)
Explain how abstraction is used when deciding which attributes to store for each dog.
3 marks
- (b)
Outline how decomposition helps when designing the database.
2 marks
- (c)
Outline how recognising the pattern in the sample records leads to a better design.
2 marks
A hospital stores admissions in a relational database. Sample data from three tables is shown.
Patient
PatientID | Surname | DateOfBirth |
|---|---|---|
70412 | Baptiste | 1958-03-11 |
70988 | Kowalski | 2001-09-27 |
71035 | Osei | 1990-12-02 |
Ward
WardCode | WardName | Floor |
|---|---|---|
CAR | Cardiology | 3 |
ORT | Orthopaedics | 2 |
Admission
PatientID | AdmitDate | WardCode | Consultant |
|---|---|---|---|
70412 | 2026-02-03 | CAR | Dr Iyer |
70988 | 2026-02-03 | ORT | Dr Moreau |
70412 | 2026-04-19 | ORT | Dr Moreau |
71035 | 2026-05-07 | CAR | Dr Iyer |
The primary key of Admission is the composite key (PatientID, AdmitDate).
- (a)
Define the term composite key.
1 mark
- (b)
Identify the two foreign keys in the Admission table.
2 marks
- (c)
Outline why (PatientID, AdmitDate) is a suitable primary key for the Admission table.
2 marks
- (d)
A clerk tries to add the record (72200, 2026-05-09, ICU, Dr Iyer) to the Admission table. There is no patient 72200 and no ward ICU.
Explain how the relational database protects data integrity in this situation.
3 marks
- (e)
The hospital is considering keeping all admissions in one wide table that also stores each patient's surname and date of birth and each ward's name and floor in every admission record.
Explain two disadvantages of this design compared with the current three tables.
4 marks
A national blood service is designing a database to record donors, the blood donations they give, and requests for blood from hospitals. A patient can only safely receive blood from certain blood groups; for example, group O negative can be given to patients of every group.
- (a)
Outline how abstraction is used when deciding what to store about each donor.
2 marks
- (b)
Describe how decomposition could be applied to designing the database.
3 marks
- (c)
Outline how recognising that compatibility between blood groups follows a fixed set of rules affects the design.
2 marks
- (d)
Identify two constraints on the database.
2 marks
- (e)
Explain why the problem specification for this database should be agreed with medical staff before it is built.
3 marks
A bakery records customer orders in a single table, OrderLog.
OrderNo | OrderDate | CustName | CustAddress | Item |
|---|---|---|---|---|
1041 | 2026-03-02 | Hana Ito | 4 Mill Lane | Sourdough |
1042 | 2026-03-02 | Raj Patel | 18 Quay Road | Croissants |
1043 | 2026-03-04 | Hana Ito | 4 Mill Lane | Rye loaf |
1044 | 2026-03-05 | Hana Ito | 27 Elm Close | Sourdough |
- (a)
Identify one item of data that is stored more than once in OrderLog.
1 mark
- (b)
State the problem shown by order 1044.
1 mark
- (c)
Explain how storing customers in a separate table linked to the orders would reduce redundancy and keep the data consistent.
3 marks
A national weather service runs 4800 automatic weather stations. Each station sends a reading every minute. Sample data from two tables is shown.
Station
StationID | Location | Elevation_m |
|---|---|---|
WS0117 | Harbour Point | 12 |
WS0482 | Ridge Pass | 1460 |
Reading
StationID | ReadingTime | Temp_C | Rain_mm |
|---|---|---|---|
WS0117 | 2026-07-14 09:00 | 18.2 | 0.0 |
WS0482 | 2026-07-14 09:00 | 6.9 | 0.4 |
WS0117 | 2026-07-14 09:01 | 18.3 | 0.0 |
WS0482 | 2026-07-14 09:01 | 6.8 | 0.6 |
- (a)
Identify a composite key that could be the primary key of the Reading table.
1 mark
- (b)
Explain why ReadingTime on its own would not be a suitable primary key.
2 marks
- (c)
Outline the relationship between the Station and Reading tables.
2 marks
- (d)
Explain one "big data" scalability issue that the weather service may face with a relational database.
3 marks
- (e)
Discuss whether a relational database is a suitable choice for the weather service.
4 marks
Practice all 91 in Augment
Free with an account. Every question has its markscheme, and Augment keeps the ones you got wrong so you can come back to them.
More questions in Databases
- A3.1Database fundamentals
- A3.2Database designThis page
- A3.3Database programming
- A3.4Alternative databases and data warehousesHL only
More on Database design
- A3.2 Database design notesWhat Database design covers, explained, with its key terms.
- IB Computer Science question bankEvery Computer Science topic counted, and one question from each with its markscheme.
- Computer Science exam formatEach Computer Science paper, how long it is and its share of the grade.
Check your answers in Augment
A free account opens all 91 questions on Database design with their markschemes, and keeps a record of what you have marked.